Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Re-checking for merge conflicts in VSTS (Azure DevOps)

Setup

Master branch policies: When new changes are pushed: reset all approval votes

  • Create a Pull Request (PR1) from dev branch to master branch
  • VSTS performs policy checks.

enter image description here

  • Before the user is able to complete the PR1, another PR (PR2) is completed and merged to master.

Issue/Question The PR1 status still says "No merge conflict/last checked # minutes ago"; however, that may no longer be the case since the target (master) branch was updated. If the user performs a merge locally (merge master (PR2) to dev) and pushes the newly merged code, the votes get reset. Now the user has to wait for reviews again.

Is there a way to either trigger merge conflict check manually in a PR, or to NOT reset votes if the user pushed new changes, but those changes are just a "merge from master".

like image 934
Metal Wing Avatar asked Sep 30 '20 14:09

Metal Wing


People also ask

How does Azure Devops check merge conflicts?

Select the Conflicts link to start resolve file conflicts. This will bring up a list of files with conflicts. Selecting a file lets you accept the changes in the source branch you're merging from with the Take Source button or accept the changes in the branch you're merging into using Keep Target.

How do you view merge conflicts?

To see the beginning of the merge conflict in your file, search the file for the conflict marker <<<<<<< . When you open the file in your text editor, you'll see the changes from the HEAD or base branch after the line <<<<<<< HEAD .


1 Answers

Is there a way to either trigger merge conflict check manually in a PR, or to NOT reset votes if the user pushed new changes, but those changes are just a "merge from master"

We provided one button can help you achieve triggering merge conflict check manually.

Just pls firstly click on the three dots button on the upper right corner of the PR1 page => Click on Restart merge to re-check the merge conflicts:

enter image description here

Then you will see the conflict check start and prompt you the result of checking.

As normal, the active PRs' policy checking will be live updated automatically if someone made changes on Branch policy. But for conflicts re-checking, you have to click on Restart merge manually to start the live update.

BUT, I'm afraid the approved votes should be reset if you decide to apply some changes to dev branch after checking&review the new conflicts. According to the logic of review, the approved votes are for your changes in the previous version. Now, if you decide to apply some new changes to your dev branch, the changes that will be merged to the master branch at this time have changed. I think it’s better to review it again.

like image 185
Mengdi Liang Avatar answered Oct 20 '22 22:10

Mengdi Liang