Skip to content

test: pom-skip scoping probe (do not merge)#22

Closed
joaodinissf wants to merge 4 commits into
ci/spotbugs-skipfrom
ci/spotbugs-skip-probe
Closed

test: pom-skip scoping probe (do not merge)#22
joaodinissf wants to merge 4 commits into
ci/spotbugs-skipfrom
ci/spotbugs-skip-probe

Conversation

@joaodinissf

Copy link
Copy Markdown
Owner

Fork-internal validation of per-module spotbugs.skip scoping. One Java change in com.avaloq.tools.ddk.xtext → the scope step should scan that 1 module and skip the other 62.

Expected: scope step logs 'scanning 1 / skipping 62'; spotbugs job green, fast, valid SARIF.

🤖 Generated with Claude Code

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>
joaodinissf and others added 2 commits May 31, 2026 14:37
The lint and spotbugs jobs fall back to a restore-key prefix on a pom.xml
change; maven-verify lacked it, so any pom change gave it a hard cache miss and
a full ~/.m2 re-download. Add the same restore-keys for parity across all three
Maven jobs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
SpotBugs' per-module analysis is the spotbugs job's long pole. A PR only needs
its changed modules scanned, so a pre-step injects <spotbugs.skip>true> into
every unchanged reactor module's pom — the plugin then skips the goal, and the
per-module JVM fork, for them. The full-reactor compile is kept (a changed
module keeps its complete aux-classpath); a build/config change falls back to a
full scan. pull_request only — master/snapshot run a full scan.

-Dspotbugs.onlyAnalyze was the cleaner-looking alternative but screens too late
(after the per-module fork), ~17% vs ~88% measured; the script header documents
the migration if an upstream SpotBugs early-exit ever lands.

- .github/scripts/compute-spotbugs-skip.sh: diff -> changed modules -> inject
  skip into the unchanged ones (idempotent; build/config change -> full scan).
- verify.yml spotbugs job: fetch-depth 0 + a scope step before compile;
  -Djgit.dirtyWorkingTree=ignore because the scope step dirties poms on purpose
  and this job releases nothing (releases/maven-verify keep =error); SARIF upload
  guarded so an empty scan set (no module scanned) doesn't fail the upload.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@joaodinissf joaodinissf force-pushed the ci/spotbugs-skip-probe branch from c64a86f to 6bb0b1d Compare May 31, 2026 12:38
@joaodinissf joaodinissf force-pushed the ci/spotbugs-skip branch 5 times, most recently from 18bdcb4 to 9d79ff0 Compare July 11, 2026 13:19
@joaodinissf

Copy link
Copy Markdown
Owner Author

Closing — superseded probe from the earlier onlyAnalyze/skip experiments; the campaign landed via dsldevkit#1400/dsldevkit#1456/dsldevkit#1457.

@joaodinissf joaodinissf deleted the ci/spotbugs-skip-probe branch July 11, 2026 14:46
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