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

Backport of Make config errors more important during init operations into v1.5 #33650

Merged

Conversation

teamterraform
Copy link
Contributor

Backport

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

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


This PR updates the backend initialisation logic so that if the value returned by parsing the configuration isn't wholly known it returns an error diagnostic instead of crashing. This happens because we try to delay returning diagnostics until we can validate the required_versions conditions.

This PR also tweaks the ordering of which diagnostics are returned first. Previously if the backend initialisation returned diagnostics those diagnostics would be reported instead of the config parsing diagnostics. I can see the logic in that, but there is no way to differentiate between there is an error in the backend initialisation and there was an error in the backend initialisation caused by an error in the configuration. Therefore, I think it's better to simply return the configuration errors as higher priority since in the end, both will have to be fixed anyway.

@radditude - you put together the logic I'm moving around here so would be glad to hear your thoughts on my reasoning!

Another solution could be to simply return all the early config diagnostics and the backend diagnostics together instead of either/or?

Fixes #33622

Target Release

1.5.5

Draft CHANGELOG entry

BUG FIXES

  • init: Fix crash when using invalid configuration in backend blocks.

@teamterraform teamterraform force-pushed the backport/liamcervante/33622/tightly-definite-worm branch from 24d06a4 to 36b9b0a Compare August 9, 2023 09:19
@teamterraform teamterraform force-pushed the backport/liamcervante/33622/tightly-definite-worm branch from a86bbca to 9655c2f Compare August 9, 2023 09:19
@github-actions
Copy link
Contributor

github-actions bot commented Aug 9, 2023

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

Copy link
Contributor

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 Dec 12, 2023
@liamcervante liamcervante deleted the backport/liamcervante/33622/tightly-definite-worm branch February 23, 2024 13:14
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