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: if without_template_settings is defined, validate revision is no… #574

Merged
merged 5 commits into from
Jan 25, 2023

Conversation

TomerHeber
Copy link
Collaborator

…t set outside of it

Issue & Steps to Reproduce / Feature Request

fixes #573

Solution

  1. Added conflicts with to schema.
  2. Added a unit test.

Copy link
Contributor

@RLRabinowitz RLRabinowitz left a comment

Choose a reason for hiding this comment

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

👍🏻

Actually I've missed something

@github-actions github-actions bot added ready to merge PR approved - can be merged once the PR owner is ready and removed pending final review labels Jan 24, 2023
Copy link
Contributor

@RLRabinowitz RLRabinowitz left a comment

Choose a reason for hiding this comment

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

Ignore my previous approval, I've missed something important
The conflict should be with the without_template_settings block in general, not with its revision

Actually I missed

Description: "the revision the environment is to be run against",
Optional: true,
Computed: true,
ConflictsWith: []string{"without_template_settings.0.revision"},
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should conflict with without_template_settings in general.

If without_template_settings block exists, the revision shouldn't exist on the resource directly

If there's a without_template_settings but no without_template_settings.revision, and there's a revision: master, the revision used will be ''

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Got it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@RLRabinowitz RLRabinowitz added reviewed - awaiting author and removed ready to merge PR approved - can be merged once the PR owner is ready labels Jan 24, 2023
Copy link
Contributor

@RLRabinowitz RLRabinowitz left a comment

Choose a reason for hiding this comment

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

👍🏻
Left one small comment on the tests

repository = "%s"
terraform_version = "%s"
type = "%s"
revision = "%s"
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO preferably remove this "revision" from the test
I think it's more important that this test fails when there's no revision in the without_template_settings at all

@github-actions github-actions bot added ready to merge PR approved - can be merged once the PR owner is ready and removed pending final review labels Jan 25, 2023
@TomerHeber TomerHeber merged commit 1f213c0 into main Jan 25, 2023
@TomerHeber TomerHeber deleted the fix-revision-without-template-#573 branch January 25, 2023 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix integration-tests provider ready to merge PR approved - can be merged once the PR owner is ready
Projects
None yet
Development

Successfully merging this pull request may close these issues.

If without_template_settings is defined, validate revision is not set outside of it
2 participants