Refactor ff guard for MR approvals on Branch rule details
What does this MR do and why?
- refactoring hiding the edit options for MR approvals on Branch rule details page: previously hid behind the feature flag as a quick fix. This MR introduces full control with the feature flag, while still checking the permissions for editing
- fixing wrong assigned values: I noticed that
isMrRulein the Rules component was getting assigned a defaulttruevalue.
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 |
|---|---|
![]() |
![]() |
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Open Rails console. In your terminal:
rails c - Enable the feature flag:
Feature.enable(:edit_branch_rules)
- In a project, go to Settings / Repository
- Expand Branch rules section and choose View details for one of the rules
- Create Allowed to merge rule, try selecting a group
- Create a new Merge Request approval rule and edit an already existing one
- Open Rails console. In your terminal:
rails c - Disable the feature flag:
Feature.disable(:edit_branch_rules)
- Make sure it is no longer possible to edit or add anything in Merge Request approval section
Related to #464039 (closed)
Edited by Paulina Sedlak-Jakubowska

