Skip to content

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) image image
Status Checks (Single Select) image image
Security Policy Builder (Multi Select) image image

How to set up and validate locally

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

MR approval rules

  1. 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.
  2. 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.
  3. Test that setting all branches or all protected branches and saving the approval rule shows the correct value on the rules list.
  4. Create a new MR and test that the approval rule with all branches or all protected branches is picked up.
  5. Create a new MR targeting a non-protected branch and check that the all protected branches rule is not picked up.

Status Checks

  1. 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
  2. Create or edit a status check and test that you can select all branches and a specific branch by selection or search.
  3. Confirm all protected branches is not shown.
  4. Test saving a status check, all branches is shown on the status checks list.

Security Policy Builder

  1. 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
  2. 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.

Related to #351263 (closed)

Edited by Alexander Turinske

Merge request reports

Loading