Repository navigation
Conversation
The apply hint after diff --desired and migrate --desired --dry-run sent readers to hand-run each statement through migrate --alter, losing the plan's order, the fingerprint pin, and the convergence check.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
🤖 Review 1/2 (correctness) of 8ad31f2: 0 blocking, 3 non-blocking. Inspected the whole change at The pointer holds up on every input shape I could reach:
Invariants ( Non-blocking
Test case: a mixed plan (one runnable statement, one refused) drops the apply pointerfunc TestDiffTextMixedRefusedPlanDropsApply(t *testing.T) {
report := desiredReport(false)
report.Statements[0].ExecSQL = []string{report.Statements[0].SQL}
report.Statements[0].Backend = router.BackendNative
report.Statements = append(report.Statements, plan.Statement{
SQL: `ALTER TABLE app.orders ADD COLUMN joined timestamptz DEFAULT now()`,
Route: planner.RouteCopyAndSwap,
Backend: router.BackendCopyAndSwap,
Disposition: router.DispositionUnavailable,
})
report.Disposition = router.DispositionUnavailable
report.Fingerprint = report.ComputeFingerprint()
var out strings.Builder
require.NoError(t, writeDiffText(&out, palette{}, report, diffFraming{desired: "schema/orders.sql"}))
text := out.String()
assert.Contains(t, text, "2 statements, 1 step to run, 1 refused\n")
assert.NotContains(t, text, "apply:")
}Passes on
Verified
This review was generated by Claude Code (claude-sonnet-5-5). |
|
🤖 Review 2/2 (OSS adoption and integration) of 8ad31f2: 0 blocking, 2 non-blocking. Read the change from two seats: a first-time operator who runs Non-blocking
What reads well for adopters
This review was generated by Claude Code (claude-sonnet-5-5). |
aparajon
left a comment
There was a problem hiding this comment.
🤖 Stamping with comments: 0 blocking, 5 non-blocking (see the review comment(s) above).
This stamp was left by Claude Code (claude-sonnet-5-5).
After reviewing a desired-file plan, pg-sprite now tells you to run that plan with
migrate --desired, pinned to the fingerprint it printed, instead of hand-running each statement throughmigrate --alter.Why
pg-sprite can converge a live table onto a desired
CREATE TABLEfile:diff --desired(ormigrate --desired --dry-run) shows the plan, andmigrate --desiredruns it. The report's closingapply:hint was written beforemigrate --desiredexisted and still told readers to paste each statement intomigrate --alterone at a time. Doing that drops the plan's ordering, the fingerprint that guarantees the reviewed plan is the one that runs, and the final check that the table converged, and an agent reading the hint follows it literally.What
apply:entry printspg-sprite migrate --schema <schema> --desired <file>with the file and schema flags the plan was derived under (--extension-schema,--foreign-key-schema), plus--expect-fingerprint <fp>when the report prints a fingerprint.--allow-destructive SCHEMA.TABLEfor a plan that drops something,--copy-and-swapand--free-disk SIZEfor a copy-and-swap statement.migrate --desiredcreates the table.migrate --desired --dry-runcloses withdry-run:instead ofdiff:, and itssql:entry points atpg-sprite diff … --sql, sincemigratehas no--sql.Before / after
The README quick start pulls
app.orders, adds a column and an index toschema/orders.sql, and runspg-sprite diff --schema app --desired schema/orders.sql. The statements, plan summary, and fingerprint are unchanged; only theapply:entry differs, and it now names the command that runs this exact plan.The real output prints the command on one unwrapped line so it can be copied whole; it is folded here to fit the diagram.
migrate --schema app --desired schema/orders.sql --dry-runprints the sameapply:entry, withdry-run:in place ofdiff:and asql:entry that points atpg-sprite diff … --sql.