-
Notifications
You must be signed in to change notification settings - Fork 37
Change reference()
to use the raw output of a resource
#634
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
Conversation
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.
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
Files not reviewed (1)
- dsc/tests/dsc_reference.tests.ps1: Language not supported
Comments suppressed due to low confidence (1)
dsc_lib/src/functions/reference.rs:33
- The error message should be updated to specify that the key was not found in 'references' instead of 'outputs'.
Err(DscError::Parser(t!("functions.reference.keyNotFound", key = key).to_string()))
$out = dsc config get -f $PSScriptRoot/../examples/reference.dsc.yaml | ConvertFrom-Json | ||
It 'Reference works for <operation>' -TestCases @( | ||
@{ operation = 'get' }, | ||
@{ operation = 'test' } |
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.
are there any tests for reference with set
and export
?
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.
Not at this time, will add later
PR Summary
As discussed,
reference()
now refers to the raw output of a prior resource invocation and not the decorated one that comes from DSC engine. This is because the decoration is different forget
,set
,test
, andexport
such that use of this function means you can't use the same config for bothget
andtest
, for example.Had to update version of tree-sitter to get past the failures in CI but not locally (also updated some other crates)
Also renamed an internal member to
references
instead ofoutputs
so that the comment is no longer needed.We'll defer the ability to access the decorated output as it's additive and not breaking until we have a real scenario to need it.
PR Context
Fix #389