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
-
Pick a project
-
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
-
Enable the feature flag:
echo "Feature.enable(:ml_experiment_tracking)" | bundle exec rails c
-
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
-
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)
-
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.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #412384 (closed)