Pull Request integration with Azure DevOps (in conjunction with chained builds)



I am trying to create a pull-request build using Azure DevOps as our repository and TeamCity as on-prem build server. The created build is a chained build (6 builds in total) which run partially parallel to speed up the build. This works great! With every pull-request created and pull-request branch updated, a build is triggered!

However, since we want to use this as gated build (every pull-request needs a successful build), we would like to use the commit status publisher to update the status of the build back to Azure DevOps.

The problem we are encountering is that the build status is not correctly updated by the commit status publisher. Looking for similar issues on the forum, it seems that this is due to the logical branch name conversion. When removing the source and target branch filters, 2 builds are triggered. One build which runs correctly. And a second build which runs directly on the pull/xxxx/merge branch. The latter reports the status back to Azure DevOps, only the dependencies are NOT built on this branch, but instead run on the main branch.

To isolate the problem, I have created a simple build pipeline to illustrate this problem:

I have tried a variety of combinations between branch specifications/triggers/pull-request feature configurations, but I was unable to find a combination that works for this use-case.

My question is…  Am I'm missing something perhaps? It seems like a common use-case scenario. Hopefully someone can enlighten me.


Currently the build is configured in the following VCS Root/VCS Trigger/Pull request feature combination (Correct build without working status update).

Branch specification on VCS Root:

Branch Filter on VCS Trigger:

Pull Request filtering on Pull Request Feature:

Thank you in advance!

Hi! As I understand, you want the 'Work' build configuration to check out the 'pull/X/merge' branch instead of 'main'. That should be the case as long as the Pull Requests build feature is added to the VCS root attached to the 'Work' configuration and the repo has a ref with the same pull request number available (in this example, 9694).

Is the Pull Request feature added to the 'Work' configuration?
Does the 'Work' configuration have the same VCS Root attached as the 'Trigger' configuration?

Thank you very, very much!!! Adding the Pull Request build feature to the dependent builds in the build chain did the trick! After clearing the source/target branch filters on the Pull Request build feature and clearing the branch specification on the VCS root, everything works as expected!

Once again thanks, I spent a lot of hours on troubleshooting this problem and was pretty much out of options!


Please sign in to leave a comment.