Add tag filtering to the runs endpoint#3
Open
Aryan95614 wants to merge 2 commits into
Open
Conversation
Add an optional 'tag' query param to GET /flows/{flow_id}/runs, filtering by the
run's tags and system_tags combined. Repeating the param is an OR. Implemented with
the jsonb ?| operator against (tags || system_tags), which uses the existing GIN
index runs_v3_idx_gin_tags_combined, mirroring the ui_backend's tag-filter approach.
Drops in as one more ANDed predicate in the get_all_runs condition-builder, so it
composes with the existing status, user, and time-range filters. No joins needed;
tags and system_tags are base columns. Values are bound as placeholders.
Add integration tests for tag match (user and system tags), OR over tags, no-match,
and composition with status.
Add exclude_status / exclude_user / exclude_tag query params (each repeatable) to
GET /flows/{flow_id}/runs, the NOT counterparts of the existing filters. Each negates
the same predicate in the get_all_runs condition-builder: status NOT IN (...),
NOT ((tags || system_tags) ?| ...), and a NULL-safe user exclusion
(user IS NULL OR user NOT IN (...)) so runs with no verified owner survive. The
exclude_status values are validated against the same allowlist; exclusion composes
with the inclusion filters.
Add an integration test covering status/user/tag exclusion, the no-owner keep, the
400 on an unknown exclude_status, and inclusion-plus-exclusion composition.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on PR #2 (base is
w3-time-range). Adds the fourth composable filter to the runs endpoint. Retarget to Netflix master once Netflix#481 and #2 land.What
Adds an optional
tagquery param toGET /flows/{flow_id}/runs, filtering by the run'stagsandsystem_tagscombined. Repeating the param is an OR (?tag=a&tag=b).How
?|operator against(tags || system_tags), which hits the existing GIN indexruns_v3_idx_gin_tags_combined, mirroring the ui_backend's tag-filter approach.get_all_runscondition-builder, so it composes with the existing status, user, and time-range filters. No joins needed;tags/system_tagsare base columns. Values are bound as placeholders.Tests
Integration tests for tag match (user and system tags), OR over tags, no-match, and composition with status. Full integration suite green; the one failure is the pre-existing
tasks_testflake.