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

configs: A test for the regression reported in #31081 #31097

Merged
merged 1 commit into from May 20, 2022

Conversation

apparentlymart
Copy link
Member

#31091 addressed a regression in the logic for catching when the newer module meta-arguments are used in conjunction with the legacy practice of including provider configurations inside modules, where the check started incorrectly catching situations where the legacy nested provider configuration was in the same module as the child call using one of those meta-arguments.

This is a regression test to catch if a similar bug arises in the future.

Since it's testing validation rules that apply to an entire configuration tree, it ended up in a rather idiosyncratic location under the configload package, rather than directly in configs. The configs package only knows how to load one module at a time, so it's harder to write a test like this in that context. Due to it being further removed from the code it is testing, I included a test for the correct error too in order to increase the chance that we'll learn if future changes in the "configs" package invalidate this regression test.

I've verified that this new test fails without the change made in the earlier commit.

@apparentlymart apparentlymart added the 1.2-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged label May 20, 2022
@apparentlymart apparentlymart requested a review from a team May 20, 2022 17:58
@apparentlymart apparentlymart self-assigned this May 20, 2022
@apparentlymart
Copy link
Member Author

This seems to be failing in CI in a way it didn't fail on my own system, so I'm going to debug that now.

@apparentlymart
Copy link
Member Author

Ahh... I removed the empty grandchild .tf file before merging and so Git now believes the directory doesn't exist at all. I'll put some stub files back there again to make it work.

5417975 addressed a regression in the
logic for catching when the newer module meta-arguments are used in
conjunction with the legacy practice of including provider configurations
inside modules, where the check started incorrectly catching situations
where the legacy nested provider configuration was in the same module
as the child call using one of those meta-arguments.

This is a regression test to catch if a similar bug arises in the future.

Since it's testing validation rules that apply to an entire configuration
tree, it ended up in a rather idiosyncratic location under the "configload"
package, rather than directly in "configs". The "configs" package only
knows how to load one module at a time, so it's harder to write a test
like this in that context. Due to it being further removed from the code
it is testing, I included a test for the correct error too in order to
increase the chance that we'll learn if future changes in the "configs"
package invalidate this regression test.

I've verified that this new test fails without the change made in the
earlier commit.
@github-actions
Copy link

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

@github-actions
Copy link

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 Jun 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1.2-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants