Add database seed script and prod seeding job - #116
Conversation
Seeds catalog/lookup data (cities, locations, categories, tags, items, copies). Idempotent: skips when cities already exist unless forced. Adds npm scripts (seed, seed:prod) and scripts/seed-prod.sh to run the seed as a one-off Cloud Run Job against the deployed backend.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAdds seed npm scripts, a deterministic database seeding routine for cities, locations, categories, tags, items, and item copies, and a Bash wrapper that creates, updates, and runs a Cloud Run Job for production seeding. ChangesSeed tooling and production job flow
Sequence Diagram(s)sequenceDiagram
participant seedProd as "seed-prod.sh"
participant gcloud as "gcloud"
participant cloudService as "backend Cloud Run service"
participant cloudJob as "Cloud Run Job"
seedProd->>gcloud: describe backend service
gcloud->>cloudService: read image, Cloud SQL annotation, env vars, secrets
cloudService-->>gcloud: service definition
seedProd->>gcloud: create or update job with backend/dist/db/seed.js
gcloud->>cloudJob: apply job spec
seedProd->>gcloud: run job --wait
gcloud->>cloudJob: execute seed entrypoint
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Seeds catalog/lookup data (cities, locations, categories, tags, items, copies). Idempotent: skips when cities already exist unless forced. Adds npm scripts (seed, seed:prod) and scripts/seed-prod.sh to run the seed as a one-off Cloud Run Job against the deployed backend.
Summary by CodeRabbit