SonarCloud is not Decorating Azure DevOps Pull Request

  • ALM used (GitHub, Bitbucket Cloud, Azure DevOps)
    Azure DevOps
  • CI system used (Bitbucket Cloud, Azure DevOps, Travis CI, Circle CI
    Azure DevOps

SonarCloud: ‘value’
organization: ‘value’
scannerMode: ‘value’
extraProperties: |
sonar.projectKey= ‘value’
sonar.branch.name=$(Build.SourceBranchName)
sonar.exclusions=.yml, coverage/ , migrations/**
sonar.coverage.jacoco.xmlReportPaths=$(System.DefaultWorkingDirectory)
sonar.qualitygate.wait=‘value’
sonar.qualitygate.timeout=‘value’

  • Languages of the repository : java

We have setup the pull request decoration and add the build policy and status policy as per the below sonarcloud documentation.

We can’t see the expected results of the pull request at the sonarcloud. The metrics value of the sonarcloud quality gate is showing value 0 for the PR’s.

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

Hey there

You definitely shouldn’t set this – as it will override the automatic detection of pull request parameters, therefore not analyzing it as a pull request (but as a branch).

If you still face issues, can you post a well-formatted copy of your YAML file describing your Azure DevOps Pipeline?