[go: up one dir, main page]

Add warning message when changing target branch

Issue: #199795 (comment 297929812)

What does this MR do?

This MR adds a warning message whenever the user changes the target branch

To work iteratively, this issue will be resolved in 2 steps:

  1. Displays a warning message whenever the user changes the target branch > this MR
  2. Displays a warning message IF the approvals form is dirty when user changes the target branch > #212730 (closed)

Note: Background information on the code implementation of this MR see comment here

Testing Case

Setup

Let's setup our rules in the project settings so we can test out the toggle rule in edit 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 a new random new merge request targeting the master branch.

(optional) You might also need to create a MR, if none exists

  1. Create a new Merge Request
  2. In the "New Merge Request" > Source branch: select any source branch | Target branch: select "master" branch
  3. Fill in any random information
  4. Click "Submit merge request"

Edit MR

  1. Go to the Merge Request and click edit
  2. In the target branch dropdown, select a different branch
  3. A warning message will appear
  • a warning message will appear

image

  • click cancel and it will close

  • "Master Rule" that was scoped to the master branch will NOT be fetched

  • In the target branch dropdown, select the "master" branch.

  • click "Change target branch" and it will close

  • "Master Rule" that was scoped to the master branch will be fetched

target branch: random branch target branch: master branch
image 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 #199795 (closed)

Edited by Samantha Ming

Merge request reports

Loading