ci: single-leg coverage and cached utoo package store#6006
Conversation
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe CI workflow adds utoo package store caching with ChangesCI Cache and Coverage Matrix
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying egg with
|
| Latest commit: |
46e83bb
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://0ac94a39.egg-cci.pages.dev |
| Branch Preview URL: | https://feat-ci-single-leg-coverage.egg-cci.pages.dev |
Deploying egg-v3 with
|
| Latest commit: |
46e83bb
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://84664ac8.egg-v3.pages.dev |
| Branch Preview URL: | https://feat-ci-single-leg-coverage.egg-v3.pages.dev |
f9d7f50 to
a39c3be
Compare
|
Dependency limit exceeded — report not shown. This pull request scan exceeded the 10,000-dependency limit applied to this scan, so the results are incomplete and may be inaccurate. To avoid reporting false positives, Socket has not posted a report. Upgrade your plan to raise the dependency limit and get complete reports, or view the partial scan in the dashboard. Socket is always free for open source. If this is a non-commercial open source project, contact us to request a free Team account. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## next #6006 +/- ##
==========================================
- Coverage 82.85% 81.99% -0.87%
==========================================
Files 676 676
Lines 20522 20522
Branches 4060 4060
==========================================
- Hits 17004 16826 -178
- Misses 3040 3189 +149
- Partials 478 507 +29 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Two independent levers to cut CI wall time without adding matrix jobs.
Task A — collect coverage on one matrix leg only:
- add a `coverage` matrix axis (default false) and enable it on a single
ubuntu/node-24 leg via include; an explicit exclude of the base
ubuntu/24/coverage:false combo is required because `include` cannot
overwrite an existing matrix dimension and would otherwise *duplicate*
the ubuntu/24 leg (7 legs instead of 6).
- split "Run tests" into two guarded steps: `ut run ci` (with --coverage)
on the coverage leg, `ut run test` on the other 5. Both reach the same
pretest prep (clean-dist + workspace pretest); only --coverage differs.
- gate the codecov upload on `matrix.coverage` instead of OS, so exactly
one leg uploads. Applied to test, test-egg-bin and test-egg-scripts.
Leg counts are unchanged (6 / 2 / 2); the `done` gate is unaffected.
Task B — cache the utoo package download store:
- `ut install --from pnpm` clones from a content-addressable store
(default `$HOME/.cache/nm`, redirectable via `UTOO_CACHE_DIR`). Pin it
to `${{ runner.temp }}/utoo-store` for a deterministic cross-OS path and
restore/save it with actions/cache before install in every installing
job (typecheck, test, test-egg-bin, test-egg-scripts).
- the repo commits no lockfile (versions live in pnpm-workspace.yaml's
catalog + package.json files), so the cache key hashes those rather than
a non-existent pnpm-lock.yaml; restore-keys fall back to the latest
per-OS store so it warms even on a key miss.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
a39c3be to
46e83bb
Compare
Motivation
Cut CI wall time on the 3-OS × 2-Node
testmatrix without adding matrix jobs (sharding is intentionally out of scope — it multiplies jobs and queues the runner pool at this repo's PR volume). Two independent, low-risk levers.Task A — collect coverage on one matrix leg only
ut run ci(=ut run test -- --coverage) ran v8 coverage on all 6 legs, but codecov only needs one upload. Coverage adds ~10–30% per-leg overhead.coveragematrix axis (defaultfalse), enabled on a single ubuntu/node-24 leg.ut run ci(with--coverage) on the coverage leg,ut run teston the other 5. Both reach the samepretestprep (clean-dist+ workspace pretest); only--coveragediffers. (ut run cionly reachesclean-distvia its nestedut run test, so droppingcifortestkeeps the prep identical.)matrix.coverage(wasmatrix.os != 'windows-latest'), so exactly one leg uploads. Applied totest,test-egg-bin, andtest-egg-scripts.Note
excludeis required, not justinclude. GitHub'sincludecannot overwrite an existing matrix dimension. Withcoverage: [false]in the base,include: { coverage: true }would create a separateubuntu/24leg → 7 legs, ubuntu/24 run twice. The addedexcludeof the baseubuntu/24/coverage:falsecombo makes the coverage leg replace it. Leg counts stay 6 / 2 / 2; thedonegate is unaffected.Task B — cache the utoo package download store
Verified where
ut install --from pnpmactually reads from before caching:$HOME/.cache/nm/<pkg>/<version>/(default), redirectable via theUTOO_CACHE_DIRenv var (both confirmed empirically — a fresh uncached install populated exactly those dirs; warm installs reportcloned, notdownloaded). Not a no-op.${{ runner.temp }}/utoo-store(deterministic, identical expression inenvand the cachepath, outside the checkout) and wraput installwithactions/cachein every installing job (typecheck,test,test-egg-bin,test-egg-scripts).Note
Cache key deviates from a lockfile hash. This repo commits no lockfile — dependency versions live in
pnpm-workspace.yaml's catalog + thepackage.jsonfiles (utoo generates an uncommittedpackage-lock.jsonat install time).hashFiles('**/pnpm-lock.yaml')would be empty → a constant key that never re-saves the growing store. The key hashespnpm-workspace.yaml+**/package.jsoninstead, withrestore-keys: pkgstore-<os>-falling back to the latest per-OS store on a key miss.Per repo convention, every action is pinned by commit SHA (
actions/cache@0057852…= v4.3.0).Test evidence
actionlintpasses on the workflow.Before/after timings — to fill in from this PR's first runs
These require real CI runs and will be added once the workflow executes here:
testlegs: duration vs.nextbaseline (Task A).ut installstep duration vs. cold (Task B); cache hit-rate visible in the Actions cache UI.🤖 Generated with Claude Code
Summary by CodeRabbit