Speed up PR builder with pnpm/turbo caching, job consolidation, and parallel E2E workers - #4269
Conversation
📝 WalkthroughWalkthroughThe PR updates pnpm and Turbo caching, adds consolidated documentation and PowerShell preflight detection, and simplifies build, test, integration, and E2E workflow dependencies and conditions. ChangesCI workflow execution
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related issues
Possibly related PRs
Suggested reviewers: 🚥 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 |
There was a problem hiding this comment.
Pull request overview
This PR reduces PR Builder wall-clock time and runner-queue pressure by improving dependency caching, consolidating “fast gate” checks into fewer jobs, and parallelizing Playwright E2E execution while isolating globally stateful specs.
Changes:
- Fix pnpm store caching by installing pnpm first and enabling
actions/setup-node’scache: pnpmvia thesetup-pnpmcomposite action. - Consolidate security audit / dependency review / docs & PowerShell change detection into a single “Preflight Checks” workflow job; remove
detect-code-changesgating. - Increase default Playwright E2E workers (1 → 4) and split two stateful specs into a serial project chain, while keeping the rest parallel-safe.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
tests/e2e/playwright.config.ts |
Adds parallel E2E execution with worker count env control and isolates two state-mutating specs into a serial dependency chain. |
tests/e2e/package.json |
Updates per-browser Playwright scripts to include the new serial projects. |
.github/workflows/pr-builder.yml |
Consolidates jobs into preflight, adds Turbo cache to lint, switches E2E to the shared pnpm setup action, and raises default Playwright workers to 4. |
.github/actions/setup-pnpm/action.yml |
Corrects pnpm caching by enabling cache: pnpm through actions/setup-node after pnpm is installed. |
d36a146 to
35fa540
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/pr-builder.yml:
- Around line 43-44: Update both touched actions/checkout steps in the preflight
and test-e2e jobs to set persist-credentials to false, preserving their existing
checkout refs and other configuration.
In `@tests/e2e/playwright.config.ts`:
- Around line 58-86: Update the serialProjects dependency chain so
chromium-serial-cors starts only after at least one main browser project
completes, creating a barrier after setup and before serial state-mutation specs
run. Preserve the existing ordering among serial projects and ensure all
non-serial browser projects cannot overlap the serial chain.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 640e8745-2e5c-40b3-94f1-760aca13216f
📒 Files selected for processing (4)
.github/actions/setup-pnpm/action.yml.github/workflows/pr-builder.ymltests/e2e/package.jsontests/e2e/playwright.config.ts
35fa540 to
51c6d11
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
tests/e2e/package.json:12
- These scripts rely on
--project="<name>*"matching multiple Playwright project names. This is less portable and can fail if the Playwright CLI treats--projectas an exact name match. Since the new serial projects have stable explicit names, it’s safer to enumerate the needed projects explicitly (main browser project + the last serial project, which pulls earlier serial specs via dependencies).
"test:chromium": "playwright test --project=\"chromium*\"",
"test:firefox": "playwright test --project=\"firefox*\"",
"test:webkit": "playwright test --project=\"webkit*\"",
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (2)
.github/workflows/pr-builder.yml:68
- This step now uses the setup-pnpm composite action, but it no longer passes the workflow’s PNPM_VERSION. That makes the PNPM_VERSION env knob ineffective for this job and can lead to pnpm version drift across jobs if the env value is later pinned.
This issue also appears on line 605 of the same file.
- name: ⚙️ Set up Node.js and pnpm
uses: ./.github/actions/setup-pnpm
with:
node-version: ${{ env.NODE_VERSION }}
.github/workflows/pr-builder.yml:609
- The E2E job switched to the setup-pnpm composite action, but it no longer passes PNPM_VERSION from the workflow env. If PNPM_VERSION is intended to control/pin pnpm across CI jobs, pass it through here as well so the E2E job stays consistent.
- name: ⚙️ Set up Node.js and pnpm
uses: ./.github/actions/setup-pnpm
with:
node-version: ${{ env.NODE_VERSION }}
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
51c6d11 to
2cb8fa2
Compare
6b3d61b to
d7f0495
Compare
…and a cached lint build Refs thunder-id#4268
9f1745a
d7f0495 to
9f1745a
Compare
Purpose
Cut PR Builder wall-clock time and runner queue pressure. Phase 1 of #4268.
Scope note: this PR originally also parallelized the Playwright E2E suite and raised the worker count; that work has since landed on main independently (via
078ba2031), so this PR now carries only the remaining, complementary changes.Approach
pnpm store caching (was broken). The
setup-pnpmcomposite action passedcache_dependency_pathtopnpm/action-setup, which ignores it, so no job using the composite ever cached the pnpm store and every install cost ~2 min. The action now installs pnpm first, then runssetup-nodewithcache: pnpm. Benefits every job that uses the composite (preflight, verify-mocks, lint, build, gate/console tests, build_samples, build-docs) plus the other workflows that consume it.Gate-job consolidation (fewer runner slots per run).
security-audit,dependency-review,detect-docs-changes, anddetect-powershell-changesare folded into a singlepreflightjob (one checkout, one runner slot, one paths-filter invocation) exposingdocs-changed/powershell-changedoutputs forbuild-docsandvalidate-windows. Same tools, same configuration, same enforcement; one required check instead of three.detect-code-changeswas hardcoded tocode=true(codecov workaround) but still burned a runner slot and gated 7 jobs behind an extra scheduling hop; it is removed and its dependents start immediately.PNPM_VERSIONenv var is removed (its last consumer went away with the containerized E2E job).Turbo cache in the lint job. Lint is the only frontend-building job without
setup-turbo-cache, so its pre-lint frontend build runs cold (~4 min vs ~1 min cached). The build itself must stay because linting is type-aware and resolves@thunderid/*types from builtdist/output, but it is now cached.🔒 Security Audit,🔎 Dependency Review, and🔍 Detect PowerShell Changesare currently required status checks on main. They must be replaced with🛡️ Preflight Checks, or this PR (and afterwards every PR) blocks at "Expected - Waiting for status to be reported".Related Issues
Related PRs
Checklist
breaking changelabel added.Security checks