Self-contained sonar configuration through property file


(Olivier Cailloux) #1

(Following post on SO.)

It seems to me it is a good practice to have all build-related configuration or quality-related rules of a project defined inside the project itself (as human-readable configuration files). This has several advantages: any developer coming to the project can readily see what configuration it uses; human-readable configuration files are auto-documented ways of reproducing the configuration (e.g. in case a new server needs to be installed or switching to a different service); the configuration history gets stored in the same place as the rest of the history of the project.

But AFAIU the documentation of SonarQube is rather oriented towards using the SonarQube UI to change settings on a project. For example, I couldn’t find how to configure a different quality gate than default using a property file, rather it is suggested to configure it using the UI or using curl. This would make it non obvious to a foreign developer that a different quality gate is used on that project, it seems to me.

A related question I have (not sure it’s appropriate to post it here?) is: as I’m using Sonar Cloud, how can I configure the quality gate? Sonar Cloud does not seem to allow this configuration through its UI.


Project configuration living with source code