chore: upgrade googleapis and google-auth-library packages - #753
chore: upgrade googleapis and google-auth-library packages#753Itzaprado wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
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.
| "express-winston": "^4.2.0", | ||
| "firebase-admin": "^13.0.2", | ||
| "googleapis": "^59.0.0", | ||
| "googleapis": "^171.4.0", |
There was a problem hiding this comment.
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.
| "googleapis": "^171.4.0", | |
| "googleapis": "^171.4.0", | |
| "googleapis-common": "^8.0.2", |
| "**/ssh2": "^1.4.0", | ||
| "**/axios": "^1.2.1", | ||
| "**/google-auth-library": "7.14.1", | ||
| "**/google-auth-library": "^10.6.2", |
There was a problem hiding this comment.
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.
| "**/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
c49ea11 to
a1e95d6
Compare
- 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.
81e9e2f to
da143f8
Compare
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
Dependency Upgrades:
googleapisfromv59.0.0to^171.4.0.google-auth-library(via resolutions) fromv7.14.1to^10.6.2.TypeScript Compilation Fixes:
GaxiosResponseWithHTTP2(due to internal HTTP/2 integration). We updatedgoogle_drive.tsandgoogle_sheets.tsto use this type instead of the legacyGaxiosResponsefromgaxios, resolvingcompilation errors.
retriableClearSheetingoogle_sheets.tsto match the actual return type ofbatchUpdate(previously it was incorrectly typed as
ClearValuesResponse).Build & Deployment Optimizations (OOM & Startup Fixes):
googleapispackage caused the TypeScript compiler(
tsc) to run out of memory (OOM) during the Docker build step. We resolved this by adding"skipLibCheck": truetotsconfig.jsonto skip type-checking of library declaration files, and increased the Node heap memory limit in theDockerfile(NODE_OPTIONS="--max-old-space-size=4096").ts-nodein production without flags causes it to type-check the entireproject 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
Dockerfileto usets-node --transpile-only, resulting innear-instant container startup and low memory usage.
Test Optimization:
googleapispackage size also causedts-nodeto take ~30 seconds to type-check child processes spawnedduring tests, causing timeouts.
--transpile-onlyflag tots-nodefor spawned test processes intest_queue_action.tsto keep testexecution 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- AddedskipLibCheckto prevent build OOM.Dockerfile- Memory limit and startup speed optimizations.