Search code examples
tfstfsbuild

How to re-execute a TFS CI build set for a pull request


We have set a CI build for every Pull request. If a build fails for some reason, is there a way to re-initiate the build for the same PR.


Solution

  • You could simply re-run the failed build in pull request page under Policies, click queue build, such as below:

    enter image description here enter image description here

    Just pay attention, do not directly re-run build with the same pipeline other than queue the build policy from PR page, it's a little difference here.

    Queuing the build policy from PR page does a little more than just rerunning a build. It first needs to check if the target branch has moved and create a new merge commit if needed. In that case it will queue a completely new build and not rerunning the existing one. In addition, PR source branch could move and rerunning of the build on old merge commit would have no effect on PR policy. So at this point we do not see much value in investing in this scenario.

    Source: Rerunning failed build doesn't always count towards PR requirement