feat: add guarded dirty migration repair#7
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new guarded “repair dirty metadata” workflow to the migration CLI/driver surface so operators can safely repair a known dirty golang-migrate metadata state (with typed confirmation, exact-version guardrails, and optional follow-up up).
Changes:
- Add
repair-dirtysubcommand to the shared Cobra CLI (and expose it in plugin metadata). - Implement
Driver.RepairDirtyin theinternal/golangmigratedriver with exact dirty-version guard + forward-force rejection + optionalThenUpwith partial-status reporting on failure. - Add CLI + driver tests and update standalone usage comment + changelog entry.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| plugin.json | Exposes repair-dirty in plugin CLI subcommands metadata. |
| pkg/cli/root.go | Adds repair-dirty Cobra subcommand and dispatch to driver via type assertion. |
| pkg/cli/root_test.go | Adds coverage for presence, confirmation gating, version parsing failures, and unsupported-driver rejection. |
| internal/golangmigrate/driver.go | Adds RepairDirtyOptions + RepairDirty() implementation with validation/guardrails and optional ThenUp. |
| internal/golangmigrate/driver_test.go | Adds integration-style tests covering guards, forward-force rejection, ThenUp, and partial-status error reporting. |
| cmd/workflow-migrate/main.go | Updates usage comment to include repair-dirty. |
| CHANGELOG.md | Documents the newly added workflow-migrate repair-dirty command. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Adds a new guarded “repair-dirty” workflow to safely fix a known dirty golang-migrate metadata state (with typed confirmation and strict version checks), with optional follow-up --then-up, and exposes it through both the standalone CLI and plugin metadata.
Changes:
- Introduce
repair-dirtyCobra command (typed confirmation, driver gating,--then-upsupport). - Implement
Driver.RepairDirtyin the golang-migrate driver with exact dirty-version guarding, source version validation, and forward-force rejection. - Add CLI + driver integration tests, plus documentation/metadata updates (plugin.json, changelog, main usage header).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| plugin.json | Exposes repair-dirty in plugin command metadata. |
| pkg/cli/root.go | Wires in the repair-dirty command and executes guarded repair via the driver. |
| pkg/cli/root_test.go | Adds CLI-level tests for command presence, confirmation requirement, validation, and driver support gating. |
| internal/golangmigrate/driver.go | Adds RepairDirty implementation and supporting option/parse helpers. |
| internal/golangmigrate/driver_test.go | Adds Postgres-backed tests for exact-guard behavior, then-up behavior, and partial status reporting on failure. |
| cmd/workflow-migrate/main.go | Updates the usage header comment to include repair-dirty. |
| CHANGELOG.md | Documents the new workflow-migrate repair-dirty command and behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Verification
Review