decision(ops): hold a production build until its migrations are applied

オープン
#758 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
ドキュメント
明瞭さ
おおむね明確
活発さ
活発
技術スタック
nextjs, supabase, typescript

調査の方向性

Read docs/operations/deploy.md, docs/internal/hosted-instance.md, and docs/operations/self-hosting.md to understand the current release steps and document the selected option. Eddie must choose an option first; then update the release order and migration status check in those files. Done means the chosen setting or branch and safe promotion order are documented, and self-hosting guidance no longer implies that a push always promotes automatically.

索引モデルが issue の本文から書いたものです。

説明

area: ops decision enhancement impact: high priority: P0 size: XS

Context

Found by the Fable pre-production review on 2026-12-02 (main at cedc1914; every line reference below re-checked on main at cde5aa3b). Sources: platform triage report, new issue 2, and deploy readiness report, new issue 4 (merged here).

The hosted instance's production branch is main (docs/operations/deploy.md:206), so every merge builds a production deployment, and with Vercel's default settings that deployment takes the production domain as soon as it builds. The runbooks assume otherwise: docs/internal/hosted-instance.md:9-11 says to apply new migrations "before the deployment receives traffic", and deploy.md:89 says every release applies migrations "before promoting the matching deployment". That order only holds with Vercel's "Auto-assign Custom Production Domains" turned off, which makes each production build a staged deployment that waits for a manual promote (Vercel docs, "Staging and promoting a production deployment"). No runbook names that setting. docs/operations/self-hosting.md:122 says a push to main builds and promotes.

Expand then contract (deploy.md:89) protects the previous build on a new schema, not a new build on the old schema. main had 52 commits since 2026-11-25, 14 of them touching supabase/migrations/ (git log origin/main --since=2026-11-25).

Impact: every signed-in user after a merge that adds a migration. New code runs on the old schema until Eddie applies the migration; queries against a new column or function fail with errors that users see on every page that reads them. Nothing self-heals until the migration is applied. The signal exists: /app/admin shows "Database migrations: Behind" (src/app/super-admin/page.tsx:76, :199).

This is Eddie's choice, so the options are below. Eddie promotes production; agents never do (hosted-instance.md:25).

Option Pros Cons Effort Impact
Status quo: main builds and goes live on its own Nothing to change; one step per release New code serves before its migration is applied; hosted-instance.md:9-11 and deploy.md:89 describe an order that cannot happen XS (nothing) Every user after a migration merge sees errors until Eddie applies it; the window is as long as Eddie's reaction time
A. Turn off "Auto-assign Custom Production Domains"; each main build is staged, Eddie runs supabase migration list --remote and migration up --remote, then promotes Matches the runbooks as written; no new secret anywhere; a build whose CI failed is simply not promoted Every release needs a manual promote, even with no migration; a forgotten promote leaves production on the old build (safe, but stale) XS (docs plus one Vercel setting) Users never meet a schema mismatch; the cost is release latency, which self-heals at the next promote
B. Production branch becomes production; Eddie fast-forwards it from main after applying migrations Release is a visible git action; previews of main still build A second long-lived branch to keep in step; the #461 default-branch and ruleset setup (hosted-instance.md:29-30) needs a second protected branch; still manual S (docs, ruleset, Vercel setting) Same protection as A, with more moving parts that can drift
C. A CI job applies migrations on merge before Vercel builds No manual step Puts the production database password in GitHub Actions secrets; a migration runs before review of the deploy; CI and the Vercel build race unless ordered; against "agents and automation never promote production" M (workflow, secrets, ordering) Fast releases; a bad migration reaches production with nobody watching

Files each option touches:

Option Files
Status quo none
A docs/operations/deploy.md (step 5 and the release paragraph at :89), docs/internal/hosted-instance.md (Promote production), docs/operations/self-hosting.md:122
B the same docs, plus the repository ruleset and Vercel's production branch setting
C a new workflow under .github/workflows/, repository secrets, the same docs

Recommendation: A. The deciding argument: it makes the order the runbooks already promise true with one Vercel setting and no new secret, and keeps promotion with Eddie. Second choice: B, if a visible release branch is wanted later.

Plan

  1. Eddie picks an option on this issue.
  2. Write the chosen setting into deploy.md step 5 and hosted-instance.md, and the order as: staged build, supabase migration list --remote and migration up --remote, then promote.
  3. Name "Database migrations: Behind" on /app/admin as the signal to check before promoting.
  4. Say that a main commit whose CI failed is not promoted.

Acceptance criteria

  • The chosen option is recorded on this issue with the reason.
  • deploy.md step 5 and hosted-instance.md name the Vercel setting (or the production branch) and the release order.
  • A commit with a new migration cannot serve production before supabase migration list --remote shows it applied.
  • self-hosting.md "Upgrade" no longer says a push to main promotes on its own, or says why that is safe for self-hosters.
  • Playwright e2e: none needed, docs only.

Files and areas

docs/operations/deploy.md, docs/internal/hosted-instance.md, docs/operations/self-hosting.md.

Non-goals: applying migrations, changing Vercel settings (Eddie's), the production address work in #756.

Verification

npm run lint; the docs e2e spec still passes.


Branch: <issue-number>-staged-production-builds

Model: anthropic/claude-opus-5-5 | Reasoning effort: unknown

主要言語
TypeScript
スター
13
フォーク
2
平均マージ
5時間 20分
マージ済み PR(30日)
287

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

eddiejaoude/StackDash のほかの issue

eddiejaoude/StackDash の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。