Repository navigation
fix(cli): stop suggesting repair --status applied for unpushed migrations - #7893
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ify reset --last Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
CLI benchmark (Lightweight Commands): no changes foundCommit
API calls: unchanged for all 9 commands. Binary size: 135.7 MB, up 4.0 KB from 135.7 MB. 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@57d40e4 supplied to reviewers (advisory, not a style pass).
The new migration recovery hint can rerun SQL that already ran, direct a push at a different database or project, and update Vault secrets that the dry run does not preview. It also puts live migration-history edits before the push preview. Both independent reviews were available. Static inspection confirmed these risks and found that the new db reset --last help overstates what reset skips when migration versions have mixed widths.
Findings
| Severity | Location | Category | Sources | Claim |
|---|---|---|---|---|
| 🟠 MAJOR | apps/cli/src/command-internal/migration-history.ts:249 |
migration-safety |
codex | The suggested push can rerun SQL for migrations that already ran outside the migration history. |
| 🟠 MAJOR | apps/cli/src/command-internal/migration-history.ts:248 |
migration-safety |
codex | The new push commands can target a different database or read a different checkout when the original pull used --stack or --workdir. |
| 🟡 MINOR | apps/cli/src/command-internal/migration-history.ts:239 |
migration-safety |
codex | The new recovery sequence directs users to delete target-only history entries before showing a push preview, even when those entries represent valid applied migrations. |
| 🟡 MINOR | apps/cli/src/command-internal/migration-history.ts:253 |
correctness |
claude+codex | The hint tells users to verify SQL on a remote database even when the suggested repair will mark it applied on the local database. |
| 🟡 MINOR | apps/cli/src/command-internal/migration-history.ts:248 |
migration-safety |
codex | The suggested live push can update configured Vault secrets even though the hint describes running migration SQL and the dry run does not list those updates. |
| 🟡 MINOR | apps/cli/src/commands/db/reset/reset.command.ts:40 |
correctness |
codex | The new help promises to skip the last n local migrations, but --last can replay every migration when version IDs have mixed widths. |
| ⚪ NIT | apps/cli/src/command-internal/migration-history.unit.test.ts:245 |
test-quality |
codex | The reconciliation and formatter tests both assert the dry-run command for the same kind of historical gap. |
| ⚪ NIT | apps/cli/src/command-internal/migration-history.unit.test.ts:232 |
test-quality |
codex | The command-ordering fixture treats version 111 as both target-only and matched. |
| ⚪ NIT | apps/cli/src/commands/db/reset/reset.command.ts:40 |
docs-style |
codex | The --last description states the intended migration cutoff twice. |
| ⚪ NIT | apps/cli/src/commands/migration/down/down.command.ts:24 |
consistency |
claude | db reset --last now explains which migrations it skips, while migration down --last still leaves it unclear whether n counts versions to keep or revert. |
Findings outside the diff
- ⚪ NIT
apps/cli/src/commands/migration/down/down.command.ts:24—db reset --lastnow explains which migrations it skips, whilemigration down --laststill leaves it unclear whether n counts versions to keep or revert.
Stats
Claude findings: 2 · Codex findings: 6 · Confirmed: 10 · 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.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Ran this against a throwaway staging project: a local-only version newer than the tip gets a plain db push, one older than a matched version gets --include-all, and the suggested commands work as printed. 👍
One small gap: flagsForTarget returns "" for local targets, so after db pull --stack feature the hint prints a bare db push / migration repair, which lands on the default stack rather than feature. The repair lines already had this, so not a blocker, but since you're adding a push line it might be worth carrying --stack <name> through, with a test for it.
Nit: if someone restores a newer remote-only file as the hint suggests, the push then needs --include-all. db push already says so itself, so fine to leave.
avallete
left a comment
There was a problem hiding this comment.
LGTM, the notes above are non-blocking.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Fixes CLI-3310.
🤖 Generated with Claude Code