Sonar buildbreaker not breaking build

Hi there,

We’re hoping to run full SonarCloud scans on our repository via our CI tooling.

We’re using the Sonarqube Gradle plugin and the configuration is as so:

configure<SonarQubeExtension> {
    properties {
        property("sonar.projectKey", "UKHO_spark-ais-to-raster")
        property("sonar.organization", "ukho")
        property("sonar.host.url", "https://sonarcloud.io")
        property("sonar.login", System.getenv("SONARQUBE_LOGIN_TOKEN"))
        property("sonar.buildbreaker.skip", false)
    }
}

Even though when running gradle sonarqube and having a scan that results in:

My Gradle comes out with:

executing gradlew instead of gradle

BUILD SUCCESSFUL in 16s
8 actionable tasks: 1 executed, 7 up-to-date

Is there something wrong in my configuration that means it’s still skipping the build breaker?

Many thanks!

Hi there,

The sonar.buildbreaker.skip setting is not supported by our products. We stopped supporting breaking the build a long time ago. This is explained in the blog post Why You Shouldn’t Use Build Breaker.

We recommend to use your CI system to achieve such effect. For example using GitHub checks, you could make the SonarCloud quality gate check required and prevent merges.

But PR on feature branches are doing a full static code analysis.
So code will be merged even it contains bugs.