Skip to content

Update container cleanup policy permissions

🔎 What does this MR do and why?

This MR updates the permissions involving container repository cleanup policies from Developer to Maintainer.

The UI page that controls these settings requires maintainer access, however, the API only requires developer. This change is meant to make the two match each other to prevent confusion and also conform with most other similar settings throughout GitLab.

📷 Screenshots or screen recordings

Screen_Shot_2022-05-05_at_3.31.54_PM

💻 How to set up and validate locally

  1. Create a project, or choose an existing project.
  2. Create a user
  3. Add the new user to the project as a Developer.
  4. While logged in as the Developer user, use the graphql explorer: http://gdk.test:3000/-/graphql-explorer to try to update the container expiration policy settings using the query below:
    mutation {
      updateContainerExpirationPolicy(input: {projectPath: "<project-full-path>", enabled:false, keepN:FIFTY_TAGS}) {
        containerExpirationPolicy {
    	 enabled
          keepN
        }
      }
    }
  5. The request should be unsuccessful
  6. Optionally, you could try the request again while logged in as a maintainer or the owner of the project, the request should be successful.

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

Edited by Steve Abrams

Merge request reports