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 1 commit into from May 12, 2022


Copy link

@jtyr jtyr commented May 6, 2022


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='' -e TFE_TOKEN="$TFE_TOKEN" -e ENABLE_TFE='1' -e TEST_RESULTS_DIR='/tmp/test_results' -v $PWD:/tmp/code --workdir /tmp/code
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 v1.1.0
go: downloading v0.5.2
go: downloading v0.7.0
go: downloading v0.8.0
go: downloading v0.0.0-20210826224640-ee7dae0fb22d
go: downloading v0.0.0-20190308202827-9d24e82272b4
go: downloading v1.0.2
go: downloading v1.7.0
go: downloading v3.0.0-20200313102051-9f266ea9e77c
go: downloading v1.0.0
go: downloading 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)

DONE 8 tests in 15.338s

Copy link

@sebasslash sebasslash left a comment

Changes look good 👍

@brandonc brandonc merged commit e4ea3a7 into hashicorp:main May 12, 2022
4 checks passed
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 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
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

3 participants