Adding quality gate/profile configuration to Gradle plugin

I’d like to be able to configure quality gate in gradle build script as below

sonarqube {
  properties {
    property "sonar.qualitygate", "My Quality Gate"
    property "sonar.qualitygate.code_coverage.name", "Code Coverage"
    property "sonar.qualitygate.code_coverage.status", "ERROR"
    property "sonar.qualitygate.code_coverage.metric", "coverage"
    property "sonar.qualitygate.code_coverage.op", "LT"
    property "sonar.qualitygate.code_coverage.error", "80"

    property "sonar.qualitygate.new_code_coverage.name", "New Code Coverage"
    property "sonar.qualitygate.new_code_coverage.status", "ERROR"
    property "sonar.qualitygate.new_code_coverage.metric", "new_coverage"
    property "sonar.qualitygate.new_code_coverage.op", "LT"
    property "sonar.qualitygate.new_code_coverage.error", "100"
  }
}

Hi,

Welcome to the community!

I’ve moved your thread to the Product Manager for a Day category since the feature doesn’t exist.

Could you help us understand why setting it via the UI isn’t sufficient?

What you’ve proposed implies the ability to change Quality Gate criteria with every run. Why is that desirable?

 
Thx,
Ann

We’re a team using Sonar with 100+ apps in a large organization, and for each new application we create (it’s pretty dynamic due to the nature of our work, which is facilitating test environments for other developers) we need to remember to change the defalt quality gate to our specific team’s quality gate using the web interface every time. Most often after we spot a GitHub Actions build failing on Sonar.

It would be much easier for us to specify “use this quality gate” in the part of Sonar config that is shared between all our team’s Gradle builds. One less thing to remember.

1 Like

Hello Cato,

Thank you for sharing your use case. A feature request is recorded and we will monitor the demand for this feature.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.