Skip to content

Support multiple named coverage categories per project#55

Merged
tbjers merged 1 commit into
mainfrom
feat/multi-category-coverage
Jul 7, 2026
Merged

Support multiple named coverage categories per project#55
tbjers merged 1 commit into
mainfrom
feat/multi-category-coverage

Conversation

@tbjers

@tbjers tbjers commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a category dimension so one project can track several independently-trended report series (e.g. "backend", "frontend") instead of a single series overwriting itself per commit — motivated by coverage-tracker itself having a backend Vitest suite and a Playwright frontend suite with nowhere to post separately.
  • Schema: coverage_runs gains category (unique index widened to project_id, category, commit_sha); coverage_daily's primary key becomes (project_id, category, day). Rollup cron partitions by category. All read helpers default to category = 'default', so every existing single-category caller is unaffected.
  • New GET /api/projects/:owner/:repo/metrics/categories endpoint groups trend data by category (also doubles as category discovery — no registry table needed).
  • Dashboard renders one full-width chart per category, stacked vertically, under whichever metric tab is active.
  • The reporting GitHub Action gets an optional category input, threaded into ingest and the PR baseline check (fixes a latent bug: without this, a non-default-category PR would silently compare against the wrong baseline).
  • Fixed a pre-existing, unrelated typecheck error in the Action's test suite (Buffer<ArrayBufferLike> mock-type mismatch).

Test plan

  • npm run db:migrate:local applies cleanly
  • npm test — 102/102 backend tests pass
  • .github/actions/report: npm run typecheck and npm test — 103/103 tests pass
  • dashboard: npm run typecheck clean
  • wrangler deploy --dry-run validates cleanly
  • Manual local ingest + /metrics/categories query confirmed two categories return correctly grouped, independent trend data
  • Playwright (dashboard/tests/project-detail.spec.ts, new): confirms two category charts render stacked vertically with correct independent values in a real browser
  • Playwright a11y: no WCAG 2.0 AA violations on the new two-category markup; existing a11y suite still passes

Out of scope (follow-up): wiring category: backend/category: frontend into this repo's own .github/workflows/ci.yml, and adding a real frontend-unit-test-coverage job.

🤖 Generated with Claude Code

Lets one project track several independently-trended report series (e.g.
"backend" and "frontend") instead of a single series per commit, so repos
with multiple test suites/frameworks get separate coverage/complexity/
duplication history instead of one overwriting the other. Adds a `category`
column to coverage_runs/coverage_daily, a grouped trend endpoint, a
stacked-chart dashboard view (one chart per category), and an optional
`category` input on the reporting GitHub Action. Defaults to "default"
everywhere so existing single-category callers are unaffected.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@tbjers
tbjers merged commit 03905be into main Jul 7, 2026
7 checks passed
@tbjers
tbjers deleted the feat/multi-category-coverage branch July 7, 2026 00:55
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