Skip to content

Filter gateway experiments from the experiment list page#21130

Merged
TomeHirata merged 2 commits intomasterfrom
copilot/filter-experiments-for-gateway
Feb 25, 2026
Merged

Filter gateway experiments from the experiment list page#21130
TomeHirata merged 2 commits intomasterfrom
copilot/filter-experiments-for-gateway

Conversation

Copy link
Contributor

Copilot AI commented Feb 25, 2026

Gateway experiments (auto-created with mlflow.experiment.sourceType=GATEWAY when a gateway endpoint has usage tracking enabled) were appearing alongside user experiments on the experiment list page, adding noise.

Changes

  • experimentPage.common-utils.ts: Added GATEWAY to ExperimentSourceType enum; exported new isGatewayExperiment() helper that detects experiments tagged with mlflow.experiment.sourceType=GATEWAY
  • useExperimentListQuery.ts: Filters out gateway experiments from the returned list before rendering (client-side, consistent with the existing demo-experiment reordering pattern)
  • useExperimentListQuery.test.tsx: Added test verifying gateway experiments are excluded from returned data

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.

Gateway experiments are now hidden from the experiment list page to reduce noise.

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/feature - A new user-facing feature 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)

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Gateway experiments (tagged with mlflow.experiment.sourceType=GATEWAY) are
now excluded from the experiment list page. This is implemented by:
1. Adding GATEWAY to ExperimentSourceType enum in experimentPage.common-utils.ts
2. Exporting isGatewayExperiment() helper function
3. Filtering gateway experiments out in useExperimentListQuery.ts
4. Adding a test to verify the filtering behavior

Co-authored-by: TomeHirata <33407409+TomeHirata@users.noreply.github.com>
Copilot AI changed the title [WIP] Add filter for gateway experiments on list page Filter gateway experiments from the experiment list page Feb 25, 2026
Copilot AI requested a review from TomeHirata February 25, 2026 09:54
@TomeHirata TomeHirata marked this pull request as ready for review February 25, 2026 10:25
Copilot AI review requested due to automatic review settings February 25, 2026 10:25
@TomeHirata TomeHirata enabled auto-merge February 25, 2026 10:25
@github-actions github-actions bot added area/uiux Front-end, user experience, plotting, JavaScript, JavaScript dev server rn/feature Mention under Features in Changelogs. size/M 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 filters out gateway experiments (auto-created when gateway endpoints have usage tracking enabled) from the experiment list page to reduce UI clutter. Gateway experiments are identified by the tag mlflow.experiment.sourceType=GATEWAY and filtered client-side before rendering.

Changes:

  • Added GATEWAY enum value and isGatewayExperiment() helper function to identify gateway experiments
  • Implemented client-side filtering in the experiment list query hook to exclude gateway experiments
  • Added unit test to verify gateway experiments are properly filtered out

Reviewed changes

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

File Description
experimentPage.common-utils.ts Added GATEWAY to ExperimentSourceType enum and created isGatewayExperiment() helper that checks for the gateway source type tag
useExperimentListQuery.ts Modified sorting logic to filter out gateway experiments before separating demo and non-demo experiments
useExperimentListQuery.test.tsx Added test case verifying gateway experiments are excluded from the returned experiment list

Comment on lines +138 to 141
const nonGateway = experiments.filter((e) => !isGatewayExperiment(e));
const demo = nonGateway.filter(isDemoExperiment);
const nonDemo = nonGateway.filter((e) => !isDemoExperiment(e));
return [...demo, ...nonDemo];
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

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

🟡 MODERATE: Client-side filtering reduces the page size inconsistently — if the API returns 10 experiments but 3 are gateway experiments, users only see 7 on that page. This creates a confusing UX where page sizes vary unpredictably.

Consider either:

  1. Filtering on the server side by adding gateway experiments to the search filter
  2. Documenting this behavior if it's acceptable for the product

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

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

@TomeHirata This is not a concern?

Copy link
Member

@harupy harupy Feb 25, 2026

Choose a reason for hiding this comment

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

Here's a video demonstrating the page size inconsistency:

gateway-experiment-page-size-bug.mp4

Copy link
Collaborator

Choose a reason for hiding this comment

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

Good call, missed this message. Filed #21138 for migrating into the server side filter.

Copy link
Member

