docs(db): migration safety checklist and deploy workflow pitfalls from the 17 September outage
Merged
KI
2mo ago+192+192+012345678901234567890123456789-9-9-0123456789
Summary
Records what the 17 September 2026 API outage and its follow-through taught us, in the places an engineer or agent reads before repeating the mistake. Documentation only, no behaviour changes.
Post mortem: https://app.superset.sh/page/post-mortem-api-outage-17-september-2026-bwc63i
Follow-through PRs: #7671, #7672, #7675
Changes
.agents/skills/db-migrations/SKILL.md: reworked into generate steps, a safety checklist, and the rules behind it. Closes the P1 action item "add a migration safety checklist to the db-migrations skill".- drizzle applies every pending migration in one transaction, so splitting files gives no lock isolation
- no column type change on a large, busy table; the safe shapes instead
- take locks child first, then parents; the one legitimate reason to hand-order a generated file (still needs explicit user confirmation, plus a SQL comment)
- which tables are hot, with the measured numbers
- a read-only production size query, and sizes as of 2026-09-19
- rehearsing on a Neon branch of production under pgbench load, not only on a quiet copy
- what the
deploy-databasejob enforces (concurrency group, lock and statement timeouts, 8 retries on lock races only,verify-migrations-applied.ts) - a reused preview Neon branch makes the PR database check a no-op
- moving where data is read from means moving the data in the same release (#7317)
docs/deploy-workflows.md(new):run:has nopipefailunlessshell: bashis set, production secrets exist only as GitHub environment secrets, the Deployments page rows are cosmetic, wait about 20 seconds aftergh workflow enable. No existing doc fit:docs/environment-variables.mdis a five-step how-to for one task,docs/agent-tooling.mdandscripts/release/README.mdare unrelated.AGENTS.md: "Further reading" pointer to the new doc; the Database section now mentions the checklist.docs/environment-variables.md: one cross-link from theenvironment:scoping paragraph.
Verification
bun run lint: passbun run lint:prose(apps/marketing): 0 errors, 0 warningsvale --minAlertLevel=warningdirectly on the skill and the new doc: clean.docs/environment-variables.mdhas pre-existing em dashes outside the CI lint scope; left alone here.- Checked against the repo:
PgDialect.migratein drizzle-orm 0.45.2, thedeploy-databasejob,verify-migrations-applied.ts,backfill-connections.yml, thebranch_name: github.head_refindeploy-preview.yml, the hand-order comment in migration 0119. Production measurements are as verified on 2026-09-19.
Summary by cubic
Records what the 17 September 2026 API outage and its follow-through taught us about database migrations and deploy workflows. Documentation only; no behavior changes.
- Reworks
.agents/skills/db-migrations/SKILL.mdinto generate steps and a production safety checklist, closing the P1 post-mortem action item. - Adds
docs/deploy-workflows.mdcovering pipedrun:steps withoutpipefail, production secrets existing only as GitHub environment secrets, cosmetic Deployments page rows, and waiting about 20 seconds aftergh workflow enable. - Updates
AGENTS.mdanddocs/environment-variables.mdto point to the new guidance.
Summary by CodeRabbit
- Documentation
- Expanded database migration guidance with production safety checklists, lock and backfill considerations, load rehearsals, deployment timeout handling, verification steps, and preview-branch reset requirements.
- Added deployment workflow guidance covering reliable failure detection, production secret access, workflow environments, and safe dispatch timing.
- Clarified environment-variable behavior for jobs and one-off scripts requiring production secrets.
- Documented incident-specific migration and deployment lessons for future operational reference.