Skip to content

Limit editing of approval rules in Branch rule details

What does this MR do and why?

The read-only component has been already removed, because it was no longer in use ( !152971 (be85b95d)). So I thought that instead of hiding the whole section, we can limit the available editing and bind it to the edit_branch_rules feature flag.

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.

edit_branch_rules Before After
disabled before_Branch_rule_ff_disabled after_Branch_rule_ff_disabled
disabled before_MR_settings_ff_disabled after_MR_settings_ff_disabled
enabled before_Branch_rule_ff_enabled after_Branch_rule_ff_enabled
enabled before_MR_settings_ff_enabled after_MR_settings_ff_enabled

How to set up and validate locally

  1. Set
   Feature.disable(:edit_branch_rules)
  1. Go to Settings / Repository and expand Branch rules section.
  2. Choose a branch rule from the table and go to View details
  3. Merge request approvals section should not have controls for adding or editing the rules.
  4. Go to Settings / Merge requests and scroll to Merge request approvals section.
  5. You should be able to still edit and add new rules.

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

Related to: #466705 (closed)

Edited by Paulina Sedlak-Jakubowska

Merge request reports