Skip to content

Protected containers: Protection rules in project settings ui

What does this MR do and why?

  • Adds frontend ui for the container protection rule in project settings
  • Hide project setting for container protection rules when relevant feature flag is disabled
  • This frontend -related MR uses the GraphQL API to interact with the backend
  • This MR is part of the epic "protected containers", see Container Registry: Granular protection for rep... (&9825)
  • This MR just focusses on listing the existing container protection rules for this project
  • Form for creating, updating and deleting protection rules will be part of follow-up MRs, see #441345

🛠 with at Siemens

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.

MR Checklist (@gerardo-navarro)

Screenshots or screen recordings

Screenshot of the list container container protection rules.

image

When there is an error while fetching the container protection rules, we get the following alert message.

image

How to set up and validate locally

  1. In rails console enable the experiment fully
Feature.enable(:container_registry_protected_containers)
  1. Create some container protection rules to show in the table
15.times { |i| ContainerRegistry::Protection::Rule.create(project: Project.find(7), repository_path_pattern: "flightjs/flight#{i}", push_protected_up_to_access_level: :maintainer, delete_protected_up_to_access_level: :developer) }
  1. Go to http://gdk.test:3000/flightjs/Flight/-/settings/packages_and_registries and scroll down a bit
  2. See the list of protection rules

Related to #441345

Edited by Gerardo Navarro

Merge request reports