Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How add the Status Check Validation in Azure build Policies for PR

I wanted to understand on the Status Check option that is given in the "Build Policies" in AZURE VSTS. I have gone through the below doc from Azure, but I'm unable to know how do we add the "Status to Check" field, what is it pointing to, what reference should be provided? https://learn.microsoft.com/en-us/azure/devops/repos/git/pr-status-policy?view=azure-devops

I want to add Sonarqube PR Decoration for all the pull request created, I have also gone through the below document form sonarqube, but unable to get it how exactly its done. https://sonarqube.kognif.ai/documentation/analysis/azuredevops-integration/#adding-pull-request-decoration-to-azure-devops

Can anyone let me know on this?

like image 706
Raghu Hoskote Avatar asked Oct 28 '25 14:10

Raghu Hoskote


1 Answers

how do we add the "Status to Check" field, what is it pointing to, what reference should be provided?

Please follow below steps.

  1. Create a build pipeline using this repository and specify its master branch.
  2. Please follow this doc: Deploy pull request Artifacts with Azure Pipelines to configure your release pipeline using this build pipeline.
  3. Set up the branch policies and set this build pipeline as the Build Validation.
  4. Create a test pull request to trigger this build pipeline, and then the successful build will trigger a pull request release and then the release is deployed to the specified environments, and the status of the deployment is displayed in the PR page.
  5. Select Add status policy in the branch policies and select a status policy from the status to check dropdown menu. The dropdown contains a list of recent statuses. Everything is done.
  6. Now you should know how to add Sonarqube PR Decoration as the status policy in the branch policies for all the pull request. See video: Azure DevOps Pull Request/Branch Decoration with SonarQube for more details.
like image 125
Edward Han-MSFT Avatar answered Oct 30 '25 11:10

Edward Han-MSFT



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!