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

terraform test: Keep modules in state if they are required by the external references #34482

Merged
merged 3 commits into from
Jan 5, 2024

Conversation

liamcervante
Copy link
Member

This PR updates the v1.7 branch such that it won't remove "empty" modules from state if they have external references pointing to their outputs.

This does potentially increase the size of the state files, but currently it will only affect the terraform test framework as the external references are only set by the testing framework. This has been fixed "properly" in main, so it also means that slight hack implemented here will only be present in the v1.7 branch. Overall, I think that makes the approach here acceptable given the temporary nature of the fix. I had attempted to port over the real fix in #34477, but it was rightly pointed out that it's a bit overkill and potentially risky so close to an upcoming release. Hopefully, this is an acceptable middle ground.

Fixes #34476

Target Release

1.7.0-rc2

Draft CHANGELOG entry

BUG FIXES

  • terraform test: Fix bug where outputs in "empty" modules were not available to the assertions from Terraform test files.

@liamcervante liamcervante requested a review from a team January 4, 2024 20:06
Copy link
Contributor

@apparentlymart apparentlymart left a comment

Choose a reason for hiding this comment

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

This looks good to me!

It's encouraging that the new logic here is limited to only one function (nodeCloseModule.Execute) and that the rest of this is really just giving that function the data it needs to do that work.

@liamcervante liamcervante merged commit 04f1e99 into v1.7 Jan 5, 2024
6 checks passed
@liamcervante liamcervante deleted the liamcervante/34476-17 branch January 5, 2024 06:59
Copy link
Contributor

github-actions bot commented Jan 5, 2024

Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch.

Copy link
Contributor

github-actions bot commented Feb 5, 2024

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants