-
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
Introduce separate testing scope for reference validation #33339
Conversation
8d965a4
to
26d74ec
Compare
26d74ec
to
fa5c7d3
Compare
…te/testing-scope-one
7678a02
to
9183fc2
Compare
type OutputValue struct { | ||
referenceable |
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 cannot find any cases of this, but something to look out for is code which is meant to exclude things like outputs by checking if the address is referenceable.
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. |
We need to reference outputs and check blocks from the testing scope. This PR introduces a separate function for parsing referencing that can be called from within the testing context. It also updates the existing functions that create
hcl.EvalContext
objects so they now accept a function to parse references as part of their signature. This way callers can customise the scope by providing their own list of acceptable references via the parse references function.A follow up PR will actually use the new functionality from the testing scope. I've split those up to keep reviewing things as easy as possible. This means this PR is essentially a refactor, with no behaviour change or new functionality introduced.
This PR:
GetOutput
andGetCheckBlock
functions to thelang.Data
interface.addrs.OutputValue
as referenceableParseRef
function that retrieves a different set of references for within the testing scopelang.Scope
struct to dynamically retrieve different references based on the caller, so the testing scope and main context scope can be different.