test(coverage): widen branch buffer and add CI coverage-gate guidance - #376
Merged
Merged
Conversation
Implements JSONbored#84. The 97% global threshold (vitest.config.ts) and the 97% gate / 98% local-target guidance (CONTRIBUTING.md + PR template) are already in place; this widens the branch-coverage buffer above the gate and makes coverage failures self-explanatory in CI. - ci.yml: add a 'Coverage gate guidance' step (runs only when the coverage step fails) that points contributors at the per-file table, the 97% gate, the local 'npm run test:coverage' workflow, and the CONTRIBUTING coverage section. - settings-preview: cover real reachable branches — a generic needs-attention summary when health is degraded with no missing permission/event, and a qualifies-but-no-output sample that keeps install scope read-only and lists no public output (requiredInstallPermissions / activeMissingPermissions / publicOutputsFor / publicOutputSummary fallbacks). - pending-pr-scenarios: regression tests for timed-out checks blocking merge readiness and stale approved PRs counting as pending closes with a correct post-cleanup open-count projection. Global branch coverage 97.02% -> 97.09% (9671/9960); lines 99.65%, statements 99.08%, functions 98.43%. No snapshot or changelog files are modified.
JSONbored
approved these changes
Jun 4, 2026
JSONbored
left a comment
Owner
There was a problem hiding this comment.
@web-dev0521 this is fine to merge.
A few notes:
- The guidance only appears when coverage fails, which keeps the normal CI path clean.
- The widened branch-buffer tests are a useful guard around the failure mode this is addressing.
- No code changes requested.
Validation expected:
- Keep the current green CI run.
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
vitest.config.ts) and the 97%-gate/98%-local-target guidance (CONTRIBUTING.md+ PR template) are already in place onmain; this PR widens the branch-coverage buffer above the gate and makes coverage failures self-explanatory in CI.npm run test:coverageworkflow, and the CONTRIBUTING coverage section.Scope
CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlint— clean (rangithub-actionlint .github/workflows/ci.ymldirectly; the npm script's glob is a Windows-only shell limitation)npm run typecheck— cleannpm run test:coveragelocally — 959 pass (1 skipped); branch 97.09%, lines 99.65%, statements 99.08%, functions 98.43% (the 3 pre-existing Windows-only spawn failuresmcp-cli,github-type-label,mcp-releasewere excluded locally and are unaffected)npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
mcp-cli/mcp-release/type-labeltooling unrelated to this change.Safety
Notes
ci.ymlstep usesif: ${{ failure() && steps.coverage.conclusion == 'failure' }}so it only fires for coverage failures (not typecheck/lint), emitting a::error::with the 97% policy, where to find the per-file table, the local repro command, and the CONTRIBUTING reference.settings-preview: a generic needs-attention summary when install health is degraded with no missing permission/event; a qualifies-but-no-public-output sample that keeps install scope read-only (metadata: read,pull_requests: read) and lists no public output (requiredInstallPermissions/activeMissingPermissions/publicOutputsFor/publicOutputSummaryfallbacks).pending-pr-scenarios: regression tests for timed-out checks blocking merge readiness and stale approved PRs counting as pending closes with a correct post-cleanup open-count projection.test:coveragepasses at ≥97% for all four metrics with branch headroom; the template/guidance already state the policy; the test run modifies no snapshot or generated changelog files (verified viagit status— only the three intended files changed).routes.ts/repositories.ts; per the issue ("targeted tests around existing behavior rather than inflating coverage"), those are left for incremental follow-up rather than padded here.