SonarCloud Integration
Connect SonarCloud to pull coverage metrics, quality gate status, and new-code coverage into Koalr.
SonarCloud Integration
Connecting SonarCloud gives Koalr access to code coverage trends, quality gate results, and new-code coverage — the percentage of code added since your last release that is covered by tests.
What Koalr syncs
- Coverage % — line coverage and branch coverage per repository, trended over time
- New code coverage —
new_coveragemetric: coverage on changed lines since the last analysis. This is your quality gate signal — it answers "are we testing new code?" - Quality gate status — PASSED / FAILED per analysis, with failing conditions surfaced in Koalr's coverage dashboard
- Test metrics — test success rate, failure count, execution time trend
- Technical debt — SonarCloud's debt ratio and code smell count
Prerequisites
- SonarCloud account (free for public repos; paid for private)
- A SonarCloud User Token (Account → Security → Generate Tokens)
- The token needs Browse permission on your organization's projects
Setup
- In Koalr, go to Settings → Integrations.
- Click Connect next to SonarCloud.
- Paste your SonarCloud User Token.
- Enter your SonarCloud organization key (visible in SonarCloud → Organization Settings → General).
- Click Save. Koalr validates access and syncs the past 90 days of analysis history.
New code coverage — Koalr's differentiator
Most platforms show only overall repo coverage %. Koalr surfaces new code coverage (new_coverage) — the percentage of lines introduced since the last version tag that are covered by tests.
This is the metric your quality gate should enforce: a codebase can maintain 80% overall coverage while steadily reducing coverage on new code. new_coverage catches this pattern.
You'll see this metric on:
- Coverage → Repository detail —
New Code Coverage %tile with trend chart - Delivery → Deploy Risk — incorporated into the Patch Coverage factor (Tier 2)
SonarQube (self-hosted)
If your organization runs SonarQube on-premise, the same token-based integration works. When connecting, select SonarQube (self-hosted) and enter your SonarQube server URL instead of the SonarCloud endpoint.
Minimum supported version: SonarQube 9.9 LTS.
Troubleshooting
No coverage data showing: Ensure your CI pipeline is uploading analysis results to SonarCloud after each build. Koalr reads from the SonarCloud API — if analysis isn't running in CI, there's nothing to sync.
Quality gate status shows "Unknown": This means no analysis has run since Koalr connected. Trigger a CI run to populate the first analysis.