-
Notifications
You must be signed in to change notification settings - Fork 273
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
fix(template): avoid premature disabled
flag evaluation on actions
#6448
Conversation
3d90797
to
f279492
Compare
disabled
flag evaluation on actions
f279492
to
9a1023e
Compare
b3c47dc
to
fb6a6a1
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.
Nice, this is probably a workable compromise for now.
I'm still hoping we can either lift this limitation by refactoring how the action resolution works, or introduce a more consistent behaviour in a breaking change e.g. in 0.14
core/test/data/test-projects/disabled-action-with-var-context/runs.garden.yml
Show resolved
Hide resolved
fb6a6a1
to
db08407
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.
Nice! 👏
* Do early `disabled` flag evaluation only for actions with duplicate names. * Deny the usage of `var` and `variables` contexts in early `disabled` flag evaluation. The contexts `var` and `variables` contexts are not fully resolved at that stage. That can lead to incorrectly resolved `disabled` flag values. Co-authored-by: Steffen Neubauer <[email protected]>
It can never be `WorkflowConfig`.
Co-authored-by: Steffen Neubauer <[email protected]>
9001fcf
to
154c967
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.
Awesome 👍
name: run-script | ||
type: exec | ||
var: | ||
$merge: ${actions.run["run-script"].var} |
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.
What happens if I use actions
context directly in the disabled
flag? Should we deny that as well?
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.
It's already denied, the error will be thrown:
Invalid template string (...) at path disabled: Could not find key actions. Available keys: command, datetime, environment, git, inputs, local, parent, project, secrets, template, this, var and variables.
Co-authored-by: Steffen Neubauer <[email protected]>
What this PR does / why we need it:
disabled
flag evaluation only for actions with duplicate names.var
andvariables
contexts in earlydisabled
flag evaluation.The contexts
var
andvariables
contexts are not fully resolved at that stage.That can lead to incorrectly resolved
disabled
flag values.Which issue(s) this PR fixes:
Patches #4805, #5686, #6293, and #6406.
Special notes for your reviewer: