fix(ci): capture review-enrichment's node:test coverage for Codecov - #6431
Closed
nghetienhiep wants to merge 1 commit into
Closed
fix(ci): capture review-enrichment's node:test coverage for Codecov#6431nghetienhiep wants to merge 1 commit into
nghetienhiep wants to merge 1 commit into
Conversation
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6431 +/- ##
==========================================
- Coverage 95.61% 93.60% -2.01%
==========================================
Files 598 671 +73
Lines 47310 67477 +20167
Branches 15056 18535 +3479
==========================================
+ Hits 45235 63162 +17927
- Misses 1291 3354 +2063
- Partials 784 961 +177
Flags with carried forward coverage won't be shown. Click here to find out more. |
nghetienhiep
force-pushed
the
fix/issue-6250
branch
from
July 16, 2026 07:40
5880c41 to
3436a88
Compare
nghetienhiep
force-pushed
the
fix/issue-6250
branch
6 times, most recently
from
July 16, 2026 08:22
711d99f to
de880ad
Compare
review-enrichment (@loopover/rees) is a standalone, non-workspace package whose node:test suite runs in CI, but none of its 83 src files reached Codecov: vitest.config.ts listed a single, unexercised file from it and nothing else, so the whole package -- including its secret-scan analyzer -- showed as unmeasured and a regression could ship past the patch gate. Re-run that suite under c8 (new rees:coverage script), remapping the built dist hits back to review-enrichment/src via the build's source maps, and upload the lcov to Codecov under a separate `rees` flag. The harvest runs from the repo root so lcov paths are review-enrichment/src/... as Codecov expects, and narrows c8's default exclude (which wrongly dropped the real flaky-test.ts analyzer) so all 83 src files are reported with no dist/test leaks. The authoritative pass/fail stays the existing uninstrumented REES test step, since c8 inflates the suite's timing-sensitive linear-time assertions; the coverage step only harvests lcov. validate-tests now also runs on rees-only changes so Codecov's after_n_builds floor is met and codecov/patch actually posts for a review-enrichment-only PR instead of the previous vacuous check. codecov.yml registers the flag and vitest.config.ts drops the stale single-file include. Closes JSONbored#6250
nghetienhiep
force-pushed
the
fix/issue-6250
branch
from
July 16, 2026 08:32
de880ad to
e0bba24
Compare
Owner
|
Causing way too much CI churn, please stop force pushing. |
3 tasks
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.
What
review-enrichment(@loopover/rees) is a standalone, non-workspace package with its ownnode:testsuite that runs in CI (npm run rees:test), yet none of its 83src/**files werevisible to Codecov. The root
vitest.config.tslisted exactly one file from it(
review-enrichment/src/analyzers/codeowners.ts) — and nothing vitest runs even imports that file,so it was reported at 0% too. Net effect: a real regression anywhere in this package (including its
secret-scan.tsanalyzer) could ship without the patch-coverage gate ever seeing it.This wires the package's genuine coverage into Codecov as a separate
reesflag, without pullingreview-enrichmentinto the root npm workspace or the vitest runner.How
rees:coveragescript (rootpackage.json) — re-runs the existingnode --testsuite underc8. The tests execute the builtdist/**/*.js, soc8remaps V8 coverage back toreview-enrichment/src/**through the build's source maps (already emitted,sourceMap+inlineSources). Run from the repo root so lcov paths arereview-enrichment/src/...— exactlywhat Codecov needs, no path rewriting.
c8's default exclude drops*-test.*/*.test.*names,which wrongly caught the real
flaky-test.tsanalyzer, so the exclude is narrowed to**/*.d.ts(test files live in
test/**, never in thedist/**include, so none leak in). Result: all 83srcfiles reported, 0dist/testleaks..github/workflows/ci.yml— aREES coveragestep (after the existing, authoritativeuninstrumented
REES ... testsstep) harvests the lcov, a verify step fails CI if it is missing,and two upload steps (trusted + fork-tokenless, mirroring the shard uploads) send it under the
reesflag.c8instrumentation inflates the suite's timing-sensitive linear-time/ReDoS-guardassertions, so the harvest tolerates the child exit — pass/fail is already gated by the
uninstrumented step, and a broken suite would show as ~0% patch regardless.
validate-testsnow also runs onrees-only changes — Codecov holdscodecov/patchuntilafter_n_builds(6) coverage uploads land; arees-only PR doesn't otherwise touchbackend, sowithout the shards it would upload a single report and the status would never post (the same
vacuous check being fixed). The shards guarantee the 6-upload floor; the fast
reesupload fromvalidate-codeis already merged in before the 6th shard trips the threshold.codecov.yml— registers thereesflag (scoped toreview-enrichment/,carryforward) anddocuments why
after_n_buildsstays 6.vitest.config.ts— drops the stale, unexercised single-filecoverage.includeentry.Verification
npm run rees:coverage→ 83srcfiles reported (was 0 tracked), pathsreview-enrichment/src/...,no
dist/testleaks, ~91.8% lines / 86.5% branches.DA:line,0misses in the lcov, so an untested branch in areview-enrichment/src/**change now produces a genuinecodecov/patchshortfall instead of theprevious no-op.
npm --prefix review-enrichment test(authoritative correctness gate) → 1335 pass, 0 fail.npm run actionlint,npm run typecheck,test/unit/codecov-policy.test.ts(+ the otherCI-policy unit tests),
npm ci --prefix review-enrichment, andnpm audit --audit-level=moderate(0 vulnerabilities) all green;
git diff --checkclean.Closes #6250