8

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:

Alex
  • 569
  • 5
  • 21
  • 2
    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 Apr 15 '19 at 11:53
  • @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 Apr 15 '19 at 12:18
  • Sorry Alex, I don't know if that's possible. It's worth checking in the [docs](https://learn.microsoft.com/en-us/azure/devops/pipelines/release/deploy-pull-request-builds?view=azure-devops) 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 Apr 15 '19 at 12:24

1 Answers1

17

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.

Vince Bowdren
  • 8,326
  • 3
  • 31
  • 56
  • Thanks for this. Will this setting work also for ongoing PRs (created before changing the setting that you mentioned)? – mnj Mar 26 '20 at 14:42
  • @mnj yes it will also work for pr created before. I just tested it. It was not showing initially but when I tried to complete PR merged failed and then pipeline view shown on PR. – Yogesh Jog Aug 03 '23 at 16:46