ci: fast static analysis with early-fail lint + inline SARIF (PMD/Checkstyle/SpotBugs)#1396
Draft
joaodinissf wants to merge 1 commit into
Draft
ci: fast static analysis with early-fail lint + inline SARIF (PMD/Checkstyle/SpotBugs)#1396joaodinissf wants to merge 1 commit into
joaodinissf wants to merge 1 commit into
Conversation
Replace the pmd/checkstyle jobs with a parallel shape that gives early,
inline feedback and stops re-running analysis inside the build:
- lint: compile + pmd:pmd + checkstyle:checkstyle (SARIF) + pmd:cpd-check,
-T 2C, --fail-never; gates by counting the merged SARIF (+ cpd.xml grep).
Fails in ~3-5 min on its own check, independent of the build.
- spotbugs: compile + spotbugs:spotbugs (SARIF), -Xmx4g, own parallel lane
(the slow analysis).
- maven-verify: build + tests only; the redundant checkstyle/pmd/spotbugs
goals are dropped (now owned by lint/spotbugs).
- line-endings: unchanged.
All three emit SARIF 2.1.0, merged per tool and uploaded to Code Scanning
(security-events: write) for inline annotations on the PR diff + Security tab.
No custom Python annotator.
Count-gate rather than the *:check goals: the check goals @Execute-fork a
second analysis and cannot emit SARIF, and without the full compile classpath
they false-positive on type-resolving rules. Each report goal runs once
(full-reactor compile -> correct + SARIF) and the gate counts the result.
Rationale + tables in docs/ci-static-analysis-design.md; measurement protocol
in docs/ci-measurement-protocol.md.
CPD gating is wired but inert until dsldevkit#1339 lowers the token threshold.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced May 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Today a single PMD or Checkstyle nit only surfaces after the ~15-minute build:
maven-verifyrunsclean verifyand re-runs every static-analysis goal on top of it. So "I forgot a semicolon" feedback arrives ~14 minutes late, and the analysis work is duplicated.What this does
Four independent parallel jobs (
verify.yml), so feedback is early and findings show up inline:lintcompile+pmd:pmd+checkstyle:checkstyle(SARIF) +pmd:cpd-check,-T 2Ccpd.xmlgrep)spotbugscompile+spotbugs:spotbugs(SARIF),-Xmx4gmaven-verifyclean verify(build + tests only)line-endingslintgoes red in ~3–5 min on its own check, independent of the build — a lint issue no longer waits behind ~14 min of build+tests.maven-verifydrops the redundant analysis goals it used to re-run.security-events: write) → inline annotations on the diff + Security tab. No custom annotator script.Why count-gate, not the
:checkgoalsThe
pmd:check/spotbugs:checkgoals@Execute-fork a second analysis and can't emit SARIF; run without the fullcompileclasspath they false-positive on type-resolving rules (e.g.InvalidLogMessageFormaton the SLF4J trailing-Throwableidiom). So each report goal runs once (full-reactorcompile→ correct results + SARIF) and the gate just counts. Full rationale, the report-vs-check tables, and the fidelity caveats are indocs/ci-static-analysis-design.md.Optimizes / trades off
compileruns once per parallel job. This is a deliberate, cheap trade here: the repo is public (CI is free) and low-activity, so we buy early + inline feedback with compute that costs nothing.Validation
lintandspotbugscorrectly went red (exact counts), and Code Scanning ingested PMD/Checkstyle/SpotBugs SARIF → annotations appeared on the PR diff + Security tab.Notes
pmd:cpd-check+<duplication>grep) but inert until chore: pmd.cpd.min set to 100000 effectively disables CPD #1339 lowers the token threshold (pmd.cpd.min=100000currently disables it) — tracked separately. CPD has no SARIF renderer, so it gates but doesn't annotate inline.pmd+checkstyle→lint+spotbugs; keepline-endings,maven-verify.docs/ci-measurement-protocol.mdfor how to gather trustworthy timing medians.Supersedes #1333 (sequential, Python) and #1337 (parallel, Python).
🤖 Generated with Claude Code