Skip to content

chore(main): migrate to scoped Google Drive API package - #493

Merged
khaira777 merged 2 commits into
mainfrom
fm/flocafe-417-googleapis-scope-scout
Aug 23, 2026
Merged

khaira777 merged 2 commits into
mainfrom
fm/flocafe-417-googleapis-scope-scout

Conversation

@khaira777

Copy link
Copy Markdown
Contributor

Intent

Review the scout worktree with git status and git log; return to a clean default-branch base, carry over only intended changes, create branch fm/flocafe-417-googleapis-scope-scout, implement the recommended @googleapis/drive migration from the report, preserve OAuth/token/Drive behavior and local restore boundaries, add offline API-contract and refresh-token regression coverage, measure packaged size, run the required checks, then append done: PR checks green after the no-mistakes run. The implementation decision is the official @googleapis/drive package rather than electron-builder filtering, with no direct google-auth-library dependency and no route/frontend/workflow changes.

What Changed

  • Replaced googleapis with the scoped @googleapis/drive package while preserving OAuth, Drive backup, folder, retention, and token-refresh behavior.
  • Added regression coverage for the scoped API contract and persistence of refreshed access tokens without losing refresh tokens.

Risk Assessment

✅ Low: The focused migration preserves existing OAuth2 and Drive v3 call shapes, exports the required APIs, and removes only the direct all-APIs dependency and auth dependency.

Testing

The focused Electron test passed after dependency setup, exercising the @googleapis/drive runtime contract, refresh-token persistence, offline disconnect/local cleanup, encrypted token lifecycle, and shutdown boundaries. No UI artifact was applicable; temporary node_modules were removed and the worktree remained clean.

Evidence: Google Drive targeted evidence

@googleapis/drive API contract, refresh-token preservation, offline disconnect, encrypted token lifecycle, and shutdown checks all passed; exit_code=0.

9:   ✓ @googleapis/drive exposes OAuth2 and every Drive v3 method used by backup/retention
176:   ✓ getStatus() reports connected once a token file exists
177:   ✓ refreshed access tokens are persisted without losing the refresh token
186:   ✓ token file round-trips through the same safeStorage pattern as master-pin.ts
187:   ✓ disconnect() clears the token file and local status even without a reachable Google endpoint
191:✅ Google Drive tests passed

exit_code=0

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • npm ci --ignore-scripts
  • npm run test:google-drive
  • npm ls --depth=0 @googleapis/drive googleapis google-auth-library
  • git diff --check
  • Final worktree status and transient-install cleanup
✅ **Document** - passed

✅ No issues found.

🔧 **Lint** - 1 issue found → auto-fixed ✅
  • ⚠️ Configured ESLint and TypeScript checks could not run because node_modules and the local lint/compiler dependencies are absent; no source lint defect was established. git diff --check and relative Markdown link checks passed.

🔧 Fix: Lint and static analysis clean
✅ Re-checked - no issues remain.

✅ **Push** - passed

✅ No issues found.

@greptile-apps

greptile-apps Bot commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR replaces the broad googleapis dependency with the scoped @googleapis/drive package while retaining the existing Drive and OAuth flows.

  • Updates OAuth2 and Drive client construction to use the scoped package exports.
  • Removes the broad API package and updates the dependency lockfile.
  • Adds offline contract coverage for required Drive methods and refreshed-token persistence.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
main/services/google-drive.ts Migrates OAuth2 and Drive client construction to scoped package exports while preserving connection, backup, retention, and shutdown behavior.
package.json Replaces the broad Google APIs dependency with the scoped Drive package.
package-lock.json Locks the scoped Drive package and its transitive authentication dependencies while removing the broad package.
tests/google-drive.test.ts Adds runtime API-contract checks and verifies refreshed access-token persistence retains the refresh token.

Reviews (2): Last reviewed commit: "Merge branch 'main' into fm/flocafe-417-..." | Re-trigger Greptile

@khaira777
khaira777 merged commit ef1c18c into main Aug 23, 2026
13 checks passed
@khaira777
khaira777 deleted the fm/flocafe-417-googleapis-scope-scout branch August 23, 2026 22:45
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