1.2.0: feed measured coverage to the fallow-health report - #12
Merged
Merged
Conversation
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
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.
Summary
report --coverage <path>(orreport.coveragein.code-quality.yml; the flag wins) gives Fallow an Istanbulcoverage-final.jsonso 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,realpathcontainment, regular file + 256 MiB cap, Istanbul shape check (path/s/f/fnMap),--coverage-rootderived by scoring ancestor prefixes over the sampled keys (order independent, longest prefix wins ties).--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).quality.yml: opt-inreportandcoverage-artifactinputs;Validate coverage artifactbeforeCheck;Download coverage,Report,Upload quality reportsgated on step outcomes.report.coverageis kept out ofconfigHash;checkuntouched.scripts/integration.ts:ts-project report --coveragerow against a committed Istanbul fixture assertingistanbul_files_matched >= 1.Test plan
checkPASSnode scripts/integration.tsagainst the branch image: 14/14 rows ok includingreport --coverage/home/runner/work/...prefix, dir-form via config, absolute/missing/raw-V8 → exit 1, unmatched → notice + exit 0v1.2.0, approve the staged npm version