Protected packages: Update protection rules in project settings ui
requested to merge gitlab-community/gitlab:413641-gerardo-navarro-protected-packages-add-project-settings-ui-update into master
What does this MR do and why?
- Adding option to update the protection rule in the project setting overview
- Sending a graphql mutation "updatePackagesProtectionRule" when access level for push protection changes
- Adding an alert when the graphql mutation is not successful
- Adding tests
Changelog: added
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)
-
Changelog entry added, if necessary -
Documentation created/updated via this MR -
Documentation reviewed by technical writer or follow-up review issue created -
Tests added for this feature/bug -
Tested in all supported browsers -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the javascript style guides -
Conforms to the database guides -
Wait for Protected packages: Delete protection rule in p... (!140483 - merged)
Screenshots or screen recordings
Here is the screen recording showing how to update protection rules: https://www.loom.com/share/2c5162427e804bb2b966fe7a0bc00119
How to set up and validate locally
- In rails console enable the experiment fully
Feature.enable(:packages_protected_packages)
- Create 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) }
- Go to http://gdk.test:3000/flightjs/Flight/-/settings/packages_and_registries
- Start updating the protection rules by changing the selectbox "Push protected up to access level"
Related to #413641
Edited by Gerardo Navarro