Skip to content

Move gateway experiment filtering to server-side query to fix inconsistent page sizes#21138

Merged
TomeHirata merged 7 commits intomasterfrom
copilot/include-tag-filter-in-search-query
Feb 26, 2026
Merged

Move gateway experiment filtering to server-side query to fix inconsistent page sizes#21138
TomeHirata merged 7 commits intomasterfrom
copilot/include-tag-filter-in-search-query

Conversation

Copy link
Contributor

Copilot AI commented Feb 25, 2026

Client-side filtering of gateway experiments after pagination causes inconsistent page sizes — e.g., with page size 10 and every 3rd experiment tagged as GATEWAY, users see 7, 7, 1 instead of 10, 5, 1.

What changes are proposed in this pull request?

  • useExperimentListQuery.ts: Move gateway experiment exclusion into the server-side filter parameter in getFilters(), so the server excludes gateway experiments before paginating. Uses tags.\mlflow.experiment.isGateway` IS NULL(leveraging the new tag added in #21149) to correctly include all non-gateway experiments — avoiding the previous!= 'GATEWAY'approach which incorrectly excluded experiments that lacked thesourceTypetag entirely. Removes the now-redundant client-sideisGatewayExperimentfilter and its import. Uses theEXPERIMENT_IS_GATEWAY_TAGconstant fromexperimentPage.common-utils.ts` instead of a hardcoded string.
  • experimentPage.common-utils.ts: Export new EXPERIMENT_IS_GATEWAY_TAG constant (mlflow.experiment.isGateway) so it can be shared across modules. EXPERIMENT_SOURCE_TYPE_TAG and ExperimentSourceType remain unexported (internal to the file). Remove the isGatewayExperiment function as it is no longer referenced anywhere.
  • useExperimentListQuery.test.tsx: Update gateway filtering test to assert the IS NULL exclusion filter is present in the API call (not client-side behavior). Fix an overly broad filterParam?.includes('tags') check in the tags pagination test — since every query now includes a tag condition, tighten it to match the user-provided tag key ('env').

How is this PR tested?

  • Existing unit/integration tests
  • New unit/integration tests

Does this PR require documentation update?

  • No. You can skip the rest of this section.

Does this PR require updating the MLflow Skills repository?

  • No. You can skip the rest of this section.

Release Notes

Is this a user-facing change?

  • Yes. Give a description of this change to be included in the release notes for MLflow users.

Fix inconsistent experiment list page sizes caused by client-side filtering of gateway experiments after server-side pagination.

What component(s), interfaces, languages, and integrations does this PR affect?

Components

  • area/uiux: Front-end, user experience, plotting, JavaScript, JavaScript dev server

How should the PR be classified in the release notes? Choose one:

  • rn/bug-fix - A user-facing bug fix worth mentioning in the release notes

Should this PR be included in the next patch release?

  • Yes (this PR will be cherry-picked and included in the next patch release)
  • No (this PR will be included in the next minor release)

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…stent page sizes

Co-authored-by: TomeHirata <33407409+TomeHirata@users.noreply.github.com>
Copilot AI changed the title [WIP] Add tag filter to search query implementation Move gateway experiment filtering to server-side query to fix inconsistent page sizes Feb 25, 2026
import type { SortingState } from '@tanstack/react-table';
import type { TagFilter } from './useTagsFilter';
import { isDemoExperiment } from '../../../utils/isDemoExperiment';
import { isGatewayExperiment } from '../utils/experimentPage.common-utils';
Copy link
Collaborator

Choose a reason for hiding this comment

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

@copilot can we remove isGatewayExperiment function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 040a5a8 — removed isGatewayExperiment and the GATEWAY value from the ExperimentSourceType enum since neither is referenced anywhere anymore.

@TomeHirata TomeHirata marked this pull request as ready for review February 25, 2026 15:52
Copilot AI review requested due to automatic review settings February 25, 2026 15:52
@github-actions github-actions bot added size/M area/uiux Front-end, user experience, plotting, JavaScript, JavaScript dev server rn/bug-fix Mention under Bug Fixes in Changelogs. labels Feb 25, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes inconsistent experiment list page sizes caused by client-side filtering of gateway experiments after server-side pagination. By moving the gateway experiment exclusion filter to the server-side query, pagination now works correctly.

