Repository navigation
Conversation
CLI benchmark (Lightweight Commands): no changes foundCommit
API calls: unchanged for all 9 commands. Binary size: 135.7 MB, unchanged. Details: timing ranges, API calls per command, slowest phasesTiming ranges
API calls per command
Slowest phasesNo command moved beyond noise, so there are no phase deltas. Comment |
There was a problem hiding this comment.
🤖 AI Review
CLI reference prose guidance: snapshot supabase/supabase@cebd7a5 supplied to reviewers (advisory, not a style pass).
Both independent reviews were available. Code inspection confirmed five distinct findings. The destructive-change hint can apply destructive SQL during a rerun intended to write a migration for review. Check mode silently ignores explicit apply and file options, and the tests omit the --exit-code --apply combination. The remaining findings concern the check-mode SQL heading and the new flag help. The reference overlay still describes the default workflow.
Findings
| Severity | Location | Category | Sources | Claim |
|---|---|---|---|---|
| 🟡 MINOR | apps/cli/src/commands/db/schema/declarative/sync/sync.handler.ts:471 |
error-handling |
codex | Following the destructive-change hint to write a migration for review can immediately apply destructive SQL to the local database if the rerun keeps --apply or --yes. |
| 🟡 MINOR | apps/cli/src/commands/db/schema/declarative/sync/sync.handler.ts:475 |
flag-validation |
claude | --exit-code accepts and silently overrides --apply, --name, and --file, so a caller can request a migration file or local apply and receive only a check result. |
| 🟡 MINOR | apps/cli/src/commands/db/schema/declarative/sync/sync.integration.test.ts:1458 |
test-coverage |
codex | The check-mode regression test leaves the precedence of --exit-code over explicit --apply untested. |
| ⚪ NIT | apps/cli/src/commands/db/schema/declarative/sync/sync.handler.ts:476 |
ux |
claude | Check-mode output labels the preview Generated migration SQL: and leaves users to infer whether a migration file was created. |
| ⚪ NIT | apps/cli/src/commands/db/schema/declarative/sync/sync.command.ts:62 |
docs-style |
codex | The new --exit-code help puts the error status in parentheses and omits the Oxford comma. |
Stats
Claude findings: 2 · Codex findings: 3 · Confirmed: 5 · Refuted: 0 · Uncertain: 0
Models: claude-opus-5-5 + gpt-6.2-sol · Trigger: auto · Workflow run
This review runs once per PR. A maintainer can request another with a /ai-review comment.
jgoux
left a comment
There was a problem hiding this comment.
The exit-code contract works: 0 when nothing changed, 1 on errors, 2 when changes are found. Every prompt, bootstrap, repair, write, and apply path is gated before the early return, and --fail-on-destructive still takes precedence. One gap against the linked issue and one design note are inline.
TL;DR
adds
--exit-codetodb schema declarative syncso CI can fail on schema changes without writing a migration.whats introduced?
supabase db schema declarative sync --exit-codeplans as usual and prints the SQL, then exits 2 when the schema files and migrations differ and 0 when they match. errors keep exiting 1, the same split asconfig diff --exit-code.with
--output-format jsonit also printschanged,sqlanddestructiveon stdout, so CI can read the result without parsing stderr.with the flag sync writes no migration, applies nothing and never prompts. a missing schema or a compatibility repair exits 1 instead of offering to generate, stage or reset, even with
--yes.the flag is off by default, so runs without it behave exactly as before.
why?
sync exited 0 both when nothing changed and when it wrote a new migration, and
--output-format jsonprinted nothing either way, so a CI check had to grep theNo schema changes foundline and still got a new migration file in its checkout on every change.ref