Skip to content

Refactors mlflow endpoints to use policies

What does this MR do and why?

Refactors mlflow endpoints 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. Execute the following request. pass an auth token and the project id. It should show 404:

    curl -X GET -H "Authorization: Bearer $GITLAB_PAT" http://localhost:3000/api/v4/projects/$PROJECT_ID/ml/mlflow/api/2.0/mlflow/experiments/list
  3. Enable the feature flag:

    echo "Feature.enable(:ml_experiment_tracking)" | bundle exec rails c
  4. Execute the following request. pass an auth token and the project id. It should return an empty list:

    curl -X GET -H "Authorization: Bearer $GITLAB_PAT" http://localhost:3000/api/v4/projects/$PROJECT_ID/ml/mlflow/api/2.0/mlflow/experiments/list
  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. Execute the following request. pass an auth token and the project id. It should show 404:

    curl -X GET -H "Authorization: Bearer $GITLAB_PAT" http://localhost:3000/api/v4/projects/$PROJECT_ID/ml/mlflow/api/2.0/mlflow/experiments/list

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 Eduardo Bonet

Merge request reports

Loading