Repository navigation
fix(update): honor server recovery captures in supervised migrations - #198435
qingminglong wants to merge 1 commit into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesThis PR makes supervised migration honor the existing PostgreSQL server-recovery-capture setting. Example: Run supervised migration with database.postgres.recoveryCaptures set to "server" and a PostgreSQL Workboard store.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness⛔ Blocked before merge - 5 items remain Keep open: the omitted option is a real current-main bug, but enabling server captures without retiring them leaks PostgreSQL schemas after successful supervised updates. Priority: P2 Before merge
Findings
Provenance
Tests
Agent review detailsHow this fits togetherThe supervised update CLI captures configuration and databases before candidate Doctor migration, records a recovery receipt, and later restores or retires those captures. flowchart TD
A[Configured recovery policy] --> B[Supervised migrate command]
B --> C[Database backup owner]
C --> D[Portable state capture]
C --> E[PostgreSQL server capture]
D --> F[Recovery receipt]
E --> F
F --> G[Restore or finish]
Technical reviewBest possible solution: Complete supervised capture retirement through the existing PostgreSQL cleanup owner, preserving manifests on failure and scoping the fix to the verified capture-policy bug. Do we have a high-confidence way to reproduce the issue? Current main omits the option that selects server captures, and #198401 supplies matching real-run observations; no target code was executed during this review. Is this the best way to solve the issue? Forwarding the existing setting is appropriate, but the smallest complete fix also connects supervised finish to existing schema retirement rather than adding another cleanup mechanism. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against fa155ff6f53e. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +4, Tests +31. Total +35 across 2 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 13, 2026, 3:22 PM ET / 20:22 UTC. |
|
Thanks @qingminglong — forwarding I've carried your commit unchanged, with your authorship, into #198469, which adds the finish-time retirement plus tests. Once that lands I'll close this one in its favor. Also, this fixes #198401; it doesn't establish a fix for #198334, so that issue stays open. |
|
Thanks for the work here. We're closing this: it doesn't show a real user-facing problem (no report from an affected user and no natural reproduction), and it follows a pattern of small, speculative or duplicate changes split across many PRs. Please open an issue with a reproduction of real harm first; a fix can follow once the problem is confirmed. |
Closes #198334
What Problem This Solves
Fixes: during a supervised migration (
oc updatemigrate path), the database backup is created without thepostgresSchemaCapturessetting, so a configuration withdatabase.postgres.recoveryCaptures: "server"produces local exports for non-state PostgreSQL stores and leaves behind an ambiguous recovery set instead of the server captures the recovery inventory expects.User Impact
When recovery captures are configured as
server, a supervised migration now backs up non-state PostgreSQL stores on the database (server captures), matching what the native update path already does and what the recovery inventory expects to find. No configuration change, migration, or user action is required; behavior is unchanged for every otherrecoveryCapturessetting.Why This Change Was Made
The native update path passes
postgresSchemaCaptures: source.config.database?.postgres?.recoveryCaptures === "server"tocreateUpdateDatabaseBackup, but the supervised migration path (updateMigrateCommand) omitted the flag entirely. The two paths therefore disagreed about where non-state PostgreSQL stores live after a backup: the migration wrote local exports while recovery tooling expected server captures, which surfaces as ambiguous recovery sets and failed Doctor finalization during update repair. The fix forwards the same flag from the same config source, restoring parity between the two update paths; no other backup options or migration steps are touched.Evidence
src/cli/update-cli/update-command-migrate.test.tsfail on main (expectedpostgresSchemaCaptures === true, receivedundefined) and pass with the fix. Command:node scripts/run-vitest.mjs run src/cli/update-cli/update-command-migrate.test.ts— before: 2 passed / 16 failed; after: 4 passed / 16 failed (the same 16 failures, unchanged).FsSafeErrorpath-mismatch, alinkedomentities/decodeexport resolution error) on this Windows contributor machine; the failing set is byte-identical across the red and green runs, which is the relevant comparison.createUpdateDatabaseBackupreceivespostgresSchemaCaptures: truewhenrecoveryCaptures: "server"in both server and portable configurations; on main the option arrives asundefined, with the fix it arrives astrue.update-command-migrate.ts, 4 added lines forwarding the existing config flag) plus two regression test cases (31 added test lines). The native update path, backup implementation, and all other migration steps are untouched.oc.sh check— oxlint 0 errors on changed files;tsgo -p tsconfig.core.jsonreports 63 errors vs the documented 64-error baseline (none in changed files); test-lines ratchet vsupstream/mainpasses.