Skip to content
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

feat: upgrade expr to v1.14 for richer language definition #11605

Merged
merged 1 commit into from
Aug 18, 2023

Conversation

jessesuen
Copy link
Member

@jessesuen jessesuen commented Aug 18, 2023

Motivation

Updates antonmedv/expr from v1.13 to v1.14 which has a much richer language definition and includes useful helpers such as hasPrefix, max

I think this will really help with simplifying workflows. I also think it will make the WorkflowEventBinding much more useful and reduce the need for argo-events webhook eventsource.

The other problem that this will solve is that our docs constantly refer to the expr project to see how to write expressions. But if we continue to use the old version, users will hit unexpected errors. e.g.:

Non-transient error: failed to evaluate workflow template expression: unable to evaluate expression 'hasPrefix(payload.Key, \"foo\") == true': reflect: call of reflect.Value.Call on zero Value (1:1)\n | hasPrefix(payload.Key, \"foo\") == true\n | ^

In fact, this is how I discovered the new version in the first place (I was confused on why certain functions were unavailable).

Signed-off-by: Jesse Suen <jesse@akuity.io>
@jessesuen
Copy link
Member Author

v1.14:
image

vs v1.13:
image

@jessesuen jessesuen changed the title feat: update antonmedv/expr from v1.13 to v1.14 feat: upgrade expr v1.14 for richer language definition Aug 18, 2023
@jessesuen jessesuen changed the title feat: upgrade expr v1.14 for richer language definition feat: upgrade expr to v1.14 for richer language definition Aug 18, 2023
@terrytangyuan terrytangyuan enabled auto-merge (squash) August 18, 2023 01:30
@terrytangyuan terrytangyuan merged commit cd2e4e5 into argoproj:master Aug 18, 2023
27 checks passed
@jessesuen jessesuen deleted the expr-1.14 branch August 18, 2023 05:28
@agilgur5 agilgur5 added type/dependencies PRs and issues specific to updating dependencies go Pull requests that update Go dependencies area/templating Templating with `{{...}}` labels Aug 20, 2023
@agilgur5
Copy link
Member

agilgur5 commented Aug 20, 2023

Shortly after this PR it looks like the creator/maintainer of expr filed #11608 about these new functions!
(v1.14 was released just 4 days ago; 2 days before this PR)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/templating Templating with `{{...}}` go Pull requests that update Go dependencies type/dependencies PRs and issues specific to updating dependencies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants