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 |
---|---|
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.
- Choose an existing rule or create one.
- Navigate to Branch rule details page.
- You should not see Allow force push, when Allowed to push and merge is empty.
- Change the value of Allowed to push and merge in Settings / Repository / Protected branches
- Visit branch rule page again, notice the section Allow force push rendered.
Related to #438970 (closed)
Edited by Paulina Sedlak-Jakubowska