Skip to content

fix: signed PDFs move to a GCS archive (consumer SAs have zero Drive quota) - #2

Merged
Cervator merged 1 commit into
mainfrom
fix/pdf-home-gcs
Jul 2, 2026
Merged

fix: signed PDFs move to a GCS archive (consumer SAs have zero Drive quota)#2
Cervator merged 1 commit into
mainfrom
fix/pdf-home-gcs

Conversation

@agent-refr

Copy link
Copy Markdown
Collaborator

AI-assisted change proposal. Filed by agent driven by @Cervator via GDD.

Summary

  • The live e2e hit storageQuotaExceeded at the final Drive upload: Google grants consumer-account service accounts zero Drive storage, so an SA can never own an uploaded file or created folder, and the Workspace escape hatches (Shared Drives, delegation) don't exist here. Signed PDFs now live in the public-read GCS bucket skipta-amendments-teralivekubernetes under per-customer prefixes — keeping the zero-stored-credentials model (bucket-scoped storage.objectUser via Workload Identity).
  • Idempotency contract preserved: deterministic per-amendment blob name, find-or-upload before mark_signed, honest 502s. The pdf_drive_url sheet column now carries the public object URL.
  • app/drive.py removed (nothing consumes Drive anymore — the Skipta/ folder remains the human-side SoW archive); app/gcs.py replaces it with matching test fakes.
  • ConfigMap/Deployment gain gcs_bucket/SKIPTA_GCS_BUCKET; design doc updated to as-built, including the public-bucket demo caveat and the promote-to-real path (private bucket + signed URLs).

Test plan

  • ci green (29 tests + the CI-only WeasyPrint render; suite covers upload/marks-signed, retry-reuses-existing-blob with no re-upload, and blob naming).
  • Post-merge live: re-apply k8s base + rollout restart, then re-sign draft amendment amend_smith_20260702051053 — expect the PDF at the bucket URL and the sheet row flipping signed (the draft row survived the 502 exactly as designed).

Related

… storage quota

The live e2e failed at the final Drive upload with storageQuotaExceeded: Google grants consumer-account service accounts no Drive storage at all, so the SA can never own an uploaded PDF (or even create a folder) — the design's SA-quota caveat understated reality, and Shared Drives / delegation both require Workspace. Signed PDFs now land in the public-read bucket skipta-amendments-teralivekubernetes under a per-customer prefix, keeping the zero-stored-credentials model intact (skipta-gsa holds storage.objectUser via Workload Identity). The deterministic per-amendment blob name remains the retry-idempotency key (find-or-upload), mark_signed still runs only after a URL exists, and the pdf_drive_url sheet column now carries the public object URL. Drive integration (app/drive.py) is removed — the SA can still read the shared SoW folder, but nothing in the MVP consumes it, and the Skipta/ Drive folder stays as the human-side SoW archive. Design doc updated to the as-built shape, including the public-bucket demo caveat and the promote-to-real path (private bucket + signed URLs).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 6 seconds

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2a5a7205-7e9d-4885-97c6-a8dc88851167

📥 Commits

Reviewing files that changed from the base of the PR and between 2c19df7 and dec5d04.

📒 Files selected for processing (13)
  • app/config.py
  • app/drive.py
  • app/gcs.py
  • app/google_clients.py
  • app/main.py
  • docs/plans/2026-07-01-skipta-field-amendments-design.md
  • k8s/base/configmap.yaml
  • k8s/base/deployment.yaml
  • requirements.txt
  • tests/conftest.py
  • tests/test_drive.py
  • tests/test_gcs.py
  • tests/test_routes_sign.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/pdf-home-gcs

Comment @coderabbitai help to get the list of available commands.

@Cervator
Cervator merged commit b558a85 into main Jul 2, 2026
2 checks passed
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.

2 participants