Skip to content

feat: add guarded dirty migration repair#7

Merged
intel352 merged 3 commits into
mainfrom
feat/repair-dirty-migration
Apr 26, 2026
Merged

feat: add guarded dirty migration repair#7
intel352 merged 3 commits into
mainfrom
feat/repair-dirty-migration

Conversation

@intel352
Copy link
Copy Markdown
Contributor

Summary

  • add workflow-migrate repair-dirty for exact dirty-version metadata repair
  • require typed confirmation, source/version validation, and reject forward force targets
  • support then-up and report final status if follow-up migration fails
  • expose the command in plugin metadata and standalone usage docs

Verification

  • GOWORK=off go test ./pkg/cli -run 'Force|RepairDirty' -count=1
  • GOWORK=off go test ./internal/golangmigrate -run 'UpDownStatus|RepairDirty' -count=1
  • git diff --check
  • GOWORK=off go test ./... -count=1

Review

  • Antagonistic code review: SHIP-IT after fixes for forward-force rejection, exact guard coverage, and partial then-up status reporting.

Copilot AI review requested due to automatic review settings April 26, 2026 21:28
Comment thread internal/golangmigrate/driver.go Fixed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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-dirty subcommand to the shared Cobra CLI (and expose it in plugin metadata).
  • Implement Driver.RepairDirty in the internal/golangmigrate driver with exact dirty-version guard + forward-force rejection + optional ThenUp with 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.

Comment thread internal/golangmigrate/driver.go Outdated
Copilot AI review requested due to automatic review settings April 26, 2026 21:35
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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-dirty Cobra command (typed confirmation, driver gating, --then-up support).
  • Implement Driver.RepairDirty in 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.

@intel352 intel352 merged commit 02727c8 into main Apr 26, 2026
10 checks passed
@intel352 intel352 deleted the feat/repair-dirty-migration branch April 26, 2026 21:38
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.

3 participants