6
votes

I would like to display the status of pipeline builds in Azure Pipelines in corresponding pull requests in Azure DevOps Repos.

I'd like to have some indicator which shows that a build succeeded of failed, like this (Note that this is a screenshot from the microsoft docs page, also mentioned below): PR status

In my research I came across different solutions, including the following ones:

1
Hi Alex; can I check: do you already have the CI pipeline enabled in the Build validation section of your branch's Build Policies settings screen?Vince Bowdren
@VinceBowdren Thanks! With an activated Pre-Merge build, the status is indeed displayed. Do you know if it's also possible to just show the status of the latest build of the feature branch (the branch to be merged) instead of triggering an additional build?Alex
Sorry Alex, I don't know if that's possible. It's worth checking in the docs though; it confirms there that builds triggered by the PR (by branch policies) are displayed on the PR screen, and it might describe further functionality too.Vince Bowdren

1 Answers

11
votes

The key is to configure the CI pipeline as a Build Validation requirement, in the Build Policies settings of your master branch.

When that's configured, the PR will automatically kick off a CI build, and display its status in the PR screen.