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 isMrRule in the Rules component was getting assigned a default true value.

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
ismredit_before ismeredit_after

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Open Rails console. In your terminal: rails c
  2. Enable the feature flag:
Feature.enable(:edit_branch_rules)
  1. In a project, go to Settings / Repository
  2. Expand Branch rules section and choose View details for one of the rules
  3. Create Allowed to merge rule, try selecting a group
  4. Create a new Merge Request approval rule and edit an already existing one
  5. Open Rails console. In your terminal: rails c
  6. Disable the feature flag:
Feature.disable(:edit_branch_rules)
  1. 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

Merge request reports

Loading