Skip to content

fix(deps): deduplicate google-auth-library to fix release build#1312

Merged
zapolsky merged 1 commit into
mainfrom
fix/dedupe-google-auth-library
Jun 11, 2026
Merged

fix(deps): deduplicate google-auth-library to fix release build#1312
zapolsky merged 1 commit into
mainfrom
fix/dedupe-google-auth-library

Conversation

@zapolsky

@zapolsky zapolsky commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Problem

Commit 1ad2615 ("Version Packages" #1250) turned ~15 CI checks red, all from a single root cause.

The package-lock.json regeneration floated the hoisted root google-auth-library to 10.7.0, while googleapis-common@8.0.2 pins it to exactly 10.5.0. That left two physical v10 copies in the tree → two distinct OAuth2Client types → error TS2345 in the backend:

  • apps/backend/.../google-sheets/adapters/google-sheets-api.adapter.tsgoogle.sheets({ version: 'v4', auth })
  • apps/backend/.../bigquery/services/bigquery-storage-resource-browser.service.tsgoogle.bigquery({ version: 'v2', auth })

The backend imports OAuth2Client directly from google-auth-library (root copy), but googleapis expects the type from googleapis-common's nested copy. Since almost every job starts with build:dep (which compiles the backend), the single build error cascaded into the tests, linters, publish, and all E2E jobs.

Fix

Scoped npm override in the root package.json:

"googleapis-common": { "google-auth-library": "^10.1.0" }

googleapis-common now reuses the root copy. The ^10.1.0 range (rather than a pinned 10.7.0) auto-tracks the root on future lockfile regenerations, so the tree stays deduplicated. The separate v9 cluster (@google-cloud/logging/pubsub, google-gax — all 9.15.1) is left untouched.

In package-lock.json, the duplicate google-auth-library@10.5.0 and its now-orphaned gcp-metadata/gtoken entries are removed (minimal diff).

Verification

Check Result
npm ci (same as CI) ✅ exit 0, 0 vulnerabilities
Deduplication ✅ single root google-auth-library@10.7.0
Backend build (TS2345) ✅ gone
Full owox build (CI step repro) ✅ exit 0

ℹ️ npm ls google-auth-library will report invalid (the override intentionally violates googleapis-common's exact pin) — cosmetic only; it does not affect npm ci/build/publish, and CI never runs a bare npm ls.

The "Version Packages" lockfile regen floated the root google-auth-library
to 10.7.0 while googleapis-common pins exactly 10.5.0, creating two copies of
the v10 OAuth2Client type. That broke the backend TypeScript build (TS2345 in
google.sheets()/google.bigquery() calls), which cascaded into ~15 failed CI
checks since nearly every job starts by building the backend.

Add a scoped npm override so googleapis-common reuses the hoisted root copy;
the ^10.1.0 range auto-tracks future lockfile regens. The separate v9 cluster
(@google-cloud/logging/pubsub, google-gax) is untouched.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@zapolsky zapolsky merged commit c782374 into main Jun 11, 2026
4 checks passed
@zapolsky zapolsky deleted the fix/dedupe-google-auth-library branch June 11, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant