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

Add SpeculativePlanManagementEnabled organization setting #983

Merged
merged 1 commit into from
Oct 25, 2024

Conversation

lilincmu
Copy link
Contributor

@lilincmu lilincmu commented Sep 25, 2024

Description

This PR adds a new organization field, SpeculativePlanManagementEnabled, that can toggle the behavior of Automatically cancel plan-only runs.

Testing plan

  1. Generate the required environment variables for go test, TFE_ADDRESS and TFE_TOKEN
  2. Run TFE_ADDRESS="https://example" TFE_TOKEN="example" go test ./... -v -run TestOrganizationsUpdate. The tests should pass.

External links

Output from tests

Including output from tests may require access to a TFE instance. Ignore this section if you have no environment to test against.

$ TFE_ADDRESS="https://example" TFE_TOKEN="example" go test ./... -v -run TestOrganizationsUpdate
=== RUN   TestOrganizationsUpdate
=== RUN   TestOrganizationsUpdate/with_HCP_Terraform-only_options
=== RUN   TestOrganizationsUpdate/with_new_AggregatedCommitStatusEnabled_option
=== RUN   TestOrganizationsUpdate/with_new_SpeculativePlanManagementEnabled_option
=== RUN   TestOrganizationsUpdate/with_valid_options
=== RUN   TestOrganizationsUpdate/with_invalid_name
=== RUN   TestOrganizationsUpdate/with_agent_pool_provided,_but_remote_execution_mode
=== RUN   TestOrganizationsUpdate/when_only_updating_a_subset_of_fields
=== RUN   TestOrganizationsUpdate/with_different_default_execution_modes
--- PASS: TestOrganizationsUpdate (8.03s)
    --- PASS: TestOrganizationsUpdate/with_HCP_Terraform-only_options (0.77s)
    --- PASS: TestOrganizationsUpdate/with_new_AggregatedCommitStatusEnabled_option (1.50s)
    --- PASS: TestOrganizationsUpdate/with_new_SpeculativePlanManagementEnabled_option (1.36s)
    --- PASS: TestOrganizationsUpdate/with_valid_options (1.06s)
    --- PASS: TestOrganizationsUpdate/with_invalid_name (0.00s)
    --- PASS: TestOrganizationsUpdate/with_agent_pool_provided,_but_remote_execution_mode (0.75s)
    --- PASS: TestOrganizationsUpdate/when_only_updating_a_subset_of_fields (0.59s)
    --- PASS: TestOrganizationsUpdate/with_different_default_execution_modes (1.47s)
PASS
ok      github.com/hashicorp/go-tfe     8.645s
...

@lilincmu lilincmu force-pushed the lilincmu/speculative-plan-management-enabled branch from 481fa4f to e0d3097 Compare September 25, 2024 22:16
@lilincmu lilincmu force-pushed the lilincmu/speculative-plan-management-enabled branch 2 times, most recently from 1a4e26d to d2e9d6a Compare October 22, 2024 22:04
@lilincmu lilincmu marked this pull request as ready for review October 22, 2024 22:25
roleesinhaHC
roleesinhaHC previously approved these changes Oct 25, 2024
Copy link
Contributor

@roleesinhaHC roleesinhaHC left a comment

Choose a reason for hiding this comment

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

lgtm!

Copy link
Contributor

@ctrombley ctrombley left a comment

Choose a reason for hiding this comment

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

LGTM

@ctrombley ctrombley merged commit de9170a into main Oct 25, 2024
7 checks passed
@ctrombley ctrombley deleted the lilincmu/speculative-plan-management-enabled branch October 25, 2024 20:08
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