Skip to content

Adds Pagination to Candidates on Experiment Page

What does this MR do and why?

We didn't have pagination on the list of candidates for the experiment page. Now we do.

How to set up and validate locally

  1. Enable the feature flag

    echo "Feature.enable(:ml_experiment_tracking)" | bundle exec rails c
  2. Create an Experiment and 100 candidates

    exp = Ml::Experiment.create!(name: "Gitlab Experiment For Pagination", user_id: user_id, project_id: project_id)
    100.times.each { |i| exp.candidates.create!(user_id: user_id, start_time: 0, run_name: "candidate_#{i}") }
    exp.candidates.each_with_index { |c, i| c.metrics.create!(name: "auc", value: i*0.1 , tracked_at: Time.zone.now, step: 1)} 
    exp.candidates.each_with_index { |c, i| c.metrics.create!(name: "accuracy", value: i* 0.1+0.1 , tracked_at: Time.zone.now, step: 1)} 
    exp.candidates.each { |c| c.params.create!(name: "algorithm", value: ["LogisticRegression", "DecisionTree"].sample )}
  3. Navigate to <your project>/-/ml/experiments and click on "Gitlab Experiment for Pagination"

  4. You should see pagination at the bottom of the table:

    image

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #383984 (closed)

Edited by Eduardo Bonet

Merge request reports