ci(test): coverage report with soft targets posted as sticky PR comment #110
Labels
No labels
area:auth
area:ci
area:db
area:infra
area:native
area:pwa
area:service
epic
feature
foundation
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
james/carol#110
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Carol has 225 tests against a layered codebase but no coverage instrumentation. Two recurring questions can't be answered:
Both want surfacing on the PR itself, not in a separate dashboard, mirroring the ADR-0016 sticky-scanner-comment pattern.
Scope
@vitest/coverage-v8as a dev dep. Verify no new lavamoat allowscripts entries are needed.test:coveragenpm script.vitest.config.tscoverage block:v8provider;text-summary+json-summary+jsonreporters;include: ["app/**", "lib/**", "db/**"]; explicit excludes for UI (page.tsx, *-client.tsx, components/, sw, manifest, etc.), pure types (db/entities, db/schema, db/index), andlib/query/**(browser-only).scripts/ci/coverage-report.mjs: readscoverage/coverage-final.json(istanbul format) +git diff origin/<base>...HEAD, computes overall + patch coverage, emits a Markdown body. Strict source filter (regex) mirrors the vitest exclude list and is canonical.scripts/ci/post-coverage-comment.mjs: Forgejo upsert with marker<!-- coverage-comment -->. Mirrorpost-pr-comment.mjshelpers; no shared lib today (YAGNI; refactor if a third sticky-comment use case appears).coveragejob in.forgejo/workflows/pr.yml. SQLite only (engine-independent).fetch-depth: 0for the diff.actionlintclean. Never blocks the workflow.docs/ci.mdCoverage section under the sticky-comments section.CLAUDE.md"Working in this repo" note (one paragraph; cross-reference ADR-0018).coverage/to.gitignore(already there) andeslint.config.mjsignores (auto-generated HTML/JS files trigger lint).Out of scope
npm run buildor browser-driven E2E tests. CLAUDE.md keeps UI browser-tested by hand.Acceptance
⚠️ below 80%line in the sticky comment but the workflow still completes successfully.no testable lines changedwith the overall numbers as confirmation.Patch coverage: ~90% ✅and per-file table.