Better support for community edition in the Azure pipeline tasks

(Xavier) #1


I just installed a SonarQube server for evaluation purposes ; and for that I use the free Community edition. I want to analyze an existing project that is stored on an Azure DevOps repo with continuous integration, so I imagined the best way to try it would be to add the official SonarQube pipeline tasks to my existing build pipeline.

The problem: Unfortunately, the tasks fail when the build is not based on the master branch, because it is trying to send branch/PR informations to the server, and the server rejects them because I am using the Community version. While I’m fine with the licencing restrictions, it is frustrating to have to use manually configured command line tasks instead of the SonarQube ones because the tasks are not compatible with the free version. This restriction is not specified on the Azure plugin page, and having builds run in PRs or non-master branches is a very common scenario (I think).

Proposed improvement: An simple way to fix this situation would be to add two boolean settings in the SonarQube prepare task : Enable Branch Analysis and Enable PR Analysis. If disabled, the task would not try to generate sonar.pullrequest. or sonar.branch. properties before starting the analysis. Ideally, the task should probably discover on the SonarQube server if these capabilities are enabled, so that no additional configuration is required when setting up the task.
Clearly state on the plugin page / tasks descriptions that they cannot be used with the community edition outside or a non-master branch.

Thank you for reading. I hope that one day we can get the full branch/PR experience in Azure with SonarQube tasks even for those who don’t need them in the SonarQube server.