feat: add ability to filter jobs by tags - #548
Conversation
|
@codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
brandur
left a comment
There was a problem hiding this comment.
Thanks @golanglemonade! Thoughts on autocomplete for tag names? A bit harder maybe than queue names or job kinds, but seems like it'd be make the feature a lot more useful.
|
|
||
| default: | ||
| return nil, apierror.NewBadRequestf("Invalid facet %q. Valid facets are: job_kind, queue_name", req.Facet) | ||
| default: |
There was a problem hiding this comment.
Think this whitespace is wrong and should go back to how it was before.
Yep, I actually had a working automcomplete, but required direct sql because the riverdrver doesn't support the query, but I figured the preferred path would be to query the riverdriver with the update and then come back and add auto complete here? |
|
Ah nice. Yeah, there won't be a drive function for that. @bgentry We better get your input before @golanglemonade goes too much further with this one. Is there a reason this feature didn't exist in the beginning, or just was never implemented? |
|
@bgentry any update on this? |
|
Would love to see this get reviewed + merged - filtering by tag would be very useful |
Signed-off-by: Sarah Funkhouser <147884153+golanglemonade@users.noreply.github.com>
Signed-off-by: Sarah Funkhouser <147884153+golanglemonade@users.noreply.github.com>
Tag filtering arrives without changelog coverage or regression tests, and mutations leave active tag-filtered lists stale. The autocomplete error also advertises a `job_tag` facet that no backend implements. Propagate tag filters through every active job-list cache key, remove the unsupported facet claim, and document the user-facing filter. Add coverage for repeated query parameters, route normalization, case-insensitive OR matching, custom schemas, and the handler request path.
5d81e53 to
d1585e3
Compare
|
@golanglemonade I made a round of updates in here including extracting the query logic to riverqueue/river#1339 so we can keep it functional across all drivers. That's a prereq here, but otherwise @brandur can feel free to take a look at it! 🙏 |
The job-list endpoint currently implements tag matching with PostgreSQL-only SQL through `JobListParams.Where`, preventing the handler from working with other River drivers. Pin River to the commit from riverqueue/river#1339 and call the new `JobListParams.Tags` method. River now owns the case-insensitive, match-any query semantics for PostgreSQL and SQLite, while RiverUI remains independent of driver-specific SQL.
The tag filter tests exercise backend matching directly, but they leave the raw request boundary, route translation, and mutation cache behavior unprotected. Regressions in those paths can silently ignore public API filters or leave filtered job lists stale. Assert repeated query parameter extraction and parser type dispatch. Add a focused route component harness that verifies tags flow from route search state into the job query and filter control, back into navigation updates, and through the cache keys refreshed after cancel, delete, and retry.
d1585e3 to
c1f4139
Compare
RiverUI still calls the ambiguous tag filter and describes its matching as case-insensitive after River splits the API into explicit any and all forms. Pin the River modules to the revised PR commit and use TagsAny for the existing multi-selection behavior. Describe the exact-match contract in the changelog and include a mixed-case decoy in handler coverage so accidental case folding is visible.
RiverUI currently points at the tag-filter PR's branch commit even though the River change is now merged. Move every River module to the resulting master merge commit. The dependency now tracks the authoritative repository history while retaining the same tag filter API and behavior.
|
@brandur want to take another look at this one? It's currently pinned to the latest river |
|
@brandur ok merging for now, reminder this will need to have the river deps re-pinned to a release version prior to shipping a new riverui release 🙏 |
|
Ah shoot, @golanglemonade would you mind signing the CLA so we can merge this? https://github.com/riverqueue/rivercla |
done! riverqueue/rivercla#30 |
|
Great. Thanks for the patch! |
Adds exact tag filtering to the jobs list. Multiple selected tags use
match-any semantics, stay represented in the URL, and are included in
list-query cache keys so cancel, delete, and retry mutations refresh the active
result set correctly.
The backend uses the cross-driver
river.JobListParams.TagsAnyAPI merged inriverqueue/river#1339, rather
than PostgreSQL-specific SQL. The River modules are pinned to the resulting
mastermerge commit.