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

Fix/do not use computed #564

Merged
merged 14 commits into from
Jul 26, 2022
Merged

Fix/do not use computed #564

merged 14 commits into from
Jul 26, 2022

Conversation

matejrisek
Copy link
Contributor

Description

Addresses issue described in this GitHub issue.
It should prevent sending trigger-patterns and trigger-prefixes in the same request, which is currently causing failures for the Terraform Enterprise with version v202205-1. The issues is occurring because this version of TFE checks for an invariant that trigger-patterns and trigger-prefixes should NOT be present at the same time. The latest Atlas codebase (and newer versions of TFE) is checking that these values (arrays) are not populated rather for the presence, meaning the issues is not present in newer versions.

The above fix is using raw configuration reading, and for that we had to bump up the SDK version to v2.8.0

This PR also addresses some other quirks we were experiencing because the fields trigger-patterns and trigger-prefixes were marked as computed. The computed trait has been removed for these fields and we introduced a more comprehensive test suite.

Remember to:

Testing plan

  1. Either test against the TFE version v202205-1 or checkout the Atlas codebase with the same git tag
  2. Create a workspace that has trigger-prefixes set
  3. The creation should NOT fail because of the presence of both trigger-prefixes and trigger-patterns

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.

$ TESTARGS="-run TestAccTFEWorkspace" make testacc

...

@matejrisek matejrisek marked this pull request as ready for review July 22, 2022 11:14
@matejrisek matejrisek requested a review from a team as a code owner July 22, 2022 11:14
@matejrisek matejrisek requested a review from a team July 22, 2022 11:14
Copy link
Contributor

@omarismail omarismail left a comment

Choose a reason for hiding this comment

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

amazing set of tests! LGTM

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.

I smoke tested this on the latest TFC and it behaved nicely, with and without the beta feature enabled.

CHANGELOG.md Outdated
@@ -3,6 +3,7 @@
ENHANCEMENTS:
* d/agent_pool: Improve efficiency of reading agent pool data when the target organization has more than 20 agent pools ([#508](https://github.com/hashicorp/terraform-provider-tfe/pull/508))
* Added warning logs for 404 error responses ([#538](https://github.com/hashicorp/terraform-provider-tfe/pull/538))
* r/tfe_workspace: Fix `trigger-prefixes` could not be updated because of the conflict with `trigger-patterns` in some cases - as described in this [GitHub Issue](https://github.com/hashicorp/terraform-provider-tfe/issues/552) ([#564](https://github.com/hashicorp/terraform-provider-tfe/pull/564/))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add this to a new Bug Fixes heading?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍🏻 1a89a9b

@matejrisek matejrisek merged commit 5c870c6 into main Jul 26, 2022
@matejrisek matejrisek deleted the fix/do-not-use-computed branch July 26, 2022 14:11
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.

None yet

3 participants