-
Notifications
You must be signed in to change notification settings - Fork 746
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: Introduce expr filters #1226
Conversation
target "all" was replaced by "build" in #1203 Signed-off-by: Stephan van Maris <[email protected]>
Signed-off-by: Vaibhav Page <[email protected]>
19a2063
to
3d821fd
Compare
Signed-off-by: Vaibhav Page <[email protected]>
…proj/argo-events into feat/introduce-expr-filters
Welcome back! |
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.
Do you think this can replace the dataFilter
, especially if it does not need fields
?
filters: | ||
# If event payload passes either one of the following filters, the event is considered a valid event. | ||
exprs: | ||
- expr: a == "b" || c == 10 |
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.
Is it possible to do following without specifying the fields?
exprs:
- expr: a == "b" || c== 10
- expr: d.e == false
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.
you'd need the fields because they represent the variables in the expression. e.g. govaluate
won't understand field d.e
sensors/dependencies/filter.go
Outdated
} | ||
switch field.Type { | ||
case v1alpha1.JSONTypeString: | ||
parameters[field.Name] = result.Str |
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.
Can you try parameters[field.Name] = result.Value()
? I feel like that will work, and then fields
is not required.
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.
yeah that would work
You also need to clean up some outdated, codegen related binaries in {gopath}/bin/** to fix the codegen check error. |
Yep, I think we should deprecate dataFilters in a future release |
Signed-off-by: Vaibhav Page <[email protected]>
What's this step does "Ensure nothing has changed" in the pipeline? |
That uses a fresh env to run |
Hey guys, thanks for adding this, we are eagerly awaiting to give this a whirl, anything I can do to help it get merged in? |
Thanks @whynowy ! |
* chore: Fix make command (argoproj#1221) target "all" was replaced by "build" in argoproj#1203 Signed-off-by: Stephan van Maris <[email protected]> * feat: added expr filter logic and tests Signed-off-by: Vaibhav Page <[email protected]> * chore: codegen Signed-off-by: Vaibhav Page <[email protected]> * chore: codegen Signed-off-by: Vaibhav Page <[email protected]> Co-authored-by: Stephan van Maris <[email protected]> Co-authored-by: Derek Wang <[email protected]>
Checklist: