Skip to content

feat: add ability to filter jobs by tags#548

Open
golanglemonade wants to merge 2 commits intoriverqueue:masterfrom
golanglemonade:feat-support-tag-filter
Open

feat: add ability to filter jobs by tags#548
golanglemonade wants to merge 2 commits intoriverqueue:masterfrom
golanglemonade:feat-support-tag-filter

Conversation

@golanglemonade
Copy link
Copy Markdown

We have a lot of jobs with the same kind, but different tags. This will make it much easier to filter the data and find jobs.

Signed-off-by: Sarah Funkhouser <147884153+golanglemonade@users.noreply.github.com>
@brandur
Copy link
Copy Markdown
Collaborator

brandur commented Apr 20, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

An unknown error occurred
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Copy link
Copy Markdown
Collaborator

@brandur brandur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread handler_api_endpoint.go Outdated

default:
return nil, apierror.NewBadRequestf("Invalid facet %q. Valid facets are: job_kind, queue_name", req.Facet)
default:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think this whitespace is wrong and should go back to how it was before.

Signed-off-by: Sarah Funkhouser <147884153+golanglemonade@users.noreply.github.com>
@golanglemonade
Copy link
Copy Markdown
Author

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.

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?

rows, err := pgxTx.Query(ctx,
    `SELECT DISTINCT tag
    FROM river_job, unnest(tags) AS tag
    WHERE ($1 = '' OR tag ILIKE '%' || $1 || '%')
		    AND ($2 = '' OR tag > $2)
		    AND ($3::text[] IS NULL OR tag != ALL($3))
    ORDER BY tag ASC
    LIMIT 100`,
    match, after, excludeArg,
    )

@brandur
Copy link
Copy Markdown
Collaborator

brandur commented Apr 21, 2026

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants