Skip to content

Resolve "Branch-scoped approval rules not working in Create MR form"

Issue: #199788 (closed)

What does this MR do?

This MR supports the BE > !27886 (merged) of passing the selected the target branch when creating a new merge request.

Testing Case

Setup

Let's setup our rules in the project settings so we can test out the toggle rule in our MR...

  1. Go to Settings > General > expand "Merge request approvals"
  2. Add a new approval rule
  3. Create a new rule named "Any Rule" and target it to any branch
  4. Create a new rule named "Master Rule" and target it to "master" branch

(For details on how to add a rule scoped to a particular branch, please see the testing case of this MR > !24344 (merged))

Here's the end result you should see:

image

Create MR

  1. Create a new merge request
  2. Select a target branch that is NOT master
  3. You should see the "Any Rule" pre-populated

image

  1. Don't make any changes and click "Submit merge request"

Edit MR

  1. On the MR you just created, click "edit"
  2. You should see the "Any Rule"
  3. Now in the target branch dropdown, select "master"

image

  • You should now see the "Master Rule"

image

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Closes #199788 (closed)

Edited by 🤖 GitLab Bot 🤖

Merge request reports