Skip to content

feat(ci): revive bundling and unleash 16-core test speed#25426

Open
mattKorwel wants to merge 90 commits intomainfrom
feat/ci-bundling-revamp
Open

feat(ci): revive bundling and unleash 16-core test speed#25426
mattKorwel wants to merge 90 commits intomainfrom
feat/ci-bundling-revamp

Conversation

@mattKorwel
Copy link
Copy Markdown
Collaborator

Summary

Revived bundling and CI optimization efforts. Introduced artifact-centric CI path and modernized test infrastructure to unlock 16-core performance.

Details

  • Artifact-Centric CI: Created .github/actions/setup-gemini to allow CI shards to consume a pre-built bundle instead of rebuilding from source.
  • Modernized Isolation: Switched CLI and Core test pools from forks to threads, eliminating the per-file Node.js startup penalty.
  • Incremental Builds: Integrated tsbuildinfo and dependency-ordered sequential builds from PR feat: Improve build process with dependency-ordered builds and tsbuildinfo #12389.
  • Zombie Suppression: Temporarily excluded the top 5 hanging/leaking tests to prevent CI blockage.
  • Resource Unleashed: Removed thread caps in root vitest.config.ts to utilize all 16 cores on CI runners.

Related Issues

Closes #22349

How to Validate

  • Run npm run test locally (should be significantly faster).
  • Check CI run timings for the Test (Linux) job on this branch.
  • Verify bundle/ output after npm run bundle.

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

@mattKorwel mattKorwel requested review from a team as code owners April 15, 2026 02:32
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on drastically improving CI performance and build efficiency. By modernizing the test infrastructure to support parallel execution and leveraging pre-built artifacts, the changes aim to reduce the overall CI runtime while maintaining test reliability through better isolation and resource management.

Highlights

  • CI Infrastructure Optimization: Introduced an artifact-centric CI path via a new setup action, allowing CI shards to consume pre-built bundles instead of rebuilding from source.
  • Test Performance Improvements: Migrated test pools from 'forks' to 'threads' and removed thread caps to fully utilize 16-core CI runners, significantly reducing test execution time.
  • Build System Enhancements: Integrated tsbuildinfo for faster incremental builds and enforced dependency-ordered sequential builds across workspaces.
  • Test Stability: Refactored test setup to use vi.stubEnv and improved singleton cleanup to ensure test isolation, while temporarily excluding 5 unstable tests to prevent CI blockage.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/ci-bundling-trial.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request optimizes the CI and build pipeline by transitioning Vitest to a thread-based pool, centralizing test configurations, and enabling incremental TypeScript builds. It also introduces a new GitHub Action for environment setup and refactors test utilities to use thread-safe environment stubbing. Feedback identifies a potential configuration conflict in the CLI's Vitest settings and notes that the updated build script omits several required packages, which would result in incomplete build artifacts.

Comment on lines +35 to +43
'**/node_modules/**',
'**/dist/**',
'**/cypress/**',
'**/src/ui/components/messages/ToolStickyHeaderRegression.test.tsx',
'**/src/ui/components/views/McpStatus.test.tsx',
'**/src/ui/components/messages/SubagentHistoryMessage.test.tsx',
'**/src/ui/components/BackgroundTaskDisplay.test.tsx',
'**/src/ui/auth/useAuth.test.tsx',
],
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.

high

This exclude block creates a duplicate key in the test configuration object, which overrides the existing exclude definition at line 20. This causes the **/cypress/** exclusion to be lost, potentially leading to unintended files being processed as tests. To avoid accidental overwrites and maintain a single source of truth, merge these exclusions into the existing block or use a merge operation as per repository standards.

    exclude: [
      '**/node_modules/**',
      '**/dist/**',
      '**/cypress/**',
      '**/src/ui/components/messages/ToolStickyHeaderRegression.test.tsx',
      '**/src/ui/components/views/McpStatus.test.tsx',
      '**/src/ui/components/messages/SubagentHistoryMessage.test.tsx',
      '**/src/ui/components/BackgroundTaskDisplay.test.tsx',
      '**/src/ui/auth/useAuth.test.tsx',
    ],
References
  1. When constructing an object from multiple data sources, consistently use a merge operation (e.g., spread syntax) instead of assignment to avoid accidental overwrites and order-dependent logic.

Comment thread scripts/build.js
Comment on lines +33 to +39
const workspaces = [
'@google/gemini-cli-test-utils',
'@google/gemini-cli-core',
'@google/gemini-cli-a2a-server',
'@google/gemini-cli',
'gemini-cli-vscode-ide-companion',
];
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.

high

