Pull Request policies and Build in Visual Studio Team Services

1k views Asked by At

I'm using Visual Studio Team Services and I'd like to use the build policies for Pull request on develop

Options http://img11.hostingpics.net/pics/638526Capture.png

It's great, except that I don't have the auto queue for build if develop is updated as I saw on this webpage : https://www.visualstudio.com/en-us/docs/git/branch-policies

Always require a new build: This option will queue a new build when the target branch updates. This ensures that the changes in the pull request pass the pull request build using the latest commits on the target branch. This option is best for smaller teams or branches with a lower number of changes. Teams working in busy shared branches may find it tedious to rebuild every time the branch is updated.

Anyone have been able to automatically queue a new build if the old one is deprecated ?

Edit :

A little workflow of what is actually going on :
- PR01 to develop is created, build 01 is queued and done
- PR02 to develop is created, build 02 is queued and done
- PR01 is accepted, and develop is updated.
- PR02 is accepted, but the build is outdated because develop has changed and no build has been queued automatically. So the PR02 cannot be complete because we have to wait for build 03 that has to be queued manually.

What I would like :
- PR01 to develop is created, build 01 is queued and done
- PR02 to develop is created, build 02 is queued and done
- PR01 is accepted, and develop is updated.
- Build 03 for PR02 is queued because develop has changed
- PR02 is accepted and complete

Is there any way to do so ?

Thanks for your help

1

There are 1 answers

2
starian chen-MSFT On

Regarding the same pull request, the previous build that still in progress will be canceled if there is new change sync to the target branch.

For example: Dev > Master

  1. Make changes in Dev, then commit and sync to remote Dev branch
  2. Create Pull Request (Dev > Master), then a new build will be triggered (e.g. build 01)
  3. Make changes in Dev, then commit and sync to remote Dev branch, then the new build should be triggered (e.g. build 02)
  4. The build 01 will be canceled automatically if it still in progress, then build 02 will be started with latest version.

》Build 03 for PR02 is queued because develop has changed

The workaround is that create two branches from develop (e.g. developDev, developTest), then merge them to develop branch directly after finish work.

I submit a feedback that you can follow: build policies for Pull request