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

[#TF-720] Add allow_force_delete_workspaces organization setting to the tfe provider #661

Merged
merged 5 commits into from
Nov 8, 2022

Conversation

emlanctot
Copy link
Contributor

@emlanctot emlanctot commented Oct 14, 2022

Description

This change adds the allow_force_delete_workspaces setting to the TFE provider.

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

Please run applicable acceptance tests locally and include the output here. See TESTS.md to learn how to run acceptance tests.

If you are an external contributor, your contribution(s) will first be reviewed before running them against the project's CI pipeline.

/opt/homebrew/Cellar/go/1.19.2/libexec/bin/go tool test2json -t /private/var/folders/2z/33zp571x44v_ndv_hk8cyy1w0000gp/T/GoLand/___1TestAccTFEOrganization_basic_in_github_com_hashicorp_terraform_provider_tfe_tfe.test -test.v -test.paniconexit0 -test.run ^\QTestAccTFEOrganization_basic\E$
=== RUN   TestAccTFEOrganization_basic
--- PASS: TestAccTFEOrganization_basic (8.08s)
PASS

Process finished with the exit code 0



/opt/homebrew/Cellar/go/1.19.2/libexec/bin/go tool test2json -t /private/var/folders/2z/33zp571x44v_ndv_hk8cyy1w0000gp/T/GoLand/___1TestAccTFEOrganization_full_in_github_com_hashicorp_terraform_provider_tfe_tfe.test -test.v -test.paniconexit0 -test.run ^\QTestAccTFEOrganization_full\E$
=== RUN   TestAccTFEOrganization_full
--- PASS: TestAccTFEOrganization_full (7.31s)
PASS

Process finished with the exit code 0

@emlanctot emlanctot requested a review from a team October 14, 2022 22:00
@hashicorp-cla
Copy link

hashicorp-cla commented Oct 14, 2022

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@JarrettSpiker JarrettSpiker left a comment

Choose a reason for hiding this comment

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

Looks good to me!

We will just need to wait until the go-tfe changes are merged and released, and update this to point at the released version!

@emlanctot emlanctot marked this pull request as ready for review October 17, 2022 17:18
@emlanctot emlanctot requested a review from a team as a code owner October 17, 2022 17:18
Copy link
Contributor

@JarrettSpiker JarrettSpiker left a comment

Choose a reason for hiding this comment

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

Looks good to me! I don't know that I have approval permissions on this repo, though, let's see...

Copy link
Collaborator

@brandonc brandonc left a comment

Choose a reason for hiding this comment

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

Code review. Smoke test forthcoming

"allow_force_delete_workspaces": {
Type: schema.TypeBool,
Optional: true,
Default: false,
Copy link
Collaborator

@brandonc brandonc Nov 7, 2022

Choose a reason for hiding this comment

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

Since the API produces the default value, you may want to remove Default and set Computed to true. My understanding of Default is that we use it when we want the provider to set a state value, perhaps to backfill a new required field? I'm going to smoke test both cases, but the other settings in this schema seem to rely on the API defaults so it would be strange to have a new argument with slightly different behavior.

Copy link
Collaborator

@brandonc brandonc left a comment

Choose a reason for hiding this comment

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

OK so I tested 3 scenarios and found some interesting behavior differences:

  1. Optional: true, Default: false did not show the field in the plan but stored false in state
  2. Optional: true, Computed: true showed the field in the plan as (known after apply) and stored false in state.
  3. Optional: true with no other options had the same behavior as Optional: true, Default: false

I expected something different!

@brandonc brandonc merged commit 99571bf into main Nov 8, 2022
@brandonc brandonc deleted the el/tf-720 branch November 8, 2022 00:22
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.

4 participants