Repository navigation
feat(ops): add a read-only backend drift check - #79
Conversation
Vercel ships the frontend on merge, but migrations and Edge Functions are deployed by hand, and nothing in the repo showed when production fell behind. On 2026-09-30 it lacked two migrations and ran pre-#75 functions. `npm run backend:status` runs `supabase migration list` and `supabase functions list` and compares them with the migrations and function folders committed at HEAD. It reports unapplied migrations, undeployed functions, functions deployed before the last commit that touched them or a file they import, and verify_jwt drift from config.toml. `--project-ref <ref>` targets another project, and `--check` exits 1 when a migration is not applied. docs/operations.md makes it the first step of every backend deploy. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughAdds a read-only ChangesBackend status check
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
actor Operator
participant Npm as npm run backend:status
participant Script as backend-status.mjs
participant Git
participant SupabaseCLI as Supabase CLI
Operator->>Npm: Run status command
Npm->>Script: Execute script
Script->>Git: Read committed backend state at HEAD
Script->>SupabaseCLI: List project migrations and functions
Git-->>Script: Return committed migrations and function configuration
SupabaseCLI-->>Script: Return deployed migration and function data
Script-->>Operator: Print backend status report
Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 6 systems. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Essentials by visiting https://app.coderabbit.ai/settings/billing. Comment |
|
@coderabbitai full review |
|
|
@coderabbitai review |
|
A function deployed from an out-of-date checkout gets a fresh deploy date, so backend:status reports it as current. Say so in the report and the docs, and deploy functions only from an up-to-date main. Drop the untested claim about SUPABASE_DB_PASSWORD, and note that a CI step would need a production credential that AGENTS.md keeps out of jobs. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
@coderabbitai review |
|
|
live-e2e failure is not from this PR. It fails on The same 5 tests fail with the same timings on two unrelated open PRs today: runs 36839258226 ( The function log in the failure artifact shows why. AI requests ( That regression needs its own fix. The other checks on |
|
@coderabbitai full review |
|
|
@coderabbitai review |
|
|
@coderabbitai review |
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai full review |
|
|
@coderabbitai review |
|
|
@coderabbitai review |
|
|
@coderabbitai review |
|
|
@coderabbitai review |
|
|
@coderabbitai review |
|
|
@coderabbitai review |
|
|
@coderabbitai review |
|
|
@coderabbitai review |
|
|
@coderabbitai review |
|
|
@coderabbitai review |
|
|
@coderabbitai review |
|
A function whose deploy date is missing or unreadable was compared as current, so a stale function could pass unnoticed. It is now listed as changed with "deploy date unknown". The report label read the linked ref file, but the Supabase CLI prefers SUPABASE_PROJECT_ID over it, so the label could name a different project than the one inspected. The label now follows the CLI's order. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
@coderabbitai review |
|
|
@coderabbitai review |
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
Brings in #79 to #83 and #85. Conflict in .superset/db-gate.sh: both sides added a function to the readiness loop. The loop now waits for both `voice` and `account`. #82 replaced the "Which debate is this for?" dialog with the first-debate offer when no debate is current. e2e/voice-rounds.spec.ts still clicked the old button in two places, so it answers the new offer the way e2e/sparring.spec.ts does. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
What
npm run backend:statusshows what the current commit has that a Supabase project lacks. Vercel ships the frontend on merge, but migrations and Edge Functions are deployed by hand. On 2026-09-30 production lacked two migrations and ran pre-#75 functions, and nothing in the repo would have shown it.It runs
supabase migration listandsupabase functions list, nothing else, and compares their output with the tree committed atHEAD. It reports:_shared/);verify_jwtthat differs fromsupabase/config.toml;Flags:
--project-ref <ref>targets another project (the staging work in plan item 8 uses this), and--checkexits 1 when a migration is not applied. Exit 2 means the check itself failed. CLI errors are shown with connection-string passwords redacted.docs/operations.mdgains a "Backend drift check" section and makes the command step 1 of every backend deploy.supabase/README.mdandAGENTS.mdpoint to it.Not done: the prod-canary step
I did not add a
prod-canary.ymlstep.--checkis ready for one, but it would need a Supabase access token and database access in Actions, which is a production credential. That's Adam's decision.Evidence
src/test/scripts/backend-status.test.ts(5 tests) builds a throwaway git repo with dated commits and a fakesupabasebinary. It checks the report, that only the two list commands are called (with--linkedby default,--project-refwhen given), the--checkexit codes, argument rejection and redaction. Flipping the staleness comparison makes it fail.npm run docs:check,npm run lint,npm run typecheckandnpm test -- --coverage(110 files, 1112 tests) all pass.fe6100a: 38 of 38 migrations applied, 12 of 13 functions deployed. The missing one isworkspace-invites, which is expected because Collaborative Workspace is hidden.stripe-webhookwas deployed 2026-05-20 and changed onmainon 2026-08-21 (12951b6). Staging's webhook is stale. I have not redeployed it.🤖 Generated with Claude Code
Summary by CodeRabbit