Skip to content

1.2.0: feed measured coverage to the fallow-health report - #12

Merged
Cenadros merged 1 commit into
mainfrom
feat/report-coverage
Sep 14, 2026
Merged

Cenadros merged 1 commit into
mainfrom
feat/report-coverage

Conversation

@Cenadros

Copy link
Copy Markdown
Contributor

Summary

report --coverage <path> (or report.coverage in .code-quality.yml; the flag wins) gives Fallow an Istanbul coverage-final.json so the advisory CRAP values use measured coverage instead of the 0 % estimate. The blocking gate does not change.

  • src/report/coverage.ts: repository-relative path validation, directory form, realpath containment, regular file + 256 MiB cap, Istanbul shape check (path/s/f/fnMap), --coverage-root derived by scoring ancestor prefixes over the sampled keys (order independent, longest prefix wins ties).
  • fallow-health: --coverage/--coverage-root, exit 2 accepted only with coverage, coverage: errors get an Istanbul hint, the coverage directory is excluded from Fallow scans unless it overlaps a configured path (then only the file is excluded).
  • Unmatched coverage paths → one notice, CRAP stays estimated, exit 0. Missing / malformed / raw V8 input → exit 1 before any tool runs.
  • quality.yml: opt-in report and coverage-artifact inputs; Validate coverage artifact before Check; Download coverage, Report, Upload quality reports gated on step outcomes.
  • report.coverage is kept out of configHash; check untouched.
  • scripts/integration.ts: ts-project report --coverage row against a committed Istanbul fixture asserting istanbul_files_matched >= 1.
  • Docs: README report paragraph, config row, workflow inputs and "Coverage for CRAP" (same-job and artifact patterns), quality-gate.md. Version 1.2.0.

Test plan

  • tsc, oxlint, vitest (59 files / 532 tests), build, actionlint, dogfood check PASS
  • node scripts/integration.ts against the branch image: 14/14 rows ok including report --coverage
  • launcher + branch image on a fixture copy: matched 1/1 with a /home/runner/work/... prefix, dir-form via config, absolute/missing/raw-V8 → exit 1, unmatched → notice + exit 0
  • after merge: push v1.2.0, approve the staged npm version

report --coverage <path> (or report.coverage in .code-quality.yml, flag
wins) passes an Istanbul coverage map to fallow so advisory CRAP uses
measured coverage instead of the 0% estimate.

- src/report/coverage.ts resolves the file (directory form accepted),
  enforces repository-relative paths, realpath containment, regular
  file and a 256 MiB cap, validates the Istanbul shape and derives
  --coverage-root by scoring ancestor prefixes over the sampled keys
- fallow-health accepts exit 2 with coverage and surfaces fallow's
  coverage errors with an Istanbul hint; the coverage directory is
  excluded from fallow scans without swallowing configured paths
- unmatched coverage paths print a notice and CRAP stays estimated;
  missing or malformed input still fails
- quality.yml gains opt-in report and coverage-artifact inputs with
  outcome-gated download, report and upload steps
- report.coverage stays out of the config hash; the gate is untouched
- integration row runs report --coverage against a committed fixture
@Cenadros
Cenadros requested a review from a team September 14, 2026 09:16
@Cenadros
Cenadros merged commit dc7b40a into main Sep 14, 2026
8 checks passed
@Cenadros
Cenadros deleted the feat/report-coverage branch September 14, 2026 09:19
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