CI integration overview
Pull request analysis is available as part of Developer Edition and above.
Failing a pipeline job when the quality gate fails
You can ensure your code meets your quality standards by failing your pipeline job when your quality gate fails. The operation depends on the CI tool used.
With Jenkins, you can suspend pipeline execution until the analysis' quality gate status is known. See the Jenkins integration pages.
With GitHub Actions, you can fail the pipeline job when the quality gate fails using the SonarQube Quality Gate Check Action.
With Bitbucket Pipelines, you can fail the pipeline job when the quality gate fails using the SonarQube Quality Gate Check Pipe.
You can configure the SonarScanner to wait for the quality gate result. This setting will force the pipeline to fail if the quality gate fails.
To do so:
- Set the
sonar.qualitygate.wait
analysis parameter totrue
. - You can set the
sonar.qualitygate.timeout
analysis parameters to the number of seconds that the scanner should wait for a report to be processed. The default is 300 seconds.
For general information about setting up analysis parameters at the global and project levels, see Analysis parameters and the respective SonarScanner section: Maven, Gradle, .NET, NPM, or CLI.
GitLab CI/CD
For GitLab CI/CD configuration, see the Adding the SonarQube Server analysis to your GitLab CI/CD pipeline page.
GitHub Actions
For GitHub Actions configuration, see the GitHub integration page.
Azure Pipelines
For Azure Pipelines configuration, see the Azure Pipelines integration section.
Bitbucket Pipelines
For Bitbucket Pipelines configuration, see the Bitbucket Cloud integration page.
Jenkins
For Jenkins configuration, see Jenkins.
Was this page helpful?