Remove the ml_bounded_candidate_metric_reads feature flag

What does this MR do and why?

Removes the ml_bounded_candidate_metric_reads feature flag, which has been enabled on GitLab.com since 2026-11-02. With the flag on, the ML run page embeds at most the 1,000 most recent metric rows of a run, and the experiment CSV export no longer loads the full metric history of each run. This MR keeps that behavior for every instance and deletes the old code paths.

Self-managed instances see two changes in 19.6:

  • The run page shows only the 1,000 most recent metric values of a run. A metric with no values in that range disappears from the Performance table, but the run list of the experiment still shows its latest value. The ML experiment docs now say this.
  • The CSV export sorts the metric columns by name, not in order of first appearance, so a script that reads the columns by position can break.
Context for reviewers and agents
  • The flag came from !263967 (merged). The frontend part (logged steps and the truncation alert in the run metrics table) is !264613 (merged). It reads metricsTruncated and has no flag check, so no frontend file changes.
  • app/presenters/ml/candidate_details_presenter.rb: embedded_metrics always reads Ml::CandidateMetric.most_recent_for_candidate.
  • app/presenters/ml/candidates_csv_presenter.rb: the export always takes the metric columns from latest_metrics (sorted by name) and builds the rows from without_preloads with only :experiment. The project: keyword existed only for the flag check, so it is gone, and so is CANDIDATE_ASSOCIATIONS, which only the old path used. The one caller, app/controllers/projects/ml/experiments_controller.rb, no longer passes it.
  • Specs: removes the examples for the disabled flag, including the CSV example that compared the output of both paths. The other examples test the same behavior as before. The details presenter spec no longer stubs candidate.metrics, because the presenter no longer calls it.
  • No query changes. This MR only deletes the old path of queries that had database review in !263967 (merged).
  • gitlab_com_derisk flags are never default-enabled, so the removal happens in one MR.
  • doc/user/project/ml/experiment_tracking/_index.md ("View logged metrics") describes the limit, in a separate commit with no changelog trailer.
  • The removal of the ml_candidate_metric_order_lateral flag opens in parallel.

Rollback: revert this MR.

References

Related to https://gitlab.com/gitlab-org/gitlab/-/work_items/635208

Screenshots or screen recordings

No UI change on GitLab.com, which has shown this behavior since 2026-11-02. On self-managed, the truncation alert from !264613 (merged) appears for the first time.

How to set up and validate locally

  1. Open the run page of an ML experiment run that has more than 1,000 metric rows, for example http://gdk.test:3000/<project>/-/ml/candidates/<iid>.
  2. Open the "Performance" tab.
  3. Expect: the alert "This run has more metric values than the page can show." appears above the table, and the table shows only the most recent 1,000 metric values.
  4. Open the experiment page and click "Download as CSV".
  5. Expect: the CSV has one column per metric name, sorted by name, with the latest value of each metric.
Seed a run with more than 1,000 metric rows
c = Ml::Candidate.last
rows = Array.new(1_001) { |i| { candidate_id: c.id, project_id: c.project_id, name: "m#{i % 2}", value: i, step: i / 2, tracked_at: i, created_at: Time.current, updated_at: Time.current } }
Ml::CandidateMetric.insert_all(rows)

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Eduardo Bonet

Merge request reports

Loading
Loading