-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Action Validate Graph #37514
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
Action Validate Graph #37514
Conversation
DanielMSchmidt
left a comment
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.
LGTM 👍
|
|
||
| Schema *providers.ActionSchema | ||
| ResolvedProvider addrs.AbsProviderConfig | ||
| *NodeAbstractAction |
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.
Asking from a lack of knowledge: Since we embedded the abstract node, can't we remove all the methods that the abstract node implements from the expand node?
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, thanks for the push! I was cautious while working on this (there's so much repetition in the resource code it's really hard to tell what's important and what just hasn't been cleaned up) but I removed everything but the GraphNodeDynamicExpandable methods and it's working fine!
| return diags | ||
| } | ||
| } else { | ||
| configVal = cty.NullVal(n.Schema.ConfigSchema.ImpliedType()) |
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.
👋🏻 Please take note of this, reviewers, 'cuz it's weird and I'm a bit concerned (basically I think it's fine, and also I don't trust myself on that). In Action Nodes we can have a nil config, and that causes panics in a few places (evalblock, msgpack), so I'm explicitly passing in a null value of the correct type during validate. Would it make more sense to do this during the config transformer step, or earlier in config parsing (not then; I don't have the schema yet for the implied type)?
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 think it's fine as is. We do the same during plan where we send the null val with the schema type as action data as well, so it seems consistent to me :)
02d7e9f to
438c901
Compare
I decided to (loosely) follow the NodeResourceAbstract pattern so that, in the next commit, I can configure the validate walk to create a NodeValidatableAction vs the default nodeExpandActionDeclaration. I am putting this in a separate commit for easier review, to show that this did not impact the current implementation.
438c901 to
c041e5a
Compare
|
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. |
This is a decently large change, so it's split into two commits; I do recommend that you look at this commit by commit.
Fixes #
Target Release
1.14.x
Rollback Plan
Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.
CHANGELOG entry