Support multiple named coverage categories per project#55
Merged
Conversation
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>
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
categorydimension so one project can track several independently-trended report series (e.g. "backend", "frontend") instead of a single series overwriting itself per commit — motivated bycoverage-trackeritself having a backend Vitest suite and a Playwright frontend suite with nowhere to post separately.coverage_runsgainscategory(unique index widened toproject_id, category, commit_sha);coverage_daily's primary key becomes(project_id, category, day). Rollup cron partitions by category. All read helpers default tocategory = 'default', so every existing single-category caller is unaffected.GET /api/projects/:owner/:repo/metrics/categoriesendpoint groups trend data by category (also doubles as category discovery — no registry table needed).categoryinput, 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).Buffer<ArrayBufferLike>mock-type mismatch).Test plan
npm run db:migrate:localapplies cleanlynpm test— 102/102 backend tests pass.github/actions/report:npm run typecheckandnpm test— 103/103 tests passdashboard:npm run typecheckcleanwrangler deploy --dry-runvalidates cleanly/metrics/categoriesquery confirmed two categories return correctly grouped, independent trend datadashboard/tests/project-detail.spec.ts, new): confirms two category charts render stacked vertically with correct independent values in a real browserOut of scope (follow-up): wiring
category: backend/category: frontendinto this repo's own.github/workflows/ci.yml, and adding a real frontend-unit-test-coverage job.🤖 Generated with Claude Code