ASH
ASH

Reputation: 655

Automatically re-merge pull request in VSTS when master branch is updated

We have strict build expiration enabled on our pull requests in VSTS and block PRs from completing until a successful build has been achieved. This works well and keeps our master branch clean. However, a source of significant frustration that we regularly face is when we have multiple PRs queued and which ultimately expire due to a PR which is ahead in the queue being completed.

Consider the scenario:

We face the above problem almost daily and usually have several PRs backed up in the build queue. Our PR build takes ~1 hour to complete as it conducts extensive deployment and testing of the system. This leads to many hours of wasted build server time and some very frustrated developers.

Does anyone know of a way to avoid the above happening. It seems that an option to automatically remerge a PR whenever the master branch is updated would fully solve this issue.

Upvotes: 1

Views: 1498

Answers (1)

starian chen-MSFT
starian chen-MSFT

Reputation: 33698

There isn’t the automated way to avoid that in VSTS, you can change the build policy to expire after XX hours.

  1. Go to version control admin page
  2. Select a repository=> A branch=>Branch Policies
  3. Click Edit of a build definition in Build validation section
  4. Select After hours if master has been updated option and specify the hour.

Upvotes: 2

Related Questions