It seems that the latest release of sonar-scanner-vsts (5.16.0, released today, Release SonarQube extension 5.16.0 · SonarSource/sonar-scanner-vsts · GitHub) has broken the SonarQubePrepare@5 task for Azure DevOps for the Community Edition. The SonarQubePrepare@5 task started throwing the following error in our Azure DevOps pipeline today:
ERROR: Validation of project failed:
o To use the property "sonar.branch.name" and analyze branches, Developer Edition or above is required. See https://docs.sonarsource.com/sonarqube/10.2/analyzing-source-code/branches/branch-analysis/ for more information.
We do not set the “sonar.branch.name” explicitly anywhere, and we are analyzing the default branch of the project.
Nice to hear that the issue was fixed for most of you.
@gclpixel , there is a known limitation for AzDO extension with SQ Community where you can not use a main branch named differently than “master” on any provider (except Azure Repos).
If you are having issues with an edition that supports branches, you can also specify the branch to be used in your pipeline, in the Prepare task under extra properties:
- task: SonarQubePrepare@5
inputs:
[..]
extraProperties: |
# Additional properties that will be passed to the scanner,
# Put one key=value per line, example:
# sonar.exclusions=**/*.bin
sonar.branch.name=dev