The hardcoded workspaces array is missing several packages defined in the repository, specifically @google/gemini-cli-sdk and @google/gemini-cli-devtools. This will cause these packages to be skipped during the build process, leading to incomplete build artifacts. Furthermore, hardcoding this list is less maintainable than the previous dynamic discovery using npm query. If a specific build order is required, consider using npm query to fetch all workspaces and then applying a sort, or at least ensure the list is comprehensive.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 15, 2026

Size Change: +1.01 kB (0%)

Total Size: 33.6 MB

Filename Size Change
./bundle/chunk-7WK3KKUX.js 0 B -14.5 MB (removed) 🏆
./bundle/chunk-ARVLJ4E6.js 0 B -3.8 kB (removed) 🏆
./bundle/chunk-GBBLWJNA.js 0 B -3.43 MB (removed) 🏆
./bundle/core-K7G3PV2T.js 0 B -46.7 kB (removed) 🏆
./bundle/devtoolsService-3LYQ3OPK.js 0 B -28.4 kB (removed) 🏆
./bundle/gemini-S3KDPU3K.js 0 B -553 kB (removed) 🏆
./bundle/interactiveCli-LEHCDMN5.js 0 B -1.29 MB (removed) 🏆
./bundle/oauth2-provider-F7LJ4AWW.js 0 B -9.16 kB (removed) 🏆
./bundle/chunk-B2VD53ET.js 14.5 MB +14.5 MB (new file) 🆕
./bundle/chunk-UU3EMELK.js 3.43 MB +3.43 MB (new file) 🆕
./bundle/chunk-YK5M2IDR.js 3.91 kB +3.91 kB (new file) 🆕
./bundle/core-6TFRV7RM.js 46.7 kB +46.7 kB (new file) 🆕
./bundle/devtoolsService-63C5VAJB.js 28.4 kB +28.4 kB (new file) 🆕
./bundle/gemini-OHX75LCX.js 553 kB +553 kB (new file) 🆕
./bundle/interactiveCli-6JTBRIPM.js 1.29 MB +1.29 MB (new file) 🆕
./bundle/oauth2-provider-EOMNVM5J.js 9.16 kB +9.16 kB (new file) 🆕
ℹ️ View Unchanged
Filename Size Change
./bundle/bundled/third_party/index.js 8 MB 0 B
./bundle/chunk-34MYV7JD.js 2.45 kB 0 B
./bundle/chunk-5AUYMPVF.js 858 B 0 B
./bundle/chunk-5PS3AYFU.js 1.18 kB 0 B
./bundle/chunk-664ZODQF.js 124 kB 0 B
./bundle/chunk-DAHVX5MI.js 206 kB 0 B
./bundle/chunk-IUUIT4SU.js 56.5 kB 0 B
./bundle/chunk-MJYPYSCS.js 1.97 MB 0 B
./bundle/chunk-RJTRUG2J.js 39.8 kB 0 B
./bundle/cleanup-AJDPRRR2.js 0 B -932 B (removed) 🏆
./bundle/devtools-36NN55EP.js 696 kB 0 B
./bundle/dist-T73EYRDX.js 356 B 0 B
./bundle/events-XB7DADIJ.js 418 B 0 B
./bundle/gemini.js 4.97 kB 0 B
./bundle/getMachineId-bsd-TXG52NKR.js 1.55 kB 0 B
./bundle/getMachineId-darwin-7OE4DDZ6.js 1.55 kB 0 B
./bundle/getMachineId-linux-SHIFKOOX.js 1.34 kB 0 B
./bundle/getMachineId-unsupported-5U5DOEYY.js 1.06 kB 0 B
./bundle/getMachineId-win-6KLLGOI4.js 1.72 kB 0 B
./bundle/memoryDiscovery-5ZT36IJ2.js 980 B 0 B
./bundle/multipart-parser-KPBZEGQU.js 11.7 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/client/main.js 222 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/_client-assets.js 229 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/index.js 13.4 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/types.js 132 B 0 B
./bundle/sandbox-macos-permissive-open.sb 890 B 0 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB 0 B
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB 0 B
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB 0 B
./bundle/sandbox-macos-strict-open.sb 4.82 kB 0 B
./bundle/sandbox-macos-strict-proxied.sb 5.02 kB 0 B
./bundle/src-QVCVGIUX.js 47 kB 0 B
./bundle/tree-sitter-7U6MW5PS.js 274 kB 0 B
./bundle/tree-sitter-bash-34ZGLXVX.js 1.84 MB 0 B
./bundle/cleanup-3BVD4KXN.js 932 B +932 B (new file) 🆕

compressed-size-action

@gemini-cli gemini-cli bot added area/platform Issues related to Build infra, Release mgmt, Testing, Eval infra, Capacity, Quota mgmt 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item. labels Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/platform Issues related to Build infra, Release mgmt, Testing, Eval infra, Capacity, Quota mgmt 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EPIC: Reviving PR 11633: Bundling and CI Revamp

1 participant