Skip to content

Allow force push only when Allowed to push&merge is populated

What does this MR do and why?

  • hides Allow force push section, if nothing is set for Allowed to push and merge
  • moves Allowed to push and merge to be just above the Allow force push section
  • makes unit tests independent of the component order

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
Screenshot_2024-05-27_at_13.34.05 Screenshot_2024-05-27_at_13.33.22
Screenshot_2024-05-27_at_13.33.57 Screenshot_2024-05-27_at_13.33.38

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
    1. Enable the feature flag:
Feature.enable(:edit_branch_rules)
  1. In a project, go to Settings / Repository
  2. Expand Branch rules section.
  3. Choose an existing rule or create one.
  4. Navigate to Branch rule details page.
  5. You should not see Allow force push, when Allowed to push and merge is empty.
  6. Change the value of Allowed to push and merge in Settings / Repository / Protected branches
  7. Visit branch rule page again, notice the section Allow force push rendered.

Related to #438970 (closed)

Edited by Paulina Sedlak-Jakubowska

Merge request reports