Repository navigation
fix(cli): skip the contrib_regression clone on pg-delta shadows - #6920
Conversation
pg-delta never connects to that database. Cloning it with CREATE DATABASE TEMPLATE crashes OrioleDB when the baseline has an enum-indexed table.
There was a problem hiding this comment.
🤖 AI Review
Both independent reviews completed. Code inspection supports the intended engine split: pg-delta skips contrib_regression, while legacy replay preserves it. Two Claude findings are confirmed as optional polish; the snapshot-ordering documentation finding is refuted. Codex reported no findings. No functional defect identified; tests were inspected but not executed.
Findings
| Severity | Location | Category | Sources | Claim |
|---|---|---|---|---|
| ⚪ NIT | apps/cli/src/command-internal/db-bootstrap/shadow-database.ts:660 |
api-design |
claude | The new positional boolean makes the next-engine helper call less self-describing. |
| ⚪ NIT | apps/cli/src/command-internal/db-bootstrap/shadow-database.ts:464 |
documentation |
claude | The template helper's comment overgeneralizes that warm shadow-cache hits must still create contrib_regression. The targetUrlOverride comment also omits an explicit legacy-engine qualifier. |
Findings outside the diff
- ⚪ NIT
apps/cli/src/command-internal/db-bootstrap/shadow-database.ts:464— The template helper's comment overgeneralizes that warm shadow-cache hits must still create contrib_regression. The targetUrlOverride comment also omits an explicit legacy-engine qualifier.
Refuted findings (kept for transparency, not posted as review comments)
apps/cli/src/command-internal/db-bootstrap/shadow-database.ts:629(documentation): The snapshotBaseline documentation is stale because it still describes running before the template database and user migrations, although pg-delta now skips the template database.
Refuted: The shared interface documents ordering, without promising every consumer performs both later steps. Legacy replay still snapshots at line 695 before template creation at 714 and migrations at 716. Next-engine replay passes false at 760, omitting the template while preserving snapshot-before-migrations ordering. Returning after a setup-only snapshot does not contradict that invariant.
Stats
Claude findings: 3 · Codex findings: 0 · Confirmed: 2 · Refuted: 1 · Uncertain: 0
Models: claude-opus-5-5 + gpt-6.1-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 shadow changes look correct. pg-delta shadows only use postgres, and the contrib_regression override is still limited to the legacy/migra path. One formatting issue in the test file fails the code-quality check and needs fixing before merge.
The pg-delta caller passes createTemplateDatabase: false instead of a bare boolean, and oxfmt accepts the shortened test title.
TL;DR
pg-delta shadow databases no longer run
CREATE DATABASE contrib_regression TEMPLATE postgres. That clone crashes OrioleDB when the platform baseline contains an enum-indexed OrioleDB table, and the crash takes down the whole shadow. Migra still creates the database, because it uses it as the declarative diff target.Before
After
Why
On an OrioleDB image,
CREATE DATABASE … TEMPLATEsegfaults when the template has an OrioleDB index on an enum column. A fresh Supabase database has one:auth.one_time_tokens_user_id_token_type_key. Shadow setup then fails with a connection error. pg-delta never connects tocontrib_regression.What changed
contrib_regression. A warm cache hit does not connect just to create it.postgresand skips the clone.contrib_regression.