Edit branch rules: BE/FE integration for deploy keys
What does this MR do and why?
This MR displays any deploy keys that are set for Allowed to push and merge branch protection. It also makes sure that if any of the branch protections are edited on Branch rule details page, deploy keys persist even though they can not be edited.
Editing of deploy keys will be handled in !163767 (merged)
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.
| Context | Before | After |
|---|---|---|
edit_branch_rules ff enabled |
![]() |
Screen_Recording_2024-08-23_at_17.47.55 |
edit_branch_rules ff disabled |
![]() |
![]() |
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
-
In rails console enable the experiment fully
Feature.enable(:edit_branch_rules) -
Make sure you have a deploy key with read-write permission for that project: https://docs.gitlab.com/ee/user/project/deploy_keys/#create-a-project-deploy-key
-
Go to *Project / Settings / Repository / Protected branches and set the deploy key in Allowed to push and merge dropdown.
-
Scroll up to Project / Settings / Repository / Branch rules and click View details for a branch you protected with the key
-
When on Branch rule details page, make sure you can see your deploy key in the Allowed to push and merge section
-
In Allowed to push and merge section click Edit and change any settings
-
Make sure you still see your deploy key after editing the rule.
-
In rails console disnable the experiment
Feature.disable(:edit_branch_rules) -
When on Branch rule details page, make sure you can see your deploy key in the Allowed to push and merge section
Related to #474084 (closed)


