Skip to content

chore: align CI with Cloud Build + rewrite README_CLOUDRUN - #4

Merged
avireddy0 merged 1 commit into
mainfrom
chore/wave-ij-readme-and-cleanup
Apr 26, 2026
Merged

chore: align CI with Cloud Build + rewrite README_CLOUDRUN#4
avireddy0 merged 1 commit into
mainfrom
chore/wave-ij-readme-and-cleanup

Conversation

@avireddy0

Copy link
Copy Markdown
Collaborator

Summary

Wave I+J cleanup for Envision-Construction/gmail. Aligns the deploy path with the platform rule "push triggers Cloud Build — never gcloud run deploy," removes a redundant scheduler script, and rewrites README_CLOUDRUN.md to match what's actually deployed.

Commits

  1. docs: rewrite README_CLOUDRUN.md to match deployed reality (98 +/107 -)

    • Documents push-to-main -> Cloud Build (cloudbuild.yaml steps deploy-cloud-run, delete-old-scheduler, create-scheduler).
    • WIF auth — drops the legacy SA-key copy instructions; references Secret Manager gmail-scraper-sa-key as break-glass only.
    • Removes obsolete ./deploy.sh and manual gcloud run deploy paths.
    • Fixes the API contract section per main.py: surfaces incremental (default true, scheduler depends on it) and the full response shape — mode, skipped_duplicates, completed_at, status: started|completed|failed, error. Health-check JSON now includes mode: "incremental".
  2. chore: route deploy through Cloud Build, drop setup_scheduler.sh (6 +/90 -)

    • .github/workflows/deploy.yml now runs gcloud builds submit --config=cloudbuild.yaml instead of deploy-cloudrun@v2 + shelling out to setup_scheduler.sh.
    • Verified cloudbuild.yaml create-scheduler step preserves: schedule (*/5 * * * *), URI, body ({"incremental": true, "max_per_user": 100}), Content-Type header, America/New_York time zone.
    • Deletes setup_scheduler.sh — was redundant with cloudbuild.yaml and self-contradictory (echoed "Every hour at minute 0" while creating */5 * * * *).

Files changed

  • README_CLOUDRUN.md — full rewrite
  • .github/workflows/deploy.yml — switched from deploy-cloudrun@v2 to gcloud builds submit
  • setup_scheduler.sh — deleted

Notes for follow-up

  • gunicorn is dead in requirements.txt. The Dockerfile runtime CMD is functions-framework --target=run_scraper --port=8080; nothing invokes gunicorn. Confirmed with grep -r gunicorn . — only hit is requirements.txt:5. Suggest removing in a separate small PR (kept out of this scope to keep the diff focused).
  • cloudbuild.yaml was already in the repo and known-good but not wired to a trigger; this PR makes it the active path. The cloudbuild.yaml create-scheduler --attempt-deadline=3600s is intentionally higher than the prior setup_scheduler.sh value of 1800s; if 30m is the desired ceiling, follow-up commit dee6b4e's reduction needs to be re-applied to cloudbuild.yaml.

Test plan

  • Merge to main and watch the Actions run — confirm Cloud Build job succeeds and gmail-scraper revision rolls out.
  • gcloud scheduler jobs describe gmail-scraper-5min --location=us-central1 — verify schedule, URI, body, deadline match expectations.
  • gcloud scheduler jobs run gmail-scraper-5min --location=us-central1 — manual trigger; confirm 200 and a row appears in claude-mcp-457317.gmail_analytics.messages.
  • curl https://<service-url>/ — confirm health-check JSON now includes mode: "incremental".

🤖 Generated with Claude Code

Push-to-main now invokes `gcloud builds submit --config=cloudbuild.yaml`,
which already creates/refreshes the `gmail-scraper-5min` Cloud Scheduler
job. The previous workflow used `deploy-cloudrun@v2` and shelled out to
`setup_scheduler.sh`, duplicating cloudbuild.yaml's `delete-old-scheduler`
+ `create-scheduler` steps.

setup_scheduler.sh was also self-contradictory (echoed
"Every hour at minute 0" while creating `*/5 * * * *`). Deleting.

Verified cloudbuild.yaml `create-scheduler` step replicates the
schedule (`*/5 * * * *`), URI, body (`incremental=true`), headers,
and time zone the old script set.
@avireddy0
avireddy0 force-pushed the chore/wave-ij-readme-and-cleanup branch from 31923ce to 4d5ecde Compare April 26, 2026 18:07
@avireddy0
avireddy0 merged commit 6ec9097 into main Apr 26, 2026
2 checks passed
@avireddy0
avireddy0 deleted the chore/wave-ij-readme-and-cleanup branch April 26, 2026 18:07
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