Skip to content

Updates container registry set up cleanup link

What does this MR do and why?

Updates container registry set up cleanup link

Set up cleanup link should not be visible on the container registry list page if the user does not have permission to view packages & registries settings page.

Also removes Gitlab.com? check.

The logic has been updated to show the link when project.container_expiration_policy is either nil or enabled: false based on discussion.

Changelog: fixed

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

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

Before After
Screenshot_2024-07-11_at_11.24.39_PM Screenshot_2024-07-11_at_11.06.54_PM

How to set up and validate locally

  1. Setup & enable Container Registry https://gitlab.com/gitlab-org/gitlab-development-kit/-/blob/main/doc/howto/registry.md
  2. Add a project, and follow steps in http://gdk.test:3000/{group}/{project}/container_registry to publish an image
  3. Visit Project > Deploy > Container Registry
  4. Confirm that link is visible, even when run as self-managed or FOSS-only.
  5. Enable the policy by clicking on the link.
  6. Re-visiting Project > Deploy > Container Registry should not show the link anymore.

Additionally on the rails console run,

p = Project.find(<project_id>)
p.container_expiration_policy.destroy!

Confirm that link is visible again.

Related to #463205 (closed)

Edited by Rahul Chanila

Merge request reports