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

Wait for module version to be created if the no-code version_pin is set #1504

Merged
merged 7 commits into from
Oct 30, 2024

Conversation

dsa0x
Copy link
Contributor

@dsa0x dsa0x commented Oct 22, 2024

Description

  • This makes the change to wait for the registry module version to be ingressed, before creating the no-code module. Otherwise, the no-code variable options will not be created on first try since the version may not exist, and variable options are tied to a specific version of the module.
  • This change also enforces that the variable options attribute must be used with the version_pin attribute, i.e if the variable options is set, then the version pin must also be set.

Remember to:

Testing plan

  1. Set the following environment variables
os.Setenv("TF_ACC", "1")
	os.Setenv("TFE_HOSTNAME", "E.g app.staging.terraform.io")
	os.Setenv("TFE_TOKEN", "sd4HQNPs.atlasv1.fccmoesk")
	os.Setenv("GITHUB_REGISTRY_MODULE_IDENTIFIER", "hashicorp/terraform-random-module")
	os.Setenv("GITHUB_TOKEN", "ghp_uofoobarbaz")
  1. Ensure that the github token can access the hashicorp module
  2. Ensure that the tfe token is from a business organization (so that no-code feature can be accessed).
  3. Run the test with go test -v -timeout 60s -run ^TestAccTFENoCodeModule_with_variable_options$ github.com/hashicorp/terraform-provider-tfe/internal/provider
  4. The test should pass

External links

Include any links here that might be helpful for people reviewing your PR. If there are none, feel free to delete this section.

Output from acceptance tests

$ go test -v -timeout 60s -run ^TestAccTFENoCodeModule_with_variable_options$ github.com/hashicorp/terraform-provider-tfe/internal/provider
=== RUN   TestAccTFENoCodeModule_with_variable_options
--- PASS: TestAccTFENoCodeModule_with_variable_options (16.10s)
PASS
ok      github.com/hashicorp/terraform-provider-tfe/internal/provider   16.575s

...

@dsa0x dsa0x force-pushed the sams/TFECO-6399-read-by-external-id branch from 80f081a to 4547d26 Compare October 22, 2024 14:49
@dsa0x dsa0x force-pushed the sams/TFECO-6399-read-by-external-id branch from 4547d26 to 69bd72a Compare October 22, 2024 15:20
@dsa0x dsa0x changed the title Wait for module version to be created before creating variable options Wait for module version to be created if the no-code version_pin is set Oct 23, 2024
@dsa0x dsa0x force-pushed the sams/TFECO-6399-read-by-external-id branch from 3a8adec to f0a28ed Compare October 23, 2024 08:12
@dsa0x dsa0x marked this pull request as ready for review October 28, 2024 06:10
@dsa0x dsa0x requested a review from a team as a code owner October 28, 2024 06:10
@dsa0x dsa0x requested a review from a team October 28, 2024 06:10
@dsa0x dsa0x merged commit af4af7a into main Oct 30, 2024
6 checks passed
@dsa0x dsa0x deleted the sams/TFECO-6399-read-by-external-id branch October 30, 2024 08:01
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.

2 participants