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

Adding missing Category to VariableUpdateOptions #397

Merged
merged 1 commit into from May 12, 2022

Conversation

jtyr
Copy link
Contributor

@jtyr jtyr commented May 6, 2022

Description

This PR is adding missing Categoiry attribute to the VariableUpdateOptions method. Without this change, nobody can change the category of a Workspace variable and the only way how to remediate this is to delete the variable and create it again.

Testing plan

  1. Find a way how to change the category of a Workspace variable (there is none)

External links

The official API documentation shows that it should be possible to change the category attribute.

Output from tests (HashiCorp employees only)

$ docker run -it --rm -e TFE_ADDRESS='https://app.terraform.io' -e TFE_TOKEN="$TFE_TOKEN" -e ENABLE_TFE='1' -e TEST_RESULTS_DIR='/tmp/test_results' -v $PWD:/tmp/code --workdir /tmp/code docker.mirror.hashicorp.services/cimg/go:1.17
circleci@2abe77f7293c:/tmp/code$ mkdir -p $TEST_RESULTS_DIR
circleci@2abe77f7293c:/tmp/code$ export GO111MODULE=on
circleci@2abe77f7293c:/tmp/code$ gotestsum --format short-verbose --junitfile $TEST_RESULTS_DIR/tests.xml -- -timeout=40m -tags=integration -run TestVariablesUpdate
go: downloading github.com/google/go-querystring v1.1.0
go: downloading github.com/hashicorp/go-cleanhttp v0.5.2
go: downloading github.com/hashicorp/go-retryablehttp v0.7.0
go: downloading github.com/hashicorp/go-slug v0.8.0
go: downloading github.com/hashicorp/jsonapi v0.0.0-20210826224640-ee7dae0fb22d
go: downloading golang.org/x/time v0.0.0-20190308202827-9d24e82272b4
go: downloading github.com/hashicorp/go-uuid v1.0.2
go: downloading github.com/stretchr/testify v1.7.0
go: downloading gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
go: downloading github.com/pmezard/go-difflib v1.0.0
go: downloading github.com/davecgh/go-spew v1.1.1
PASS TestVariablesUpdate/with_valid_options (0.33s)
PASS TestVariablesUpdate/when_updating_a_subset_of_values (0.70s)
PASS TestVariablesUpdate/with_sensitive_set (0.31s)
PASS TestVariablesUpdate/with_category_set (0.61s)
PASS TestVariablesUpdate/without_any_changes (1.85s)
PASS TestVariablesUpdate/with_invalid_variable_ID (0.00s)
PASS TestVariablesUpdate/with_invalid_variable_ID#01 (0.00s)
PASS TestVariablesUpdate (5.58s)
PASS .

DONE 8 tests in 15.338s

Copy link
Contributor

@sebasslash sebasslash left a comment

Changes look good 👍

@brandonc brandonc merged commit e4ea3a7 into hashicorp:main May 12, 2022
4 checks passed
@github-actions
Copy link

github-actions bot commented May 12, 2022

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.

@jtyr jtyr deleted the jtyr-varcat branch May 13, 2022
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.

None yet

3 participants