-
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
deferred actions: add common functionality for evaluating unexpanded and expanded modules #35009
Conversation
…and expanded modules
fb782b5
to
ab6a8b5
Compare
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 as long as this is all mechanical refactoring like it appears to be. Might be nicer to keep the original implementation in the same location if possible though.
internal/terraform/evaluate_state.go
Outdated
|
||
// evaluationStateData is an implementation of lang.Data that resolves | ||
// references primarily (but not exclusively) using information from a State. | ||
type evaluationStateData struct { |
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.
Any reason to not leave this in the original file, at least so that the git history is easier to follow? It's also hard to compare for changes in this PR in particular.
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 just thought the separation of the various implementations into dedicated files was a slightly better layout. I don't feel strongly though so moved it back to preserve the git history as that seems reasonable!
(Just a little comment spam to backlink this from its related issue #30937) |
Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch. |
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 PR is the first step towards completing the implementation of evaluate_placeholder.go.
We create a shared subclass,
evaluateData
, that bothevaluatePlaceholderData
andevaluateStateData
share. Both of these classes now pass off the common implementations that they share to the same shared functions. Functions and structs have been moved around here, but there's no real functionality changes. The only difference is thatevaluatePlaceholderData
has now properly implementedGetPathAttr
andGetTerraformAttr
.A follow up PR will implement the remaining functions within evaluatePlaceholderData, but I wanted to do this refactor first to keep the interesting diff clear.