Skip to content

test(cli): cover migration up and repair (CLI-2269) - #6376

Open
7ttp wants to merge 4 commits into
developfrom
7ttp/cli-2269-migration-command-family-coverage
Open

test(cli): cover migration up and repair (CLI-2269)#6376
7ttp wants to merge 4 commits into
developfrom
7ttp/cli-2269-migration-command-family-coverage

Conversation

@7ttp

@7ttp 7ttp commented Aug 28, 2026

Copy link
Copy Markdown
Member

TL;DR

adds live e2e coverage for migration up and migration repair, closing the migration family...

whats introduced?

  • migration up: applies a test written migration to the remote database, proven by the apply banner and the history row migration list reads back
  • migration repair: inserts a history row with status applied, proves it through migration list, then removes it with status reverted and proves the absence

ref:

  • closes: CLI-2269

@7ttp 7ttp self-assigned this Aug 28, 2026
@7ttp
7ttp requested a review from a team as a code owner August 28, 2026 11:13

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: baa11077ba

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread apps/cli/src/legacy/commands/migration/up/up.live.test.ts Outdated
@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Supabase CLI preview

npx --yes https://pkg.pr.new/supabase/cli/supabase@a8a869c24184bcc14d530f5bcc9ba46fec102142

Preview package for commit a8a869c.

@avallete

Copy link
Copy Markdown
Member

/ai-review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Superseded by a newer AI review

🤖 AI Review

Both independent reviews completed. The PR only adds two live tests. Six findings are confirmed: one documented live-test convention violation, two test reliability/coverage gaps, and three nits. The claimed redundant file-cleanup error handling is refuted because it handles non-ENOENT failures and allows subsequent cleanup to continue.

Findings

Severity Location Category Sources Claim
🟡 MINOR apps/cli/src/legacy/commands/migration/repair/repair.live.test.ts:38 test-conventions claude Both new live tests assert output from migration list even though trusted repository policy requires assertions to remain focused on the command under test.
🟡 MINOR apps/cli/src/legacy/commands/migration/up/up.live.test.ts:23 test-reliability claude The migration up test depends on the shared project's remote migration history containing no version other than its single local migration, allowing leaked state from an earlier test to cause a cascading missing-local failure.
🟡 MINOR apps/cli/src/legacy/commands/migration/up/up.live.test.ts:30 test-coverage codex The live test can pass without proving that migration up executed the migration's SQL statements.
⚪ NIT apps/cli/src/legacy/commands/migration/repair/repair.live.test.ts:18 clarity claude The repair test writes table-creation SQL that is stored in migration history but never executed, without documenting that behavior.
⚪ NIT apps/cli/src/legacy/commands/migration/repair/repair.live.test.ts:58 test-quality claude The repair test performs a redundant third migration repair --status reverted subprocess on its successful path.
⚪ NIT apps/cli/src/legacy/commands/migration/up/up.live.test.ts:12 duplication claude The PR adds another inline copy of a migration-version generator that is already duplicated across live tests.
Refuted findings (kept for transparency, not posted as review comments)
  • apps/cli/src/legacy/commands/migration/up/up.live.test.ts:34 (redundancy): The migration-file cleanup and its try/catch are redundant because force: true suppresses missing-file errors and the workspace fixture later deletes the entire temporary directory.
    Refuted: force: true suppresses only a missing-path error, not other filesystem failures. The catch records those failures and, importantly, permits the database cleanup at lines 39-64 to continue; relying on the later fixture cleanup does not provide that sequencing or aggregation.

Stats

Claude findings: 6 · Codex findings: 1 · Confirmed: 6 · Refuted: 1 · Uncertain: 0


Models: claude-opus-5 + gpt-5.6-sol · Trigger: manual · Workflow run

This review runs once per PR. A maintainer can request another with a /ai-review comment.

Comment thread apps/cli/src/legacy/commands/migration/repair/repair.live.test.ts Outdated
Comment thread apps/cli/src/legacy/commands/migration/up/up.live.test.ts
Comment thread apps/cli/src/legacy/commands/migration/up/up.live.test.ts Outdated
Comment thread apps/cli/src/legacy/commands/migration/repair/repair.live.test.ts
Comment thread apps/cli/src/legacy/commands/migration/repair/repair.live.test.ts Outdated
Comment thread apps/cli/src/legacy/commands/migration/up/up.live.test.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9499bdb509

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread apps/cli/tests/helpers/live.ts
Comment thread apps/cli/src/legacy/commands/migration/repair/repair.live.test.ts Outdated
Comment thread apps/cli/src/legacy/commands/migration/up/up.live.test.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants