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
Address a few inconsistencies in how we process root module input variables vs. called module input variables #29959
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
8e58f59
core: Remove TestContext2Validate_PlanGraphBuilder
apparentlymart 72bff83
core: Handle root and child module input variables consistently
apparentlymart 630500e
core and backend: remove redundant handling of default variable values
apparentlymart d1de8ba
core: More accurate error message for invalid variable values
apparentlymart File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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 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 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 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 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
Oops, something went wrong.
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.
In #30312 I came to mostly the same functional conclusions you did here about module variables, but opted to unify handling in the module exec node. Dealing with the default feels very much outside the graph building responsibilities of creating and connecting the nodes, and I definitely found the fake expression which was injected before any evaluation very surprising.
If that's something which can be fixed but you want to leave that for later to keep this PR from growing, I can wait for this to land and do the refactoring 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.
I'm not exactly sure what you're referring to here, probably at least in part because I've not been looking at this PR for several weeks and so I no longer have the context loaded 😀 , but I would generally prefer to avoid growing the scope of this even more if it seems correct enough, since it already sprawled a lot more than I wanted and is at high risk of becoming conflicted as we start other work. If you do have ideas for further improvements then I'd love to discuss them in a followup PR though, assuming that would be motivated by maintainability rather than by correctness. (I say that just because my original intent here was to fix a bug, and I only ended up refactoring when I learned that the bug was caused by a design problem.)
I believe my thought process here was that we ought to never have included the default values in this JSON plan output at all, and that they only really ended up here as an unintended side-effect of a strange separation of concerns elsewhere. The place to look for default values for variables would be a hypothetical JSON serialization of the configuration, because default values belong to the configuration rather than to the plan. Ideally it should be possible to see from this JSON plan output whether a particular variable was set or not, and perhaps one day we'll find some way to opt-in to that (arguably) better behavior, and so this special case is here to keep this oddity isolated out here in the one system we'd be changing anyway if we were to "fix" this, rather than having this backward-compatibility shim effectively spread across multiple subsystems.
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.
That's totally reasonable. I can follow up and see if anything from 30312 is still applicable afterwards, but the changes here also seem to fix the processing order for module variables.