Skip to content

Update protected branches select to a listbox

What does this MR do and why?

Describe in detail what your merge request does and why.

Update protected branches select to a listbox

  • the collapsible listbox is pajamas compliant and the GlDropdown is no longer recommended

Changelog: changed

EE: true

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Location Before After
Status Approval status_-_b status_-_a
Merge Request Approval approval_-_b approval_-_a
Scan Result Policy Rule policies_-_b policies_-_a

How to set up and validate locally

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

MR approval rules

  1. Enable the feature flag :project_approval_rule_all_protected_branches : echo "Feature.enable(:project_approval_rule_all_protected_branches)" | rails c.
  2. 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.
  3. 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.
  4. Test that setting all branches or all protected branches and saving the approval rule shows the correct value on the rules list.
  5. Create a new MR and test that the approval rule with all branches or all protected branches is picked up.
  6. Create a new MR targeting a non-protected branch and check that the all protected branches rule is not picked up.

Status checks branch selection

  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.

Policy builder branch selection

  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