Skip to content

chore: add c8-based coverage reporting script - #397

Open
hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-coverage-reporting
Open

hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-coverage-reporting

Conversation

@hivecommons-hive

Copy link
Copy Markdown

Test Improvement

Adds a test:coverage npm script (c8 --reporter=text --reporter=lcov npm run test:unit), the c8 devDependency, and a coverage/ .gitignore entry.

Today the only coverage numbers this repo has ever produced (e.g. the 89.74% branch coverage on lib/remarkRewriteLinks/index.ts cited in #393/PR #394) came from someone running npx c8 by hand and throwing the output away. This gives a repo-tracked, one-command way to reproduce that: npm run test:coverage.

Deliberately does not add --check-coverage thresholds or wire this into CI yet — the repo's branch coverage is currently below 100% until the in-flight coverage PRs (#389, #392, #394) land, and enforcing a threshold now would ship this red. Also deliberately does not touch .github/workflows/** (that's the ceiling documented on #390); this is package.json/devDependency/.gitignore only, with no test file of its own since it is tooling configuration rather than a behavior change.

Verified locally: npm run test:coverage runs and reports text + lcov coverage for the existing 16 unit tests; npx prettier --check package.json is clean.

Related Issue

Fixes #396 (adds the coverage-reporting script and devDependency the issue asks for; nothing is left for #396 to track once this merges)


Filed by quality agent (hold-gated mode). Human review required.

— hive: agent=quality backend=copilot model=claude-opus-4-6 copilot=1.0.88

Adds a test:coverage npm script (c8 wrapping test:unit) plus the c8
devDependency and a coverage/ gitignore entry, so coverage can be
checked with one command instead of ad hoc npx c8 runs. Scoped to
package.json/.gitignore only; does not touch .github/workflows/**.

Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive

Copy link
Copy Markdown
Author

Important

Held for human review by the hive's ACMM level gate.

This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Agent PRs are held at ACMM L3–L5; an outreach PR that targets a repository this hive does not manage is held at every level because it publishes project-facing communication into someone else's project.

Hive will keep the hold label until a human removes it. Operators can make a deliberate one-off release during an ACMM level change with release_level_holds=true, but level changes never release this hold automatically.

@netlify

netlify Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cncf-techdocs ready!

Name Link
🔨 Latest commit 63bec21
🔍 Latest deploy log https://app.netlify.com/projects/cncf-techdocs/deploys/6af5630cd00a2f0a53ce5d9f
😎 Deploy Preview https://deploy-preview-397--cncf-techdocs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@hivecommons-hive

Copy link
Copy Markdown
Author
63bec21

ℹ️ Sentinel notice — informational; author is trusted (hive agent), merge is not blocked

Hive flagged this PR (author @hivecommons-hive[bot], head 63bec2173fd1) because it matches behaviors that can override security controls, escalate privileges or damage the codebase. This is a heuristic, not an accusation — a maintainer should confirm the change is intended before it merges.

  • sensitive_path — changes 2 sensitive path(s) (Touches a sensitive path (OWNERS, workflows, policies, hive config, security docs, …))
    • package-lock.json
    • package.json

Hive did not add the sentinel-alert label because this author is trusted. The finding remains recorded for audit and the dashboard Security tab; set sentinel.trusted_authors_block: true to require the blocking label for trusted authors too.

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Read the diff against main. This looks correct to me.

Verified:

  • package.json:39 — the new test:coverage script wraps the existing test:unit script (package.json:40 at base), which is present on main; c8 propagates NODE_V8_COVERAGE into the npm run child, so the node:test subprocess is instrumented.
  • package-lock.json — the additions are the standard c8/istanbul dependency tree (@bcoe/v8-coverage, @istanbuljs/schema, istanbul libs, yargs), all "dev": true; no runtime dependency change.
  • .gitignore:15 — coverage/ matches c8's default output directory.
  • Scope matches issue #396 exactly: no workflow changes, no thresholds, consistent with the PR body's stated deferral until #389/#392/#394 land.

One info-level note, not a defect: c8@12 declares engines: ^20.19.0 || ^22.12.0 || >=23, and this repo's package.json has no engines field — contributors on Node 20.x older than 20.19 will get an install warning/failure for this devDependency. Fine as-is; worth remembering if anyone hits it.

— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.88

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] No coverage-reporting script — branch/line coverage isn't tracked anywhere

0 participants