-
Notifications
You must be signed in to change notification settings - Fork 157
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-10830] add new attribute to org resource and data blocks #1169
Conversation
9529242
to
a025e00
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except for one question, the rest looks good to me!
if d.HasChange("aggregated_commit_status_enabled") { | ||
_, newVal := d.GetChange("aggregated_commit_status_enabled") | ||
options.AggregatedCommitStatusEnabled = tfe.Bool(newVal.(bool)) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to issues withGetOk
and resolving zero value for booleans, workaround to only include attribute if it has been altered. Prevents issues with aggregated_commit_status_enabled = true
changed to aggregated_commit_status_enabled = false
. Whereas it was previously omitted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This workaround makes sense to me! I think it's more readable than using GetOk
with an else
block, which confused me a bit at first.
There was a problem hiding this 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! 👍
5478d16
to
ebe256b
Compare
dd71d99
to
30c284c
Compare
@@ -35,6 +35,7 @@ The following arguments are supported: | |||
* `owners_team_saml_role_id` - (Optional) The name of the "owners" team. | |||
* `cost_estimation_enabled` - (Optional) Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a Terraform Cloud organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. | |||
* `send_passing_statuses_for_untriggered_speculative_plans` - (Optional) Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to false. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. | |||
* `aggregated_commit_status_enabled` - (Optional) Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. If enabled, `send_passing_statuses_for_untriggered_speculative_plans` needs to be false. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could use a validation in order to catch it during the plan phase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One potential way to accomplish this would be to add ConflictsWith: []string{"send_passing_statuses_..."}
to the aggregated_commit_status_enabled
attribute.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was not sure if we wanted to duplicate validation in both places but I don't mind if thats the direction we want to move in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM 😃
@@ -35,6 +35,7 @@ The following arguments are supported: | |||
* `owners_team_saml_role_id` - (Optional) The name of the "owners" team. | |||
* `cost_estimation_enabled` - (Optional) Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a Terraform Cloud organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. | |||
* `send_passing_statuses_for_untriggered_speculative_plans` - (Optional) Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to false. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. | |||
* `aggregated_commit_status_enabled` - (Optional) Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. If enabled, `send_passing_statuses_for_untriggered_speculative_plans` needs to be false. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One potential way to accomplish this would be to add ConflictsWith: []string{"send_passing_statuses_..."}
to the aggregated_commit_status_enabled
attribute.
@sebasslash Great callout! I looked into this however we want to be able to allow including both attributes, but just not both assigned to true. Not sure if ConflictsWith allows to specify conflicting keys with their values? |
30c284c
to
a6e26ab
Compare
Description
Adding new organization attribute,
aggregated_commit_status_enabled
to organization data/resource blocks.Remember to:
Testing plan
tfe_organization
resource with the required arguments:name
,email
.aggregated_commit_status_enabled
argument, then and apply the changesExample config:
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 testing.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.