Skip to content

Protected packages: Delete protection rule in project settings ui

What does this MR do and why?

  • Adding button "Delete" for each row containing a protection rule
  • Sending a graphql mutation "deletePackagesProtectionRule" when the button "Delete" is clicked
  • Showing an alert when the graphql mutation fails
  • Adding tests for button 'Delete'

🛠 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

I integrated the button "Delete" for each row, similar to the button in the table of protected branches




This is the alert message that is shown when the graphql mutation returns an error, e.g. internal server error, network error, etc.


How to set up and validate locally

  1. In rails console enable the experiment fully
  1. Add some package protection rules
15.times { |i| Packages::Protection::Rule.create(project: Project.find_by_full_path('flightjs/Flight'), package_name_pattern: "@flightjs/flight-package-#{i}", package_type: :npm, push_protected_up_to_access_level: :maintainer) }
  1. Go to http://gdk.test:3000/flightjs/Flight/-/settings/packages_and_registries
  2. Start deleting protection rules by clicking the button "Delete"

Related to #413641

Edited by Gerardo Navarro

Merge request reports