ci: shard package tests without weakening coverage gates - #30156
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughPackage coverage CI now runs four Vitest shards, uploads native coverage blobs as artifacts, and merges them in a dedicated ChangesPackage coverage CI
Estimated code review effort: 3 (Moderate) | ~25 minutes Merge Risk: ⚪ Minimal · up to This change parallelizes package tests while preserving the combined coverage gate and required Test status; no actionable merge-blocking risk remains after normal checks and review. Sequence Diagram(s)sequenceDiagram
participant PackageTests
participant Vitest
participant ArtifactStorage
participant Examples
participant Coverage
participant Test
PackageTests->>Vitest: run four sharded coverage tests
Vitest->>ArtifactStorage: upload native coverage blobs
Examples->>Examples: run example tests
Coverage->>ArtifactStorage: download four coverage blobs
Coverage->>Vitest: merge coverage and generate report
Test->>Coverage: require successful coverage result
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files. (1 skipped: 1 unsupported.) ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
@prisma/orm-extension-arktype-json
@prisma/orm-extension-middleware-cache
@prisma/orm-extension-paradedb
@prisma/orm-extension-pgvector
@prisma/orm-extension-postgis
@prisma/orm-extension-supabase
@prisma/orm-family-mongo
@prisma/orm-family-sql
@prisma/orm-framework
@prisma/orm-mongo
@prisma/orm-postgres
@prisma/orm-sqlite
@prisma/orm-target-mongo
@prisma/orm-target-postgres
@prisma/orm-target-sqlite
@prisma/orm-toolchain
commit: |
size-limit report 📦
|
Signed-off-by: Steven McClankerton <tatarintsev@prisma.io>
Signed-off-by: Steven McClankerton <tatarintsev@prisma.io>
Signed-off-by: Steven McClankerton <tatarintsev@prisma.io>
Signed-off-by: Steven McClankerton <tatarintsev@prisma.io>
78e3ec1 to
7c421ce
Compare
Linked issue
n/a — infrastructure change without a Linear ticket.
At a glance
Package tests now execute on four runners, while a separate
Coveragejob evaluates thresholds once against the combined native Vitest report.Test Examplesruns concurrently, and a lightweight finalTestjob preserves the required status name.Summary
The package-test portion of
Testwas the remaining serial CI bottleneck. This change shards that work horizontally while keeping one authoritative coverage gate and the existing requiredTeststatus context.Decision
This PR ships three connected CI changes:
Coveragefan-in job, merge their coverage counters with Vitest, and only then apply the existing package-level thresholds and warning policy.Testcheck name through a lightweight final gate.Reviewer notes
actions/upload-artifact;Coverageuses SHA-pinnedactions/download-artifactwithpattern: package-coverage-*andmerge-multiple: true. Both are GitHub-created actions in theactionsorganization, so the existing GitHub-actions category permits them without individual allow-list entries.include-hidden-files: truebecause Vitest writes blobs below.vitest/blob, andif-no-files-found: errorprevents a shard from silently publishing nothing.Coverageverifies the four expected files.Test; the fourPackage Tests (N/4)jobs,Coverage, andTest Examplesare implementation details behind its final result.How it fits together
vitest.config.tsrecognizes shard collection throughVITEST_COVERAGE_SHARD, keeps the full include/exclude policy, and suppresses only partial-run thresholds and coverage output..github/workflows/ci.ymlrunsvitest --coverage --reporter=blob --shard=N/4on four PostgreSQL-backed runners. Each shard still reports test failures, uploads exactly one hidden blob file, and explicitly propagates a failing outcome after the upload.Coveragedownloads allpackage-coverage-*artifacts into.vitest/bloband checks forblob-1-4.jsonthroughblob-4-4.jsonbefore doing any merge.pnpm coverage:packages:mergeinvokes Vitest's native--merge-reportspath, which combines Istanbul counters rather than averaging percentages and replays failed tests.pnpm coverage:reportattributes merged source entries to packages and enforces their thresholds.Test Examplesruns concurrently, while the finalTestjob fails if any package shard, coverage, example, or prerequisite job failed.Behavior changes & evidence
.github/workflows/ci.yml, with the expected orchestration locked byscripts/coverage-config.test.mjs.vitest.config.ts, while the native merge command is declared inpackage.jsonand existing package aggregation remains inscripts/coverage-report.mjs.scripts/coverage-config.test.mjs.docs/oss/ci-pipeline.mdand the package coverage guides.Testing performed
pnpm build— 85 tasks passedpnpm test:scripts— 498 tests passednode --test scripts/coverage-config.test.mjs scripts/coverage-report.test.mjs— 34 tests passedpnpm lint:workflowspnpm exec biome check vitest.config.ts scripts/coverage-config.test.mjs package.json turbo.jsonpnpm exec turbo run build --dry=json.github/workflows/ci.ymlwith the installedyamlpackagegit diff --checkSkill update
n/a — internal CI orchestration only; no user-facing CLI, API, configuration, error, or terminology changes.
Alternatives considered
Checklist
git commit -s) per the DCO.CONTRIBUTING.mdand the change is scoped to one logical concern.TML-NNNN: <sentence-case title>form — n/a, this infrastructure change has no Linear ticket and follows the repository's conventional-title precedent.Summary by CodeRabbit
New Features
Documentation
Chores