Changes:

  • Moved gateway experiment filtering (mlflow.experiment.sourceType != 'GATEWAY') from client-side to server-side query filter
  • Removed redundant client-side filtering logic and isGatewayExperiment import
  • Updated test to verify the filter is included in API calls rather than testing client-side filtering behavior

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
mlflow/server/js/src/experiment-tracking/components/experiment-page/hooks/useExperimentListQuery.ts Adds gateway exclusion filter to server-side query and removes client-side filtering logic
mlflow/server/js/src/experiment-tracking/components/experiment-page/hooks/useExperimentListQuery.test.tsx Updates gateway filtering test to verify API call includes the filter, and fixes overly broad tag filter check in pagination test

Co-authored-by: TomeHirata <33407409+TomeHirata@users.noreply.github.com>
Co-authored-by: TomeHirata <33407409+TomeHirata@users.noreply.github.com>
Co-authored-by: TomeHirata <33407409+TomeHirata@users.noreply.github.com>
@TomeHirata TomeHirata removed the request for review from harupy February 25, 2026 23:50
@TomeHirata
Copy link
Collaborator

TomeHirata commented Feb 26, 2026

hm, it seems "tag Is Not" search for experiments is not working in this way cuz it excludes any experiment that doesn't have the mlflow.experiment.sourceType tag at all.

return undefined;
}
// Exclude gateway experiments server-side to ensure consistent page sizes
filters.push(`tags.\`${EXPERIMENT_SOURCE_TYPE_TAG}\` != '${ExperimentSourceType.GATEWAY}'`);
Copy link
Collaborator

Choose a reason for hiding this comment

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

@copilot we added a new tag in #21149, can we use tags.mlflow.experiment.isGateway IS NULL instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in b30b620 — switched to tags.\mlflow.experiment.isGateway` IS NULLusing a newEXPERIMENT_IS_GATEWAY_TAGconstant exported fromexperimentPage.common-utils.ts`. This correctly includes all experiments that don't have the tag set, rather than accidentally excluding tag-less experiments.

…ents

Co-authored-by: TomeHirata <33407409+TomeHirata@users.noreply.github.com>

const EXPERIMENT_TYPE_TAG = 'mlflow.experimentType';
const EXPERIMENT_SOURCE_TYPE_TAG = 'mlflow.experiment.sourceType';
export const EXPERIMENT_SOURCE_TYPE_TAG = 'mlflow.experiment.sourceType';
Copy link
Collaborator

Choose a reason for hiding this comment

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

@copilot revert export change for EXPERIMENT_SOURCE_TYPE_TAG and ExperimentSourceType

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 3c5df6a — reverted EXPERIMENT_SOURCE_TYPE_TAG back to const (unexported) and ExperimentSourceType back to an unexported enum with only the REPO_NOTEBOOK value.

Co-authored-by: TomeHirata <33407409+TomeHirata@users.noreply.github.com>
Copy link
Collaborator

@serena-ruan serena-ruan left a comment

Choose a reason for hiding this comment

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

LGTM!

@TomeHirata TomeHirata enabled auto-merge February 26, 2026 10:15
@TomeHirata TomeHirata added this pull request to the merge queue Feb 26, 2026
Merged via the queue into master with commit b1d348b Feb 26, 2026
25 checks passed
@TomeHirata TomeHirata deleted the copilot/include-tag-filter-in-search-query branch February 26, 2026 10:31
daniellok-db pushed a commit to daniellok-db/mlflow that referenced this pull request Mar 5, 2026
…stent page sizes (mlflow#21138)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: TomeHirata <33407409+TomeHirata@users.noreply.github.com>
daniellok-db pushed a commit to daniellok-db/mlflow that referenced this pull request Mar 5, 2026
…stent page sizes (mlflow#21138)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: TomeHirata <33407409+TomeHirata@users.noreply.github.com>
daniellok-db pushed a commit that referenced this pull request Mar 5, 2026
…stent page sizes (#21138)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: TomeHirata <33407409+TomeHirata@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/uiux Front-end, user experience, plotting, JavaScript, JavaScript dev server rn/bug-fix Mention under Bug Fixes in Changelogs. size/M v3.10.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants