Skip to content

Enable pipeline run filters bar with JSON filter query support#1923

Open
Mbeaulne wants to merge 1 commit intomasterfrom
03-10-wires_up_run_filter_to_api
Open

Enable pipeline run filters bar with JSON filter query support#1923
Mbeaulne wants to merge 1 commit intomasterfrom
03-10-wires_up_run_filter_to_api

Conversation

@Mbeaulne
Copy link
Collaborator

@Mbeaulne Mbeaulne commented Mar 10, 2026

Description

This pull request implements a new JSON-based filter query system for pipeline runs and simplifies the filtering interface. The changes include:

  • Replaced the legacy string-based filter format with a new JSON filter_query parameter that supports complex predicates including time ranges, value matching, and annotation filtering
  • Simplified the PipelineRunFiltersBar component by removing the collapsible advanced section and making annotation filtering inline with dedicated input fields
  • Updated the RunSection to use the new filtersToFilterQuery function and filter_query parameter instead of the legacy format
  • Removed status and sort controls from the filters bar, focusing on core filtering functionality
  • Added the BetaFeatureWrapper component to the knip.json ignore list
  • Removed the pipeline-run-filters-bar feature flag and made the new filters bar the default experience

Type of Change

  • New feature
  • Improvement
  • Breaking change

Checklist

  • I have tested this does not break current pipelines / runs functionality
  • I have tested the changes on staging

Test Instructions

  1. Test pipeline run filtering with the new inline annotation filter interface
  2. Verify that the new JSON-based filter_query parameter correctly filters runs by created_by, pipeline_name, date ranges, and annotations
  3. Test the simplified filters bar with inline annotation input (key/value pairs)
  4. Ensure the filter badges display correctly and can be removed individually
  5. Verify the "Clear all" functionality works with the new filter system

Additional Comments

The new filter query system uses a structured JSON format with predicates like value_equals, value_contains, key_exists, and time_range, providing more flexibility than the previous string-based approach. The UI has been streamlined to focus on the most commonly used filters while maintaining full functionality through an improved inline interface.

@github-actions
Copy link

github-actions bot commented Mar 10, 2026

🎩 To tophat this PR:

You can add the following URL parameter to your browser to tophat this PR:

`?tophat_location=03-10-wires_up_run_filter_to_api/f7cd384`

Copy link
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@Mbeaulne Mbeaulne changed the title wires up run filter to API Update API client to use localhost and new filter query format Mar 10, 2026
@Mbeaulne Mbeaulne force-pushed the 03-10-wires_up_run_filter_to_api branch 3 times, most recently from b8cb3c6 to a38b45d Compare March 10, 2026 20:51
"openapi-ts.config.ts",
"src/config/announcements.ts"
"src/config/announcements.ts",
"src/components/shared/BetaFeatureWrapper/BetaFeatureWrapper.tsx"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I want to keep this around for other betaflags in the future. Thoughts? (it was the wrapper we had around the fake filters)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Most of this was just moving annotation filter from "advanced" to the top level filter and removing the status and order feature as its not supported

@Mbeaulne Mbeaulne marked this pull request as ready for review March 10, 2026 20:56
@Mbeaulne Mbeaulne requested a review from a team as a code owner March 10, 2026 20:56
@Mbeaulne Mbeaulne changed the title Update API client to use localhost and new filter query format Enable pipeline run filters bar with JSON filter query support Mar 10, 2026
@Mbeaulne Mbeaulne force-pushed the 03-10-wires_up_run_filter_to_api branch from a38b45d to f7cd384 Compare March 10, 2026 21:14
Comment on lines +142 to +152
if (filters.annotations) {
for (const annotation of filters.annotations) {
if (annotation.value) {
predicates.push({
value_contains: {
key: annotation.key,
value_substring: annotation.value,
},
});
} else {
predicates.push({ key_exists: { key: annotation.key } });
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I choose value_contains because tags are a comma seperated list, and anything with more then one tag could never really be found. this way we can do partial matches

const value = filters[key];
if (value) {
parts.push(`${key}:${value}`);
if (filters.created_after || filters.created_before) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

https://oasis.shopify.io/?filter=%7B%22created_after%22%3A%222026-02-11T08%3A00%3A00.000Z%22%2C%22created_before%22%3A%222026-02-18T08%3A00%3A00.000Z%22%7D

image.png

Note that when selecting until Feb 18, 2026 in the UI, it only shows Feb 17, looking at the URL 2026-02-18T08%3A00%3A00.000Z, this is until the start of Feb 18, not until the end of Feb 18.

Should selecting Feb 18 in the date range include the full day?

const parts: string[] = [];
const predicates: FilterQueryPredicate[] = [];

if (filters.created_by) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

there is a use case where create_by could be an empty string (noticed early runs in the prod DB didn't have createdy_by), so can we allow search of empty string here?

Not asking you to change it now, I'm still doing investigations which I might need this so checking with you if it's feasible.


if (filters.annotations) {
for (const annotation of filters.annotations) {
if (annotation.value) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wonder if we should allow empty string search here too, however the caveat would be if we're doing empty string search, it'll need to be "value_equals" not "value_contains".

Asking for feasibility, not a change request.

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