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

Merged
merged 3 commits into from
May 13, 2024

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.

Copy link
Member Author

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!

@apparentlymart
Copy link
Contributor

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

@liamcervante liamcervante merged commit e40bb9b into main May 13, 2024
7 checks passed
Copy link
Contributor

Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch.

@liamcervante liamcervante deleted the liamcervante/deferred-references branch May 24, 2024 06:02
Copy link
Contributor

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.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants