Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Backport of Fix diagnostic & avoid variable override via environment into v1.11 #36438

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Feb 5, 2025

Backport

This PR is auto-generated from #36435 to be assessed for backporting due to the inclusion of the label 1.11-backport.

The below text is copied from the body of the original PR.


Fixes #36410

It turns out the ordering of variable source evaluation is correct, it's just the diagnostic message that is wrong due to mixed ordering of arguments to fmt.Sprintf.

While the original report in #36410 suggests overriding variables via environment variables to be silently ignored, I think we cannot just make the same argument as was made in #36180

Specifically - We cannot expect users to be deleting autoloadable tfvars files. I do think it's reasonable to expect them to unset environment variables between plan and apply. Also, more importantly we only raise the diagnostic when values differ anyway.

That said after some consideration I chose to propose a warning that is still somewhat ignorable, just possibly noisy. I believe that is a good compromise that will not break workflows but still highlight what we consider anti-pattern.

Target Release

1.10.x

CHANGELOG entry

  • This change is user-facing and I added a changelog entry.
  • This change is not user-facing.

Overview of commits

@github-actions github-actions bot force-pushed the backport/b-avoid-var-override-via-env/awfully-central-grubworm branch from 950c777 to 13e1f42 Compare February 5, 2025 17:27
@github-actions github-actions bot requested a review from radeksimko February 5, 2025 17:27
@radeksimko radeksimko marked this pull request as ready for review February 5, 2025 17:28
@radeksimko radeksimko requested a review from a team as a code owner February 5, 2025 17:28
@radeksimko radeksimko merged commit ed83e11 into v1.11 Feb 6, 2025
7 checks passed
@radeksimko radeksimko deleted the backport/b-avoid-var-override-via-env/awfully-central-grubworm branch February 6, 2025 09:24
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant