Skip to content

Fix snippets_access_level usage in Project Create Service

What does this MR do and why?

Every API Request setting only snippets_access_level and the required attributes on a project creation will fail with a 500 error.

If both snippets_access_level and builds_access_level are set, snippets_enabled is set to the value of builds_access_level

This mistake was introduced in Override deprecated project attribute field (!107920 - merged).

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

POST <base-url>/api/v4/projects

{
  "name": "testing",
  "namespace_id": "<some-namespace-id>",
  "snippets_access_level": "private"
}

Verify that the project was created and the request didn't fail with a 500 error

MR acceptance checklist

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

Edited by Vitali Tatarintev

Merge request reports