Skip to content

Feat: add project tags support#1084

Merged
yarden-fishler-dev merged 3 commits intomainfrom
eng-1279-provider-to-have-project-tagging
Mar 8, 2026
Merged

Feat: add project tags support#1084
yarden-fishler-dev merged 3 commits intomainfrom
eng-1279-provider-to-have-project-tagging

Conversation

@yarden-fishler-dev
Copy link
Contributor

@yarden-fishler-dev yarden-fishler-dev commented Mar 5, 2026

Add tags field to env0_project resource and data sources (env0_project, env0_projects).

Changes

  • Add Tags []string to Project, ProjectCreatePayload, and ProjectUpdatePayload client structs
  • Add tags as an Optional attribute on env0_project resource
  • Add tags as a Computed attribute on env0_project and env0_projects data sources
  • Add unit tests for create and update with tags
  • Regenerate mocks and update docs

QA

Tested manually against PR environment with locally built provider:

  • Create project with tags ["env", "zero"]
  • Create project without tags
  • Remove tags from existing project (update to empty)
  • Re-add tags to existing project
  • Destroy both projects
  • Data source reads tags — created source project with tags, read via data "env0_project", and passed tags to a consumer project
  • Update source project tags and verify data source + consumer project update accordingly
  • Destroy source, data source, and consumer projects

Description string `json:"description"`
ParentProjectId string `json:"parentProjectId,omitempty" tfschema:",omitempty"`
Hierarchy string `json:"hierarchy"`
Tags []string `json:"tags" tfschema:"tags"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run go fmt please for formatting

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Description string `json:"description"`
ParentProjectId string `json:"parentProjectId,omitempty" tfschema:",omitempty"`
Hierarchy string `json:"hierarchy"`
Tags []string `json:"tags" tfschema:"tags"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer adding omitempty here I think, in order to not have the tags field in the JSON appear at all if there are no tags
Same for create and update payload

Copy link
Contributor Author

@yarden-fishler-dev yarden-fishler-dev Mar 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've discussed this face to face, adding omitempty will also omit empty array, which might interfere with update actions that would like to remove all tags explicitly by putting [] in the request

@yarden-fishler-dev yarden-fishler-dev merged commit 3fb2d28 into main Mar 8, 2026
3 checks passed
@yarden-fishler-dev yarden-fishler-dev deleted the eng-1279-provider-to-have-project-tagging branch March 8, 2026 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants