Skip to content

chore: upgrade googleapis and google-auth-library packages - #753

Open
Itzaprado wants to merge 5 commits into
looker-open-source:masterfrom
Itzaprado:update-google-api-packages
Open

chore: upgrade googleapis and google-auth-library packages#753
Itzaprado wants to merge 5 commits into
looker-open-source:masterfrom
Itzaprado:update-google-api-packages

Conversation

@Itzaprado

@Itzaprado Itzaprado commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR upgrades the outdated Google API packages to their modern counterparts, resolves resulting TypeScript compilation errors,
and optimizes the build and deployment process to prevent memory and startup timeout issues.

Justification & Details

  1. Dependency Upgrades:

    • Upgraded googleapis from v59.0.0 to ^171.4.0.
    • Upgraded google-auth-library (via resolutions) from v7.14.1 to ^10.6.2.
    • These updates bring security patches, bug fixes, and better compatibility with the Node 20 runtime used in this project.
  2. TypeScript Compilation Fixes:

    • Newer versions of the Google libraries return GaxiosResponseWithHTTP2 (due to internal HTTP/2 integration). We updated
      google_drive.ts and google_sheets.ts to use this type instead of the legacy GaxiosResponse from gaxios, resolving
      compilation errors.
    • Corrected the return type of retriableClearSheet in google_sheets.ts to match the actual return type of batchUpdate
      (previously it was incorrectly typed as ClearValuesResponse).
  3. Build & Deployment Optimizations (OOM & Startup Fixes):

    • TypeScript Compiler OOM Fix: The massive size of the upgraded googleapis package caused the TypeScript compiler
      (tsc) to run out of memory (OOM) during the Docker build step. We resolved this by adding "skipLibCheck": true to
      tsconfig.json to skip type-checking of library declaration files, and increased the Node heap memory limit in the
      Dockerfile (NODE_OPTIONS="--max-old-space-size=4096").
    • Cloud Run Startup Timeout Fix: Running ts-node in production without flags causes it to type-check the entire
      project on startup, which took too long and used too much memory with the new packages, causing Cloud Run deployment
      timeouts. We optimized the container entry point in the Dockerfile to use ts-node --transpile-only, resulting in
      near-instant container startup and low memory usage.
  4. Test Optimization:

    • The upgraded googleapis package size also caused ts-node to take ~30 seconds to type-check child processes spawned
      during tests, causing timeouts.
    • Added the --transpile-only flag to ts-node for spawned test processes in test_queue_action.ts to keep test
      execution fast (reduced test suite duration from over 2 minutes to 22 seconds).

Modified Files

  • package.json / yarn.lock - Package updates.
  • src/actions/google/drive/google_drive.ts - Type updates.
  • src/actions/google/drive/sheets/google_sheets.ts - Type updates and cleanups.
  • src/actions/queueaction/test_queue_action.ts - Test optimization flag.
  • tsconfig.json - Added skipLibCheck to prevent build OOM.
  • Dockerfile - Memory limit and startup speed optimizations.

@Itzaprado
Itzaprado requested a review from a team as a code owner June 12, 2026 20:29

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

Copy link
Copy Markdown

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 upgrades the googleapis and google-auth-library dependencies, updating type signatures in the Google Drive and Google Sheets actions to use GaxiosResponseWithHTTP2 from googleapis-common. Additionally, it optimizes test execution by adding the --transpile-only flag to ts-node. The review feedback recommends explicitly adding googleapis-common to the dependencies in package.json since it is imported directly, and pinning google-auth-library to an exact version in the resolutions block to ensure deterministic builds.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread package.json
"express-winston": "^4.2.0",
"firebase-admin": "^13.0.2",
"googleapis": "^59.0.0",
"googleapis": "^171.4.0",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The package googleapis-common is imported directly in src/actions/google/drive/google_drive.ts and src/actions/google/drive/sheets/google_sheets.ts, but it is not declared as a direct dependency in package.json. Relying on transitive dependencies can lead to broken builds if the parent package updates or if hoisting behavior changes. Please add googleapis-common explicitly to the dependencies section.

Suggested change
"googleapis": "^171.4.0",
"googleapis": "^171.4.0",
"googleapis-common": "^8.0.2",

Comment thread package.json
"**/ssh2": "^1.4.0",
"**/axios": "^1.2.1",
"**/google-auth-library": "7.14.1",
"**/google-auth-library": "^10.6.2",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

In the resolutions block, "**/google-auth-library" is set to a range (^10.6.2). The purpose of resolutions is to force a single, specific version of a dependency across the entire dependency tree to ensure deterministic builds and prevent unexpected runtime issues. Using a range defeats this purpose because different environments or subsequent installs might resolve to different versions. It is highly recommended to pin this to an exact version.

Suggested change
"**/google-auth-library": "^10.6.2",
"**/google-auth-library": "10.6.2",

- Updated googleapis to ^171.4.0
- Updated google-auth-library resolution to ^10.6.2
- Fixed type compilation errors in google_drive.ts and google_sheets.ts by using GaxiosResponseWithHTTP2
- Optimized queue tests to use ts-node --transpile-only to prevent timeouts due to larger package size
@Itzaprado
Itzaprado force-pushed the update-google-api-packages branch from c49ea11 to a1e95d6 Compare June 16, 2026 23:51
- Added skipLibCheck: true to tsconfig.json to prevent tsc from running out of memory when type-checking the massive new googleapis package.
- Increased Node memory limit in Dockerfile during build (NODE_OPTIONS="--max-old-space-size=4096").
- Optimized container startup in Dockerfile by using ts-node --transpile-only to bypass runtime type-checking, preventing Cloud Run startup timeouts and OOM crashes.
@Itzaprado
Itzaprado force-pushed the update-google-api-packages branch from 81e9e2f to da143f8 Compare June 19, 2026 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant