-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
command/show: Disable plan state lineage checks #30205
command/show: Disable plan state lineage checks #30205
Conversation
When showing a saved plan, we do not need to check the state lineage against current state, because the plan cannot be applied. This is relevant when plan and apply specify a `-state` argument to choose a non-default state file. In this case, the stored prior state in the plan will not match the default state file, so a lineage check will always error.
I see that you marked this a draft and so I'm responding here with some more woolly thoughts that I'm not intending as review so much as thinking aloud about how this command is currently designed, what the implications are of that, and thus what the implications of this change might be. I spent a little time glaring at the Reading through the steps in that command (without your proposed modifications) I see the following high-level operations, focusing on the case where there's a plan file specified:
With all of this said, I'm sure there are some lurking extra things that I skimmed over while I was reading here, because the process of backend instantiation, operation instantiation, and I think something shallow like you're attempting here is the best answer for a patch release, since significant refactoring would be too risky and disruptive, but based on my read above it does at least seem like there ought to be a variant of what |
Thank you so much for that additional detail, Martin! I was struggling to find a way to rework the I agree that this shallow fix is a reasonable one to consider for a patch release, so I'm marking this as ready for review now. |
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.
This feels like a good, focused (and thus low-risk) solution to the problem for the v1.1 series!
I think it would be nice to try to tidy this up a bit in the main branch for v1.2 if we can (stuff like what we were discussing in the PR comments above) but the priority of doing that is independent of the priority of fixing this bug, so we can discuss that elsewhere. 😀
… load the backend when we need it See #30205 (comment) for more context
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. |
When showing a saved plan, we do not need to check the state lineage against current state, because the plan cannot be applied. This is relevant when plan and apply specify a
-state
argument to choose a non-default state file. In this case, the stored prior state in the plan will not match the default state file, so a lineage check will always error.Fixes #30195