Migrate remaining infra PowerShell deploy scripts to bash - #300
Migrate remaining infra PowerShell deploy scripts to bash#300patoperpetua wants to merge 5 commits into
Conversation
Stop provisioning Azure SQL in main.bicep/deploy.ps1. Document Neon database-url / database-url-unpooled Key Vault secrets, update migrate-db for PostgreSQL directUrl, and drop the SQL-only refresh-database-url script. Co-authored-by: Cursor <cursoragent@cursor.com>
Port deploy, deploy-aca-preview, and migrate-db to bash (Neon-aware), delete the .ps1 counterparts, and point docs/workflows at the .sh paths. refresh-database-url.ps1 stays removed (obsolete after Azure SQL IaC exit). Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Sorry @patoperpetua, you've used your own review budget of 250,000 diff characters for the last 7 days.
You can request another review in 3 days and 6 hours by commenting @sourcery-ai review. Upgrade to get a review now.
|
Warning Review limit reachedNext included review available in 57 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (18)
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 |
Human Review Brief — Migrate remaining infra PowerShell deploy scripts to bash
Summary
Test evidence
Preview URLsOpen review threads
Infra blockers
Visual review
Next actionREADY FOR HUMAN |
Reviewer's GuideThe PR completes the infrastructure tooling migration from PowerShell to strict-mode Bash by adding three secure, option-driven deployment/migration scripts, removing their PowerShell counterparts, and updating all related documentation, workflow guidance, Bicep comments, and cross-script instructions for the Neon/Azure deployment model. Sequence diagram for Neon database migrationsequenceDiagram
actor Operator
participant Script as migrate-db.sh
participant AzureCLI as Azure CLI
participant KV as Key Vault
participant Prisma as Prisma
participant Neon as Neon PostgreSQL
Operator->>Script: migrate-db.sh
Script->>AzureCLI: az account set
Script->>KV: secret show database-url
KV-->>Script: pooled URL
Script->>KV: secret show database-url-unpooled
KV-->>Script: direct URL or fallback
Script->>Script: Write packages/db/.env
Script->>Prisma: pnpm exec prisma migrate deploy
Prisma->>Neon: Apply forward-only migrations
Prisma-->>Script: Migration status
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
API preview (Container Apps Consumption)Preview URL: https://ssd-pocpk-aca-pr-300-ae.victoriouscliff-509c369b.australiaeast.azurecontainerapps.io
Database
See Web SWA PR previews remain via |
Validate DATABASE_URL* schemes before Key Vault upsert, and fail closed when database-url-unpooled is missing so Prisma never migrates via PgBouncer. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Keep PowerShell scripts deleted. Require database-url-unpooled in migrate-db.sh and reject non-Postgres DATABASE_URL* in deploy.sh. Co-authored-by: Cursor <cursoragent@cursor.com>
Closes #296
Preview scenarios: not-applicable — tooling/infra migration only
Summary
infra/deploy.sh,infra/deploy-aca-preview.sh,infra/migrate-db.sh(bash,--help,set -euo pipefail, chmod 600 for secret temp files).refresh-database-url.ps1already deleted in Remove Azure SQL from infrastructure and wire Neon connection #291 (obsolete for Neon).DATABASE_URL*indeploy.sh; fail closed whendatabase-url-unpooledis missing inmigrate-db.sh.infra/README.md, SETUP, db-practices, telemetry, pr-pipelines, preview-api workflow, and Bicep header comments.Base
Targets main. Includes #298 commits until #298 merges (then GitHub will show only the bash-port delta). Prefer merging #298 first, then this PR.
Test plan
bash -non all three new scripts--helpsmoke for each scriptaz login):./infra/deploy.sh --what-if,./infra/deploy-aca-preview.sh --what-if,./infra/migrate-db.sh --what-ifinfra/*.ps1deploy paths in docs touched by this PRFeedback focus
refresh-database-url.shis correct given Neon KV URLs.Related
deploy-openfga.sh(Migrate Permissions service (OpenFGA) from SQLite to PostgreSQL on Neon #293)