@harupy harupy Feb 26, 2026

Choose a reason for hiding this comment

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

@TomeHirata Can you share #21138 in the relevant slack thread, which I think would've caught the issue.

Copy link
Member

Choose a reason for hiding this comment

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

For PRs like this, it’s risky to judge solo. Getting another set of eyes would help.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sure, I noticed a challenge to do it on the server. Can you take a look at #21146?


expect(result.current.data).toHaveLength(2);
expect(result.current.data?.map((e) => e.experimentId)).toEqual(['1', '3']);
});
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

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

🟢 NIT: Test coverage could be expanded to include edge cases: experiments that are both demo and gateway, or a page where all experiments are gateway experiments. While unlikely in practice, these scenarios would verify the filtering logic handles all cases correctly.

Suggested change
});
});
it('filters out experiments that are both demo and GATEWAY source type', async () => {
mockSearchExperiments.mockResolvedValueOnce({
experiments: [
{
experimentId: '1',
name: 'Regular Experiment',
artifactLocation: '/artifacts/1',
lifecycleStage: 'active',
lastUpdateTime: Date.now(),
creationTime: Date.now(),
tags: [],
allowedActions: [],
},
{
experimentId: '2',
name: 'Demo Gateway Experiment',
artifactLocation: '/artifacts/2',
lifecycleStage: 'active',
lastUpdateTime: Date.now(),
creationTime: Date.now(),
tags: [
{ key: 'mlflow.experimentType', value: 'DEMO' },
{ key: 'mlflow.experiment.sourceType', value: 'GATEWAY' },
],
allowedActions: [],
},
{
experimentId: '3',
name: 'Another Regular Experiment',
artifactLocation: '/artifacts/3',
lifecycleStage: 'active',
lastUpdateTime: Date.now(),
creationTime: Date.now(),
tags: [],
allowedActions: [],
},
],
});
const { result } = renderHook(() => useExperimentListQuery(), {
wrapper: createWrapper(),
});
await waitFor(() => expect(result.current.isLoading).toBe(false));
expect(result.current.data).toHaveLength(2);
expect(result.current.data?.map((e) => e.experimentId)).toEqual(['1', '3']);
});
it('returns an empty list when all experiments are GATEWAY source type', async () => {
mockSearchExperiments.mockResolvedValueOnce({
experiments: [
{
experimentId: '1',
name: 'Gateway Experiment 1',
artifactLocation: '/artifacts/1',
lifecycleStage: 'active',
lastUpdateTime: Date.now(),
creationTime: Date.now(),
tags: [{ key: 'mlflow.experiment.sourceType', value: 'GATEWAY' }],
allowedActions: [],
},
{
experimentId: '2',
name: 'Gateway Experiment 2',
artifactLocation: '/artifacts/2',
lifecycleStage: 'active',
lastUpdateTime: Date.now(),
creationTime: Date.now(),
tags: [{ key: 'mlflow.experiment.sourceType', value: 'GATEWAY' }],
allowedActions: [],
},
],
});
const { result } = renderHook(() => useExperimentListQuery(), {
wrapper: createWrapper(),
});
await waitFor(() => expect(result.current.isLoading).toBe(false));
expect(result.current.data).toHaveLength(0);
expect(result.current.data).toEqual([]);
});

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Contributor

Documentation preview for a2765b4 is available at:

More info
  • Ignore this comment if this PR does not change the documentation.
  • The preview is updated when a new commit is pushed to this PR.
  • This comment was created by this workflow run.
  • The documentation was built by this workflow run.

@TomeHirata TomeHirata added this pull request to the merge queue Feb 25, 2026
Merged via the queue into master with commit 0c7c0e9 Feb 25, 2026
40 of 41 checks passed
@TomeHirata TomeHirata deleted the copilot/filter-experiments-for-gateway branch February 25, 2026 10:41
smoorjani pushed a commit to smoorjani/mlflow that referenced this pull request Feb 26, 2026
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: TomeHirata <33407409+TomeHirata@users.noreply.github.com>
Signed-off-by: Samraj Moorjani <samraj.moorjani@databricks.com>
daniellok-db pushed a commit to daniellok-db/mlflow that referenced this pull request Mar 5, 2026
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
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
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/feature Mention under Features in Changelogs. size/M v3.10.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants