Repository navigation
Conversation
…ngly Signed-off-by: Matteo Baiguini <mbaiguini@swissblock.net>
…ngly - Added some missing testing use cases Signed-off-by: Matteo Baiguini <mbaiguini@swissblock.net>
Signed-off-by: Matteo Baiguini <mbaiguini@swissblock.net>
cf55cd2 to
965acff
Compare
Signed-off-by: Matteo Baiguini <mbaiguini@swissblock.net>
07ffef1 to
9ebf485
Compare
Signed-off-by: Matteo Baiguini <mbaiguini@swissblock.net>
|
Before I started reviewing the PR, I read through the related issue one more time, I think I have pointed the wrong direction at the beginning, and I apologize. Basically the list of filters are in |
|
And I think for your case, you can try with Multiple Paths to solve the issue. |
|
@whynowy I think I was pretty clear and detailed in my description, right to avoid any waste of time... maybe I was wrong... now that I have a better understanding of how it's intended to work, I would like to point out couple of things:
The Filter doc is really incomplete because:
"Data filter Multiple paths" is not comparable to "Expr filter", for example:
@whynowy if you have time, can we have a call so I can better describe everything to you? @alexec maybe we can discuss about this in the call we scheduled, what do you think? |
|
@whynowy here I try to shortly describe my use case. I configured a GitLab webhook and Argo Events on a GKE cluster. I want to filter GitLab events based on our simple requirements:
For those requirements I'm forced to declare 4 sensors:
Here the partial yaml manifests. sensor for "main/master branch" and "tags" # ...
dependencies:
- name: gitlab-dependency
eventSourceName: gitlab
eventName: gitlab-event
filters:
data:
- path: body.event_name
type: string
value:
- "push"
- "tag_push"
# ...sensor for "new PR/MR opened" # ...
dependencies:
- name: gitlab-dependency
eventSourceName: gitlab
eventName: gitlab-event
filters:
exprs:
- expr: event_type == "merge_request" && work_in_progress == false && state == "opened" && action == "open"
fields:
- name: event_type
path: body.event_type
- name: work_in_progress
path: body.object_attributes.work_in_progress
- name: state
path: body.object_attributes.state
- name: action
path: body.object_attributes.action
# ...sensor for "update on source branch of the PR/MR" # ...
dependencies:
- name: gitlab-dependency
eventSourceName: gitlab
eventName: gitlab-event
filters:
exprs:
- expr: event_type == "merge_request" && work_in_progress == false && state == "opened" && action == "update" && oldrev != ""
fields:
- name: event_type
path: body.event_type
- name: work_in_progress
path: body.object_attributes.work_in_progress
- name: state
path: body.object_attributes.state
- name: action
path: body.object_attributes.action
- name: oldrev
path: body.object_attributes.oldrev
# ...sensor for " draft/wip PR/MR mark as ready" # ...
dependencies:
- name: gitlab-dependency
eventSourceName: gitlab
eventName: gitlab-event
filters:
exprs:
- expr: event_type == "merge_request" && work_in_progress == false && state == "opened" && action == "update" && title_previous =~ "Draft:"
fields:
- name: event_type
path: body.event_type
- name: work_in_progress
path: body.object_attributes.work_in_progress
- name: state
path: body.object_attributes.state
- name: action
path: body.object_attributes.action
- name: title_previous
path: body.changes.title.previous
# ...What I would like to have is the possibility to choose between |
|
@whynowy with pleasure, tomorrow (Monday 6.12.) I will ping you |
|
Closing it as per the discussion. |
@whynowy here we go with the PR for the issue #1442
Checklist: