-
Notifications
You must be signed in to change notification settings - Fork 14
feat: Annotation search for Pipeline Runs #70
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
base: master
Are you sure you want to change the base?
feat: Annotation search for Pipeline Runs #70
Conversation
|
| | false | false | EXISTS(key='X' AND value='Y') | Has X=Y | | ||
| | false | true | EXISTS(key='X' AND value!='Y') | Has X with value not Y | | ||
| | true | false | NOT EXISTS(key='X' AND value='Y') | Doesn't have X=Y | | ||
| | true | true | NOT EXISTS(key='X' AND value='Y') | Same (value.negate ignored) | |
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.
Same (value.negate ignored)
I consider this to be a code smell.
I do not mean that you have to change the behavior here. Rather I think that this might indicates a problem with the approach.
| class ListPipelineJobsResponse: | ||
| pipeline_runs: list[PipelineRunResponse] | ||
| next_page_token: str | None = None | ||
| debug_where_clause: str | None = ( |
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.
Maybe just log it.
|
TODO
Description
Closes #45
Implemented a new API to search annotations for runs.
Background
Annotations are
key-valuepairs. The following examples of annotations (e.g.key = value):env=productionteam=backendThis PR allows searches for key/value strings.
Features
/api/pipeline_runs/) to search key/value in annotations.(key=key1 and value=value1) or (key=key2 and value=value2)(key=key1 and value=value1) and (key=key2 and value=value2)Use Cases and Examples
1. Key equals a string
Find runs where annotation key equals "environment":
{"annotation_filters": [{"key": {"operator": "equals", "text": "environment"}}]}2. Key equals string AND value in set
Find runs where key equals "environment" AND value is "prod" or "staging":
{ "annotation_filters": [ { "key": {"operator": "equals", "text": "environment"}, "value": {"operator": "in_set", "texts": ["prod", "staging"]} } ] }3. Complex: (key equals AND value contains) AND key NOT contains
Find runs where (key equals "environment" AND any value contains "prod") AND key NOT contains "team":
{ "operator": "and", "annotation_filters": [ { "key": {"operator": "equals", "text": "environment"}, "value": {"operator": "contains", "text": "prod"} }, {"key": {"operator": "contains", "text": "team", "negate": true}} ] }Test Plan
uv run pytest tests/test_pipeline_run_search.py -v/api/pipeline_runs/<ID>/annotations/<KEY>/)/api/pipeline_runs/<ID>/annotations/)/api/pipeline_runs/search/)Video of E2E Testing
Screen.Recording.2026-01-28.at.1.18.33.PM.mov