perf(ci): Vite deps cache + per-suite e2e sharding - #59
Conversation
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
📝 WalkthroughWalkthroughAdds a Suggested reviewers
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityVerdict: Needs human review 1 blocking correctness issue found. You can customize Macroscope's approvability policy. Learn more. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/ci-e2e.yml (1)
155-162: 💤 Low valueCache implementation looks good; consider dynamic paths for future-proofing.
The cache step is correctly placed and configured. However, the hardcoded paths (
frontend/node_modules/.vite,frontend-book/node_modules/.vite) differ from the dynamic suite discovery pattern used at lines 70-73. If a newfrontend*/directory is added in the future, it won't benefit from Vite caching until these paths are updated.This is a minor maintainability consideration rather than a functional issue, since the current structure is stable and the cache will work correctly as-is.
♻️ Optional: generate cache paths dynamically
You could align with the suite discovery logic by generating paths dynamically, though this adds complexity for marginal benefit:
- name: Prepare Vite cache paths id: vite-paths run: | paths=() for dir in frontend*/; do [ -d "$dir" ] || continue paths+=("${dir}node_modules/.vite") done # Convert to multiline string for cache action printf 'paths<<EOF\n' >> "$GITHUB_OUTPUT" printf '%s\n' "${paths[@]}" >> "$GITHUB_OUTPUT" printf 'EOF\n' >> "$GITHUB_OUTPUT" - name: Cache Vite pre-bundled deps uses: actions/cache@v5 with: path: ${{ steps.vite-paths.outputs.paths }} key: vite-deps-${{ runner.os }}-${{ hashFiles('frontend*/pnpm-lock.yaml', 'frontend*/vite.config.ts') }} restore-keys: vite-deps-${{ runner.os }}-
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 4ba9b902-74f9-461f-8fb9-dd2927f334b6
📒 Files selected for processing (1)
.github/workflows/ci-e2e.yml
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Dismissing prior approval to re-evaluate fa4307c
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Adds two improvements to
ci-e2e.yml:Vite pre-bundled deps cache — persists
frontend*/node_modules/.viteacross runs usingactions/cache@v5, keyed on lockfile +vite.config.ts. Saves ~3–5s per Vite instance on warm runs (two instances per shard). The path uses a glob so no frontend dir names are hardcoded in this repo. Vite self-invalidates via_metadata.jsonif anything sneaks past the key.Per-suite shard counts — adds an
e2e_suite_shardsstring input (JSON map, default'{}') that lets consumers set different shard counts per suite, e.g.'{"frontend": 3, "frontend-book": 2}'. Falls back to the existinge2e_shardsfor any suite not listed, so all existing callers are unaffected. The discover job now builds an explicit{suite, shard, shard_total}include-list instead of a cross-product matrix, which also removes the previous hard cap of 4 shards.🤖 Generated with Claude Code
Note
Add per-suite e2e sharding and Vite dependency caching to CI
e2e_suite_shardsinput (JSON string) mapping suite names to individual shard counts, replacing the single global shard count.discoverjob builds a flat matrix of{suite, shard, shard_total}objects, one entry per shard per suite, so each suite can run with a different number of shards.--shard={matrix.shard}/{matrix.shard_total}using the per-suite value, removing the previous cap of 4 shards.actions/cache@v5step to cachefrontend*/node_modules/.vitekeyed on the pnpm lockfile andvite.config.ts, avoiding redundant Vite pre-bundling across runs.suites/shards/shard_totalmatrix outputs will need to update to the new singlematrixoutput.Macroscope summarized 292b628.
Summary by CodeRabbit
New Features
Chores