-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
proposal: change expression syntax to not overlap with Helm #13471
Comments
Copying @agilgur5 's comment here
|
expr
library. Supersedes #9529
Legacy and backward-compat is the main reason at this point. Each templating engine was superior to the prior historically (
I would strictly define "next release" as 3.7+ here, IMO. With the OTel change (#13265), I think we have enough breakage in 3.6, which is also overdue due to 3.5 instabilities.
This syntax seems overly simplistic -- complex expressions need to be bounded on both edges somehow. Unless you're proposing that all strings become expressions? I feel like that too could be problematic I'm also not sure what the purpose of another duplicate of #9529 is, especially if you're verbatim copying text from it and referencing it? I did take a decent amount of time in finding and closing all duplicates and linking related issues, which making more of kind of defeats the purpose of |
Yeah I was proposing this, I don't see a huge issue here If I am being honest, simplicity is why I proposed this. Users can directly rely on expr-lang's syntax & semantics without having to care about anything else. One negative is perhaps that strings need to now be quoted.
Yeah that is fair enough.
The purpose was effectively a direct suggestion about what to do about #9529, but perhaps I should have opened a PR with design documentation referencing #9529. I can close this and open that PR if you'd like? |
Completely off the top of my head, escaping sounds like a substantial issue here. An example off the top of my head,
If there's an existing issue already, I'd rather just re-use it, as I did with sharding, for instance. And I gave concrete steps for most of it in #9529 (comment) already. I wouldn't even consider the part I covered a proposal per se, but an action item of things we already need to do. Otherwise, I did like Alan's recent use of "proposal:" issues, and did the same with #12694 (also including the existing term "RFC"). I was thinking of formalizing that as an issue template.
In this case, I would probably suggest leaving #9529 as-is and making this proposal specific to future syntax replacements for less overlap with tools like Helm etc, which my action items did not cover and would probably require more feedback as well (vs the specific items I laid out I think there is past and existing consensus or precedent on; the "deprecation" did not have consensus, and also had an older proposal in #7831 before |
I agree with an issue template for this. docs/proposals sort of appears how we do proposals at first glance, but I think doing them as issues is how we prefer to work and is overall a better process. |
Yes, I was looking for some "global" variable name which should be more unique. I was considering
I'm going to create a parser for govaluate for ease of migration to expr. Probably this parser can be used to simplify migration to expr. |
No, not currently, but Isitha was suggesting here to change Argo's
If we create a shared "YAML with expr" library that would force coordination too 😉
Interesting. If it's just for Argo's case, I don't think it'd be worthwhile since only 1 field uses |
I like this idea. 🔥 will try to research into this.
I think somebody still uses it. |
I discussed this with Isitha in the Aug 20th Contributor Meeting and pointed to my above comment on how the Isitha also agreed that we can limit this issue as a proposal for syntax replacements, while keeping #9529 as-is (that does mention overlap with Helm, but no proposal/solution to it, whereas it does directly state to replace other templating libraries with As such, I'll rename this issue to be specific to syntax replacements. Given the problems with |
expr
library. Supersedes #9529
Another problem with argo-workflows/examples/scripts-bash.yaml Lines 37 to 40 in ad114b0
Ideally, the new delimiter wouldn't conflict with languages commonly used in workflows. I did a little research into what other projects are doing:
Also, it'd be great if the new syntax would be stricter and wouldn't silently failing on errors, which has been the biggest source of confusion for me, and is mentioned in the comments: argo-workflows/util/template/expression_template.go Lines 55 to 60 in ad114b0
We aren't going to have a chance to make that sort of change in the future because it would be too big of a BC break. |
Well we should probably disable templating inside of scripts in any case and force use of env vars to prevent injection attacks per #5114
Yea I think most people agree that it is very confusing, I said as much in #13680 (comment) too We did partly workaround that with the approach I outlined in #13680 (comment), although it is not entirely possible to fix due to layering/nesting. But we could statically validate and error out on a good number of templates that have less dynamism
Thanks for listing this out. |
Summary
We currently support multiple templating/expression engines without any strong reason.
This issue attempts to formalize what the new expression syntax should look like.
Suggestion
We support expr-lang as is, we feed an environment mapping containing all variables needed when compiling/running said expression.
The values in this map can be accessed by using the
$
prefix.This will obviously be a breaking change, but hopefully will simplify a giant part of the expression/templating logic that exists in argo workflows and hopefully reduce user confusion in the process.
We can deprecate existing solutions in the next release, then remove these dependencies entirely in the
next release + 1
.Before
After
The text was updated successfully, but these errors were encountered: