-
Notifications
You must be signed in to change notification settings - Fork 10.1k
fix: Make state show command exit with code 1 if the stored state cannot be marshalled for rendering
#37933
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
Merged
+69
−0
Merged
fix: Make state show command exit with code 1 if the stored state cannot be marshalled for rendering
#37933
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| kind: BUG FIXES | ||
| body: '`state show`: The `state show` command will now explicitly fail and return code 1 when it fails to render the named resources state' | ||
| time: 2025-11-21T18:30:45.571448Z | ||
| custom: | ||
| Issue: "37933" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be considered a breaking change?
I'd argue not, as the old behaviour was misleading and incorrect, though someone could have built a system that relied on the command not failing somewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On some level every fix in terraform has the potential to be a breaking change - the longer the behavior is present, the more likely people have already accounted for it in their workflows.
This is about the least-concerning breaking change I can think of since it's not a change in anything that modifies state and even if someone's automation for e.g. carefully checks for that error message if the show command succeeds (to understand that it actually failed), changing the exit code to properly return 1 probably isn't going to break anything.
I'd still call it a bug fix, but not a bad idea to get some other opinions! My process instincts are outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah agreed, previous projects I've worked on have been strict about breaking changes but in those cases state was always being modified. I don't think we have a blanket block on breaking changes here in Core as there's more grey area, but figured I'd flag to the reviewer anyways.
I'm happy to go ahead with this as a bug fix.