Skip to content

Speed up PR builder with pnpm/turbo caching, job consolidation, and parallel E2E workers - #4269

Merged
DonOmalVindula merged 1 commit into
thunder-id:mainfrom
DonOmalVindula:ci/pr-builder-speedup
Jul 27, 2026
Merged

Speed up PR builder with pnpm/turbo caching, job consolidation, and parallel E2E workers#4269
DonOmalVindula merged 1 commit into
thunder-id:mainfrom
DonOmalVindula:ci/pr-builder-speedup

Conversation

@DonOmalVindula

@DonOmalVindula DonOmalVindula commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

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-pnpm composite action passed cache_dependency_path to pnpm/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 runs setup-node with cache: 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, and detect-powershell-changes are folded into a single preflight job (one checkout, one runner slot, one paths-filter invocation) exposing docs-changed / powershell-changed outputs for build-docs and validate-windows. Same tools, same configuration, same enforcement; one required check instead of three.
  • detect-code-changes was hardcoded to code=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.
  • The orphaned PNPM_VERSION env 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 built dist/ output, but it is now cached.

⚠️ Required-checks settings (admin action needed before merge): 🔒 Security Audit, 🔎 Dependency Review, and 🔍 Detect PowerShell Changes are 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

  • Followed the contribution guidelines.
  • Manual test round performed and verified.
  • Documentation provided. (Add links if there are any)
    • Ran Vale and fixed all errors and warnings
  • Tests provided. (Add links if there are any)
    • Unit Tests
    • Integration Tests
  • Breaking changes. (Fill if applicable)
    • Breaking changes section filled.
    • breaking change label added.

Security checks

  • Followed secure coding standards in WSO2 Secure Coding Guidelines
  • Confirmed that this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.

Copilot AI review requested due to automatic review settings July 23, 2026 05:48
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR updates pnpm and Turbo caching, adds consolidated documentation and PowerShell preflight detection, and simplifies build, test, integration, and E2E workflow dependencies and conditions.

Changes

CI workflow execution

Layer / File(s) Summary
Workflow setup and caching
.github/actions/setup-pnpm/action.yml, .github/workflows/pr-builder.yml
pnpm is installed before Node setup for pnpm cache discovery, and linting initializes Turbo caching.
Preflight and job gating
.github/workflows/pr-builder.yml
A preflight job exports documentation and PowerShell change outputs; downstream jobs remove legacy change-detection dependencies and use simplified conditions, including an E2E worker fallback of 6.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers: brionmario, madurangasiriwardena

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title accurately summarizes the main CI performance changes: caching, job consolidation, and E2E worker-related updates.
Description check ✅ Passed The description follows the template with Purpose, Approach, Related Issues/PRs, Checklist, and Security checks, and is sufficiently detailed.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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’s cache: pnpm via the setup-pnpm composite action.
  • Consolidate security audit / dependency review / docs & PowerShell change detection into a single “Preflight Checks” workflow job; remove detect-code-changes gating.
  • 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.

Comment thread tests/e2e/playwright.config.ts Outdated
Comment thread tests/e2e/package.json Outdated
Copilot AI review requested due to automatic review settings July 23, 2026 06:08
@DonOmalVindula
DonOmalVindula force-pushed the ci/pr-builder-speedup branch 2 times, most recently from d36a146 to 35fa540 Compare July 23, 2026 06:11

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 88313f8 and d36a146.

📒 Files selected for processing (4)
  • .github/actions/setup-pnpm/action.yml
  • .github/workflows/pr-builder.yml
  • tests/e2e/package.json
  • tests/e2e/playwright.config.ts

Comment thread .github/workflows/pr-builder.yml
Comment thread tests/e2e/playwright.config.ts Outdated
@DonOmalVindula
DonOmalVindula force-pushed the ci/pr-builder-speedup branch from 35fa540 to 51c6d11 Compare July 23, 2026 06:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 --project as 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*\"",

Comment thread tests/e2e/playwright.config.ts Outdated
Copilot AI review requested due to automatic review settings July 23, 2026 06:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

brionmario
brionmario previously approved these changes Jul 23, 2026
@DonOmalVindula
DonOmalVindula enabled auto-merge July 23, 2026 09:03
Copilot AI review requested due to automatic review settings July 23, 2026 09:58
@DonOmalVindula
DonOmalVindula force-pushed the ci/pr-builder-speedup branch from 51c6d11 to 2cb8fa2 Compare July 23, 2026 09:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@DonOmalVindula DonOmalVindula added the trigger-pr-builder Add when the PR is ready for CI; starts the PR Builder for this and all later pushes label Jul 23, 2026
@DonOmalVindula
DonOmalVindula force-pushed the ci/pr-builder-speedup branch 2 times, most recently from 6b3d61b to d7f0495 Compare July 24, 2026 08:19
brionmario
brionmario previously approved these changes Jul 24, 2026
@DonOmalVindula
DonOmalVindula added this pull request to the merge queue Jul 27, 2026
Merged via the queue into thunder-id:main with commit f1eac8d Jul 27, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

trigger-pr-builder Add when the PR is ready for CI; starts the PR Builder for this and all later pushes Type/Improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants