Skip to content

Adds API to control model registry project setting

Darby Frey requested to merge model-registry-project-setting-api into master

What does this MR do and why?

Continuing on the work in Add feature toggle for Model registry (#412734 - closed), this MR adds the configuration to allow the project settings API to control the setting for the GitLab Model Registry. It adds:

  • On GET projects/:id, returns current value of model_registry_access_level
  • On POST projects, set the value of model_registry_access_level
  • On PUT projects, update the value of model_registry_access_level

How to set up and validate locally

  1. Get request should display the value of model_registry_access_level:
curl -X GET -H "Authorization: Bearer $GITLAB_TOKEN" "http://localhost:3000/api/v4/projects/$PROJECT_ID" | jq

Screenshot_2023-12-06_at_2.28.54_PM

  1. Updating a project should change the value of model_registry_access_level:
curl --request PUT -H "Authorization: Bearer $GITLAB_TOKEN" --data "model_registry_access_level=disabled" --URL "http://localhost:3000/api/v4/projects/$PROJECT_ID" | jq

Screenshot_2023-12-06_at_2.30.07_PM

MR acceptance checklist

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

Merge request reports