Update protected_branch_selector to allow multiple select
What does this MR do and why?
Describe in detail what your merge request does and why.
Update protected branches selector to allow multiple select
- move default options to footer
- remove default options from showing up in search as they will always be in the footer
- update to use arrays for selected branches
Changelog: added
EE: true
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Scenario | Before | After |
---|---|---|
MR Approval Rules (Single Select) | ||
Status Checks (Single Select) | ||
Security Policy Builder (Multi Select) |
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR approval rules
- Visit a projects settings page and open the
Merge request approvals
section e.g.http://gdk.test:3000/gitlab-org/gitlab-test/edit#js-merge-request-approval-settings
. - Create or edit an approval rule and test that you can select all branches, all protected branches and a specific branch by selection or search.
- Test that setting all branches or all protected branches and saving the approval rule shows the correct value on the rules list.
- Create a new MR and test that the approval rule with all branches or all protected branches is picked up.
- Create a new MR targeting a non-protected branch and check that the all protected branches rule is not picked up.
Status Checks
- Visit a projects settings page and open the
Merge requests > Status checks
section e.g.http://gdk.test:3000/gitlab-org/gitlab-test/edit#js-merge-request-settings
- Create or edit a status check and test that you can select all branches and a specific branch by selection or search.
- Confirm all protected branches is not shown.
- Test saving a status check, all branches is shown on the status checks list.
Security Policy Builder
- Visit a projects security policies page and create or edit a new scan result policy e.g.
http://gdk.test:3000/gitlab-org/gitlab-test/-/security/policies/new?type=scan_result_policy
- Test that you can select all branches or a specific branch via selection or search and it sets the right-hand side YAML correctly.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #351263 (closed)
Edited by Alexander Turinske