Skip to content

Resolve "Add API for enabling/disabling model experiments"

What does this MR do and why?

While it was possible to update the settings for a project's model experiments feature through the UI, there was such an option to do it through API. This adds the following capabilities:

  • On GET projects/:id (and other places where a project is fetched from the API), display current value of model_experiments_access_level
  • On POST projects, set the value of model_experiments_access_level
  • On PUT projects, change the value of model_experiments_access_level

How to set up and validate locally

  1. Get request should display the value of model_experiments_access_level:

    curl -X GET -H "Authorization: Bearer $GITLAB_TOKEN" "http://localhost:3000/api/v4/projects/$PROJECT_ID" | jq

    image

  2. Updating a project should change the value of model_experiments_access_level

    curl --request PUT --header "PRIVATE-TOKEN: $GITLAB_TOKEN" --data "model_experiments_access_level=disabled" --url "http://localhost:3000/api/v4/projects/$PROJECT_ID" | jq

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

Edited by Eduardo Bonet

Merge request reports

Loading