Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

liamcervante
Copy link
Member

This PR is the first step towards completing the implementation of evaluate_placeholder.go.

We create a shared subclass, evaluateData, that both evaluatePlaceholderData and evaluateStateData 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 that evaluatePlaceholderData has now properly implemented GetPathAttr and GetTerraformAttr.

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.

Copy link
Member

@jbardin jbardin left a 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.


// evaluationStateData is an implementation of lang.Data that resolves
// references primarily (but not exclusively) using information from a State.
type evaluationStateData struct {
Copy link
Member

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.

@apparentlymart
Copy link
Member

(Just a little comment spam to backlink this from its related issue #30937)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants