-
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
perf: optimise template string resolving performance #6685
Conversation
We optimise the template string resolving performance by making sure that we only parse each template expression once. Once parsed, we use the AST to evaluate template expressions.
Co-authored-by: Vladimir Vagaytsev <[email protected]>
Co-authored-by: Vladimir Vagaytsev <[email protected]>
ScanContext does not work with AST, because it does not eagerly resolve all variables anymore. we have to walk the AST intead.
…in action references
Co-authored-by: Steffen Neubauer <[email protected]>
0a6afb7
to
3397b0e
Compare
620ecc5
to
3a71187
Compare
@@ -1,5 +1,5 @@ | |||
require: | |||
- build/test/setup.js | |||
- ../../../../build/test/setup.js |
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.
Seems a little odd - What prompted this change?
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.
Vovas IDE needed it to be able to run tests, and it didn't seem to have an effect on CI
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.
But I agree it's odd, will have a closer look at this
operators (`!` and `typeof`). Older versions of garden did not throw an error when referencing missing variables from unary operators like `!` and `typeof`. This commit restores backwards-compatiblity that has been broken in #6685
…ary operators (`!` and `typeof`). (#6695) fix: retain bug-compatibility for referencing missing variables in unary operators (`!` and `typeof`). Older versions of garden did not throw an error when referencing missing variables from unary operators like `!` and `typeof`. This commit restores backwards-compatiblity that has been broken in #6685
A follow-up for #6685. Replays #6408 on top of #6685. Co-authored-by: Steffen Neubauer <[email protected]>
A follow-up for #6685. Replays #6408 on top of #6685. Co-authored-by: Steffen Neubauer <[email protected]>
…anifest files Template strings in Kubernetes manifest files are partially resolved for legacy reasons. The partial resolve behaviour has been changed to improve sanity in #6685 but for kubernetes manifest files, we need to have a version of the old behaviour. The expected legacy behaviour looks like this: - If template strings reference variables that do not exist there is no error - If a template string contains multiple template expressions, each expression can be partially resolved. - Template expressions are evaluated before parsing yaml, which means that valid yaml with template expressions can be resolved to invalid yaml (e.g. if variable values contain special characters) This legacy behaviour can lead to quite some surprises and UX problems, for example #5266 I would suggest that we remove this functionality in 0.14.
…anifest files (#6713) * fix(template): establish backwards bug-compatibility for kubernetes manifest files Template strings in Kubernetes manifest files are partially resolved for legacy reasons. The partial resolve behaviour has been changed to improve sanity in #6685 but for kubernetes manifest files, we need to have a version of the old behaviour. The expected legacy behaviour looks like this: - If template strings reference variables that do not exist there is no error - If a template string contains multiple template expressions, each expression can be partially resolved. - Template expressions are evaluated before parsing yaml, which means that valid yaml with template expressions can be resolved to invalid yaml (e.g. if variable values contain special characters) This legacy behaviour can lead to quite some surprises and UX problems, for example #5266 I would suggest that we remove this functionality in 0.14. * test: fix running tests on macos this commit fixes the "cannot find dockerfile" error that plagued us on macos * test: add integ tests for legacyAllowPartial behaviour in kubernetes manifests
What this PR does / why we need it:
We optimise the template string resolving performance by
making sure that we only parse each template expression once. Once
parsed, we use the AST to evaluate template expressions.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Changes are inspired from #5496