- using SonarQube Enterprise Edition v10.7
- DevOps platform integration to GitHub for Quality Gate status reporting
- Jenkins
- SonarQube Scanner for Jenkins 2.17.2
- Running sonar scanner within Docker for dotnet and typescript builds
We have been running the sonar scanner with
- sonar.qualitygate.wait=true
- sonar.qualitygate.timeout=900
This works well, most of the time,
- Jenkins run starts
- GitHub pull request indicates that there is a pending check running
- Jenkins build invokes the scanner, and blocks on the SonarQube analysis of the quality gate
- SonarQube adds its pass / fail result as a completed check on the PR
- Jenkins updates the PR with it’s check result
The problem that I’m trying to solve is a intermittent Jenkins timeouts, waiting for the SonarQube analysis to complete, for larger repos, PRs, and times of higher loads.
I tried removing the sonar.qualitygate.wait, reasoning: Since Sonar is adding a check to the PR, the merge will be blocked until that is done, so why make Jenkins wait around for the result?
However, I found that the Jenkins check run would be shown as complete on the PR, with no indication that there was a Sonar check running, until Sonar added its final result.
So we’ve avoided the Jenkins timeouts, but there’s now a time window where a developer could merge a PR that is about to fail a Sonar quality gate.
So, my question: Is there a way to have the Sonar analysis start a GitHub check run with an in_progress status when it begins its analysis?