✅ Enforce 80% diff coverage - #92
Merged
Merged
Conversation
Generate LCOV for authored source files and fail test runs when changed-line coverage against main falls below 80%. Co-authored-by: Codex Agent <codex@openai.com>
|
Ready to review this PR? Stage has broken it down into 4 individual chapters for you:
Chapters generated by Stage for commit 8acaff3 on Jul 30, 2026 3:26pm UTC. |
📦 No plugin release on mergeThe plugin package, tag, and GitHub Release already exist for |
| "build": "rm -rf dist && esbuild bin/rudder-prompt-hook.ts --bundle --platform=node --format=esm --target=node24 --outfile=dist/rudder-prompt-hook.mjs && cp -R drizzle dist/drizzle", | ||
| "pretest": "npm run build", | ||
| "test": "node --test", | ||
| "test": "c8 node --test && diff-cover coverage/lcov.info --fail-under=80 --show-uncovered --include-untracked", |
There was a problem hiding this comment.
Test command requires origin/main
When npm test runs from a checkout without an origin/main ref, the unconditional diff-cover comparison cannot resolve its default base branch, causing otherwise successful tests and coverage collection to exit unsuccessfully; prepublishOnly inherits the same Git-remote requirement.
Co-authored-by: Codex Agent <codex-agent@openai.com>
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.
Enforces an 80% diff line-coverage threshold in
npm testusing c8-generated LCOV and diff-cover againstorigin/main.Coverage includes authored
bin,src, and skill scripts while excluding generated output and tests, and reports uncovered changed lines.CI now fetches full Git history so the comparison is available.
Validation:
npm run typecheck,npm test, andnpm run build.Greptile Summary
This PR adds diff-coverage enforcement to the test lifecycle.
Confidence Score: 4/5
The Git-ref dependency in the standard test and publication lifecycle should be addressed before merging.
The new test command fails after otherwise successful tests whenever the checkout does not expose an
origin/mainref, and the same command is invoked during package publication.Files Needing Attention: package.json
Important Files Changed
origin/mainGit ref.Reviews (1): Last reviewed commit: "✅ Enforce 80% diff coverage" | Re-trigger Greptile