Skip to content

build(coverage): gate aggregate coverage against a non-regression ratchet#400

Merged
DemchaAV merged 1 commit into
developfrom
harden/coverage-ratchet
Jul 13, 2026
Merged

build(coverage): gate aggregate coverage against a non-regression ratchet#400
DemchaAV merged 1 commit into
developfrom
harden/coverage-ratchet

Conversation

@DemchaAV

@DemchaAV DemchaAV commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Why

The graph-compose-coverage module builds a cross-module JaCoCo aggregate report (core + render-pdf + templates, counting the graph-compose-qa cross-module exec) but enforces no threshold, so aggregate coverage could silently decline release-over-release.

What

  • Measured the current aggregate baseline: INSTRUCTION 0.87857 (89515/101887 ≈ 87.86 %), BRANCH 0.68310 (5529/8094 ≈ 68.31 %) — verified identical on Windows and CI Linux (branch byte-identical; instruction differs by 5 of ~102k).
  • Added a non-regression ratchet in coverage/pom.xml with floors coverage.min.instruction=0.875 and coverage.min.branch=0.68 — ~0.36 pp / ~0.31 pp below the baseline, only rounding/variance headroom.
  • JaCoCo has no native aggregate-check goal, so the check reproduces the aggregate inputs: maven-dependency-plugin unpacks the measured modules' classes → jacoco:merge combines the four execs → jacoco:check on the combined BUNDLE (INSTRUCTION + BRANCH covered-ratio, haltOnFailure). Same classes and execs as the existing report-aggregate, so the enforced numbers match the published report.
  • Refreshed the now-stale "report-only" comments in coverage/pom.xml and .github/workflows/ci.yml.

Enforcement is automatic: the check runs in the existing build-and-test verify step, which feeds the required CI Gate — a coverage regression fails the PR with no new CI job.

Tests

  • Full clean verify -pl :graph-compose-core,:graph-compose-render-pdf,:graph-compose-templates,:graph-compose-qa,:graph-compose-coverage -am → the aggregate check analyzes 671 classes, reports "All coverage checks have been met.", BUILD SUCCESS.
  • Gate proven to fire: jacoco:check@check-aggregate -Dcoverage.min.instruction=0.90 → BUILD FAILURE ("instructions covered ratio is 0.87, but expected minimum is 0.90"). The override was a temporary -D; nothing committed to revert.

…chet

The graph-compose-coverage module produced a cross-module JaCoCo aggregate
report but enforced no threshold, so coverage could silently decline.

Add a non-regression ratchet on the aggregate (core + render-pdf + templates,
counting the qa cross-module exec). JaCoCo has no native aggregate-check goal,
so the check reproduces the aggregate inputs: unpack the measured modules'
classes, merge their execs, and run jacoco:check on the combined BUNDLE for
INSTRUCTION and BRANCH covered-ratio. The floors (0.875 / 0.68) sit just below
the current baseline (0.87857 / 0.68310, identical on Windows and CI Linux),
leaving only rounding and cross-platform headroom. The check runs in the
existing build-and-test verify step, which feeds the required CI Gate, so a
coverage regression fails the PR with no new CI job.
@DemchaAV DemchaAV force-pushed the harden/coverage-ratchet branch from c6d8759 to 5f4efff Compare July 13, 2026 16:13
@DemchaAV DemchaAV merged commit da7d184 into develop Jul 13, 2026
12 checks passed
@DemchaAV DemchaAV deleted the harden/coverage-ratchet branch July 13, 2026 16:26
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