Skip to content

Remove the --strict flag#910

Merged
morgo merged 3 commits into
block:mainfrom
morgo:remove-strict-mode
Jun 9, 2026
Merged

Remove the --strict flag#910
morgo merged 3 commits into
block:mainfrom
morgo:remove-strict-mode

Conversation

@morgo

@morgo morgo commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Fixes #909.

Summary

Removes the --strict migration flag (and the Migration.Strict field) entirely. This is the strict-removal portion of #879, forked out into its own change so it can land independently of the status-API work in that PR.

With --strict gone, a failed resume-from-checkpoint always logs the reason and falls back to a fresh migration — Spirit's default best-effort behavior. The flag was already documented as not-recommended and had a surprising gap (it does not hard-fail on a checkpoint-table schema mismatch), so it was a footgun rather than a safety net. See #909 for the full rationale.

Changes

  • Remove the --strict CLI flag / Migration.Strict field (pkg/migration/migration.go)
  • Remove the strict branch in setup() and update a stale comment (pkg/migration/runner.go)
  • Remove the WithStrict() test helper (pkg/migration/helpers_test.go) and the four TestResumeFromCheckpoint*Strict* tests (pkg/migration/resume_test.go)
  • Remove the --strict documentation in docs/migrate.md and pkg/migration/resume-from-checkpoint.md
  • Drop the WithStrict() reference in AGENTS.md

The typed status.Err* resume errors (ErrMismatchedAlter, ErrBinlogNotFound, ErrCheckpointTooOld, ErrCheckpointCollision) are retained — they are still produced and logged internally; only the strict consumer of them is removed.

Breaking change

Anyone passing --strict will now get a Kong error on the unknown flag.

🤖 Generated with Claude Code

Removes the --strict CLI flag and the Migration.Strict field, along with
the strict branch in setup(), the WithStrict() test helper, the four
TestResumeFromCheckpoint*Strict* tests, and the corresponding sections of
docs/migrate.md and resume-from-checkpoint.md.

With --strict gone, a failed resume-from-checkpoint always logs the reason
and falls back to a fresh migration. The typed status.Err* values
(ErrMismatchedAlter, ErrBinlogNotFound, ErrCheckpointTooOld,
ErrCheckpointCollision) are still produced and logged internally; only the
strict consumer of them is removed.

This is a breaking change for anyone passing --strict: Kong will error on
the unknown flag. Per prior discussion the flag was already not-recommended.

Forked out of block#879.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@morgo morgo mentioned this pull request Jun 9, 2026
5 tasks
@morgo morgo requested a review from Copilot June 9, 2026 19:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Removes Spirit’s --strict migration mode end-to-end (CLI surface, Migration config, runner behavior branch, tests, and documentation) so resume-from-checkpoint is always best-effort: on any resume failure, Spirit logs the reason and falls back to starting a fresh migration.

Changes:

  • Deleted the --strict CLI flag and Migration.Strict field, and removed the strict-only error-return branch in Runner.setup().
  • Removed strict-mode test helper and strict-only resume tests; adjusted remaining resume tests/comments to match best-effort semantics.
  • Updated docs to remove strict-mode guidance and describe the single fallback behavior.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/migration/runner.go Removes strict-mode branching in setup and updates resume-related comments.
pkg/migration/resume-from-checkpoint.md Updates checkpoint resume docs to reflect always-best-effort behavior and removes strict-mode section.
pkg/migration/resume_test.go Deletes strict-mode resume tests and updates remaining test comments accordingly.
pkg/migration/migration.go Removes the Strict field / --strict flag definition from the migration config struct.
pkg/migration/helpers_test.go Removes WithStrict() test helper.
docs/migrate.md Removes --strict documentation and updates resume-related text to match new behavior.
AGENTS.md Removes WithStrict() from the documented test runner options list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/migration/runner.go
Comment thread docs/migrate.md
@morgo morgo enabled auto-merge June 9, 2026 20:44
@morgo morgo merged commit 46f309d into block:main Jun 9, 2026
12 checks passed
@morgo morgo deleted the remove-strict-mode branch June 9, 2026 21:05
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.

Remove the --strict flag

3 participants