Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BETA] Create a project-owned varset #992

Merged

Conversation

jbonhag
Copy link
Contributor

@jbonhag jbonhag commented Oct 25, 2024

Description

This adds an optional Parent relationship to a variable set, which allows setting either an organization or a project as the varset's parent. This is a feature that allows a variable set to be owned directly by a project.

Testing plan

  1. An example of creating a project-owned varset is included in TestVariableSetsCreate
  2. Without the feature enabled, the Parent relationship will be ignored by the backend, and will not be returned from the API.

Output from tests

❯ TFE_ADDRESS="<address>" TFE_TOKEN="<token>" ENABLE_BETA=1 go test ./... -v -run "TestVariableSets(Create|Read)"

?   	github.com/hashicorp/go-tfe/examples/backing_data	[no test files]
?   	github.com/hashicorp/go-tfe/examples/configuration_versions	[no test files]
?   	github.com/hashicorp/go-tfe/examples/organizations	[no test files]
?   	github.com/hashicorp/go-tfe/examples/registry_modules	[no test files]
?   	github.com/hashicorp/go-tfe/examples/run_errors	[no test files]
?   	github.com/hashicorp/go-tfe/examples/state_versions	[no test files]
?   	github.com/hashicorp/go-tfe/examples/users	[no test files]
?   	github.com/hashicorp/go-tfe/examples/workspaces	[no test files]
?   	github.com/hashicorp/go-tfe/mocks	[no test files]
=== RUN   TestVariableSetsCreate
=== RUN   TestVariableSetsCreate/with_valid_options
=== RUN   TestVariableSetsCreate/when_options_is_missing_name
=== RUN   TestVariableSetsCreate/when_options_is_missing_global_flag
=== RUN   TestVariableSetsCreate/when_creating_project-owned_variable_set
--- PASS: TestVariableSetsCreate (2.04s)
    --- PASS: TestVariableSetsCreate/with_valid_options (0.39s)
    --- PASS: TestVariableSetsCreate/when_options_is_missing_name (0.00s)
    --- PASS: TestVariableSetsCreate/when_options_is_missing_global_flag (0.00s)
    --- PASS: TestVariableSetsCreate/when_creating_project-owned_variable_set (0.83s)
=== RUN   TestVariableSetsRead
=== RUN   TestVariableSetsRead/when_the_variable_set_exists
=== RUN   TestVariableSetsRead/when_variable_set_does_not_exist
=== RUN   TestVariableSetsRead/with_parent_relationship
--- PASS: TestVariableSetsRead (1.70s)
    --- PASS: TestVariableSetsRead/when_the_variable_set_exists (0.20s)
    --- PASS: TestVariableSetsRead/when_variable_set_does_not_exist (0.19s)
    --- PASS: TestVariableSetsRead/with_parent_relationship (0.18s)
PASS
ok  	github.com/hashicorp/go-tfe	4.039s

@jbonhag jbonhag requested a review from a team October 25, 2024 15:46
@jbonhag jbonhag self-assigned this Oct 25, 2024
Copy link
Contributor

@netramali netramali left a comment

Choose a reason for hiding this comment

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

Should we add a comment to the CHANGELOG?

@ctrombley
Copy link
Collaborator

Should we add a comment to the CHANGELOG?

That would be most excellent! I'm planning on a release today so I'll try and get this change in if the timing works.

netramali
netramali previously approved these changes Oct 25, 2024
Copy link
Contributor

@netramali netramali left a comment

Choose a reason for hiding this comment

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

Other than the changelog looks good! Let me know if you need another approval :)

@ctrombley ctrombley merged commit 588526b into main Oct 25, 2024
7 checks passed
@ctrombley ctrombley deleted the jbonhag/TF-20781-go-tfe-create-project-owned-varset-beta branch October 25, 2024 19:10
Copy link

Reminder to the contributor that merged this PR: if your changes have added important functionality or fixed a relevant bug, open a follow-up PR to update CHANGELOG.md with a note on your changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants