ci: let Alchemy own PlanetScale deploy password#470
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughDatabase schema migration shifts from the GitHub Actions deployment workflow to the Alchemy infrastructure-as-code runtime. PlanetScale credentials are now generated and consumed directly during IaC provisioning to execute schema push, and Hyperdrive is configured with the same credentials. The workflow jobs are simplified and now pass ChangesDatabase Schema Push Migration to IaC
Sequence DiagramsequenceDiagram
participant AlchemyRun as Alchemy IaC Runtime
participant PlanetScale as PlanetScale Credentials
participant DrizzleKit as drizzle-kit push
participant Hyperdrive as Hyperdrive Config
AlchemyRun->>PlanetScale: Request deploy password
PlanetScale-->>AlchemyRun: Return username, password, host
AlchemyRun->>AlchemyRun: Derive MySQL DATABASE_URL
AlchemyRun->>DrizzleKit: Exec with DATABASE_URL
DrizzleKit-->>AlchemyRun: Schema push complete
AlchemyRun->>Hyperdrive: Configure origin from credentials
Hyperdrive-->>AlchemyRun: Origin configured
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add 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 |
Summary
Context
This implements Option A from the Alchemy PlanetScale + Drizzle guide: Alchemy owns the database password, uses it for Drizzle, then uses that same credential for runtime infrastructure. That removes the two-sources-of-truth split between workflow-created DATABASE_URL and Alchemy-managed PlanetScalePassword state.
Guide: https://alchemy.run/guides/planetscale-drizzle/
Validation
Summary by cubic
Alchemy now owns the PlanetScale deploy password and drives the
drizzle-kitschema push. This removes CI-created passwords and aligns Hyperdrive and Drizzle on one credential to avoid drift.drizzle-kit pushintoalchemy.run.tsviaExec, usingPlanetScalePasswordforDATABASE_URL.ps-deploy-password-${stage}to avoid staleps-password-*state.DATABASE_URL.planetscale/setup-pscale-action@v1, password generation, and workflow-level pushes in both deploy paths.CF_AIG_TOKENto deploy environments.Written for commit ea9138c. Summary will update on new commits. Review in cubic
Summary by CodeRabbit