Fix Drive push workflow #3
No reviewers
Labels
No labels
Compat/Breaking
Compat/Deprecation
Kind
Bug
Kind
Chore
Kind
Documentation
Kind
Enhancement
Kind
Feature
Kind
Investigation
Kind
Question
Kind
Security
Kind
Testing
Meta/Good First Issue
Meta/Help Wanted
Meta/Stale
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
Status/Needs Triage
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
XeplosionGames/minecraft-provider-analysis!3
Loading…
Reference in a new issue
No description provided.
Delete branch "dev"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What changed and why
Fixes a
storageQuotaExceeded403 in the push-drive workflow. Serviceaccounts have zero storage quota outside a Shared Drive — they can edit
files they're shared on but can't create new ones — and the target Drive
folder is owned by a personal Gmail account, so Shared Drives / domain-wide
delegation (both Workspace-only) weren't an option.
Switches Drive uploads over to a personal-account OAuth refresh token
instead, so new files are created under the folder owner's own quota —
same as the capture-form web app already does in-browser.
src/utils/drive_api.py—_credentials()now prefersDRIVE_OAUTH_CLIENT_ID/DRIVE_OAUTH_CLIENT_SECRET/DRIVE_OAUTH_REFRESH_TOKENenv vars when present, falling back to the existing service-account/ADC
path otherwise.
bootstrap.py/sheets_api.pyare unaffected — they neverset those vars.
src/capture_tools/push_drive.py— docstring updated to describe the newauth requirement; no logic change.
.forgejo/workflows/push-drive.yml— drops theGCP_SA_KEYstep, passesthe three
DRIVE_OAUTH_*secrets instead.scripts/get_drive_refresh_token.py(new) — one-time, local-only helperto obtain the refresh token via an interactive consent flow.
Related issues
Closes #
How to test
Console, then locally run:
python scripts/get_drive_refresh_token.py --client-id ... --client-secret ...signed in as the account that owns the Drive folder.
DRIVE_OAUTH_CLIENT_ID,DRIVE_OAUTH_CLIENT_SECRET,DRIVE_OAUTH_REFRESH_TOKEN.pytest— all existing tests should still pass unmodified (the newcredential path is additive and only activates when those env vars are
set).
dry_runchecked,confirm no auth errors.
without a
storageQuotaExceedederror.Checklist
Release notes
Fix Drive push workflow to authenticate as the folder-owning account instead of the service account, avoiding a storage quota error.