-
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(core): fix default environment resolution #2051
Conversation
9a7b6ce
to
79a2cb9
Compare
@@ -1,5 +1,6 @@ | |||
kind: Project | |||
name: test-project-templated | |||
defaultEnvironment: "${local.env.TEST_VARIABLE == 'banana' ? 'local' : 'local'}" |
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.
Where and how is this actually tested?
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.
This test project is used in the "should resolve templated env variables in project config"
case in the unit tests for the Garden
class.
Before the fix, it failed with the error reported by Mitchell (and now no longer fails).
It's essentially just verifying that template strings are, in fact, resolved on config.defaultEnvironment
in Garden.factory
.
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 would definitely have been cleaner to do this inline in the test case, but Garden.factory
reads the file from the FS.
Maybe I should add a comment to this config referring to the test case where it's used?
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.
Nah it's alright for this instance, but yeah going forward we should inline the configuration where possible.
This fixes a regression in the resolution flow for template strings in `project.defaultEnvironment`.
79a2cb9
to
d523407
Compare
What this PR does / why we need it:
This fixes a regression in the resolution flow for template strings in
project.defaultEnvironment
.