Skip to content

✅ Enforce 80% diff coverage - #92

Merged
Vivekyy merged 2 commits into
mainfrom
Vivekyy/enforce-80-newline-coverage
Jul 30, 2026
Merged

✅ Enforce 80% diff coverage#92
Vivekyy merged 2 commits into
mainfrom
Vivekyy/enforce-80-newline-coverage

Conversation

@Vivekyy

@Vivekyy Vivekyy commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Enforces an 80% diff line-coverage threshold in npm test using c8-generated LCOV and diff-cover against origin/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, and npm run build.


Open in Stage

Greptile Summary

This PR adds diff-coverage enforcement to the test lifecycle.

  • Instruments authored TypeScript and skill scripts with c8 and emits LCOV.
  • Requires at least 80% coverage of changed lines through diff-cover.
  • Fetches full Git history in the test workflow and adds the required development dependencies.

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/main ref, and the same command is invoked during package publication.

Files Needing Attention: package.json

Important Files Changed

Filename Overview
package.json Adds c8 configuration and an 80% diff-coverage gate, but makes the standard test lifecycle depend unconditionally on the origin/main Git ref.
.github/workflows/test.yml Changes checkout to fetch full history so CI can perform the Git comparison.
package-lock.json Locks the new c8 and diff-cover development dependency trees.

Fix All in Cursor Fix All in Conductor

Reviews (1): Last reviewed commit: "✅ Enforce 80% diff coverage" | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

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>
@ghost

ghost commented Jul 30, 2026

Copy link
Copy Markdown

Ready to review this PR? Stage has broken it down into 4 individual chapters for you:

Title
1 Configure coverage tools and scripts
2 Enable full history for Git comparison
3 Integrate coverage enforcement into CI workflows
4 Other changes
Open in Stage

Chapters generated by Stage for commit 8acaff3 on Jul 30, 2026 3:26pm UTC.

@github-actions

Copy link
Copy Markdown

📦 No plugin release on merge

The plugin package, tag, and GitHub Release already exist for 0.1.3.
Bump package.json to release a new plugin version.

Comment thread package.json Outdated
"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",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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.

Fix in Cursor Fix in Conductor

Co-authored-by: Codex Agent <codex-agent@openai.com>
@Vivekyy
Vivekyy merged commit 92cae62 into main Jul 30, 2026
3 checks passed
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