Skip to content

build: remove SonarQube Cloud; enforce line + branch coverage via JaCoCo#56

Merged
wolpert merged 2 commits into
mainfrom
build/remove-sonarqube
Jun 12, 2026
Merged

build: remove SonarQube Cloud; enforce line + branch coverage via JaCoCo#56
wolpert merged 2 commits into
mainfrom
build/remove-sonarqube

Conversation

@wolpert

@wolpert wolpert commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

What

Removes the SonarQube Cloud integration and replaces its one genuinely useful feature — line/branch coverage tracking — with native JaCoCo gates.

Why

SonarQube's value here was weak: its findings largely duplicate tooling already run at build time (Error Prone + JSpecify for null discipline, Spotless for formatting, per-module JaCoCo floors + Stryker mutation testing for test effectiveness). Worse, its new-code gate fired on attribution noise — e.g. editing one line of an existing file surfaced a pre-existing, idiomatic HttpResponse<?> Micronaut controller return as a "new" issue and failed the gate. Keeping it green meant littering the build with rule suppressions. Full rationale in ADR 0018.

Changes

Remove SonarQube: org.sonarqube plugin + sonar { } block, version-catalog entry, the sonar CI job, and the SonarCloud README badges. ADR 0017 marked Superseded; ADR 0018 added.

Enforce coverage natively — LINE + BRANCH, via a hybrid baseline + overrides:

  • Baseline in pkauth.test-conventions (LINE >=0.70, BRANCH >=0.55), keyed off the java-library plugin so it gates every published library module but not the examples/* demos (which apply test-conventions only for the JaCoCo report).
  • Overrides raise only what's above the baseline (Gradle enforces all rules): core/jwt/admin-api hold LINE >=0.80 (brief §11); jwt/backup-codes pin BRANCH >=0.85; otp/refresh-tokens pin BRANCH >=0.80; every other module rides the baseline.
  • Branch floors are static — set below current measured coverage to lock in today's level and fail on regression. Net -132 lines vs. the duplicated per-module gates.

Verification

  • ./gradlew clean test jacocoTestCoverageVerification runs all 13 library gates fresh and passes; standalone spotlessCheck is green.
  • Guard proven: with the central BRANCH floor forced to 0.99, pk-auth-micronaut (no override) fails while examples:spring-boot-demo still passes — the baseline gates libraries, not the demos.

(A flaky Spotless 8.x classloader error can appear when clean + full check run together — a known issue noted in CLAUDE.md, unrelated to this change.)

🤖 Generated with Claude Code

wolpert and others added 2 commits June 11, 2026 18:34
SonarQube's findings largely duplicated tooling we already run at build
time (Error Prone + JSpecify, Spotless, JaCoCo floors, mutation testing),
and its new-code gate fired on attribution noise — surfacing pre-existing,
idiomatic patterns as "new" issues and demanding suppressions that litter
the build. The one thing it added that we wanted — coverage tracked at line
and branch level — JaCoCo already does natively and offline.

- Remove the org.sonarqube plugin + sonar{} block, version-catalog entry,
  the `sonar` CI job, and the SonarCloud README badges.
- Add a BRANCH coverage limit to every module's existing
  jacocoTestCoverageVerification rule (previously LINE only). Branch floors
  are set a few points below current measured coverage to lock in today's
  level and fail on regression; line floors are unchanged.
- ADR 0018 records the decision and supersedes ADR 0017.

Verified: `clean test jacocoTestCoverageVerification` runs all 13 module
gates and passes; standalone spotlessCheck is green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the 13 duplicated per-module LINE+BRANCH gates with one baseline in
pkauth.test-conventions (LINE >=0.70, BRANCH >=0.55), keyed off the
java-library plugin so it gates every published library module but not the
examples/* demos (which apply test-conventions only for the JaCoCo report).

Modules keep an override only to raise a bar above the baseline: core/jwt/
admin-api hold the >=0.80 line bar (brief §11); jwt/backup-codes/otp/
refresh-tokens pin BRANCH near their current high coverage. Every other
module rides the baseline. Net -132 lines.

Verified: a clean `test jacocoTestCoverageVerification` passes all library
gates; with the central BRANCH floor forced to 0.99, pk-auth-micronaut (no
override) fails while examples:spring-boot-demo still passes — confirming the
baseline gates libraries and not the demos.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@wolpert
wolpert merged commit 48bc332 into main Jun 12, 2026
4 checks passed
@wolpert
wolpert deleted the build/remove-sonarqube branch June 12, 2026 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant