Skip to content

Use can? on ::Ml Controllers

What does this MR do and why?

Refactors CandidatesController and ExperimentsController to use the read_model_experiments permission instead of only checking the feature flag.

This is MR is part of adding the visilibility to Model experiments. To check the change in this MR in the full, context, refer to !121396 (closed)

How to set up and validate locally

  1. Pick a project

  2. Navigate to /-/ml/experiments. It should show 404

  3. Enable the feature flag on rails console:

    echo "Feature.enable(:ml_experiment_tracking)" | bundle exec rails c
  4. Navigate to /-/ml/experiments. It should the experiments page with an empty state image

  5. Disable model experiments on rails console (id is the id of the project you are testing)

    ProjectFeature.where(project_id: id).first.update!(model_experiments_access_level: 0)
  6. Navigate to /-/ml/experiments. It should show 404

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 #412384 (closed)

Edited by Vitali Tatarintev

Merge request reports

Loading