feat: improve redis migration flow#618
Merged
Merged
Conversation
alexluong
commented
Jan 13, 2026
Collaborator
- add tests
- support --all flag to apply all pending migrations
- support IsApplicable mechanism
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
alexbouchardd
approved these changes
Jan 13, 2026
4e10acb to
231b901
Compare
Add baseline tests for Redis migration runner with mock migrations. Tests cover: - GetPendingMigrations: pending list accuracy and metadata - Fresh installation: skip execution on empty Redis - Existing installation: auto-runnable execution, version ordering, failure handling, skip already applied - Data detection: outpost:* and tenant:* key patterns
Tests for the CLI Migrator (cmd/outpost-migrate-redis): - Apply next pending migration - Apply specific migration by name - Confirmation prompts (autoApprove, rejection) - Error handling (plan failure, apply failure) - Migration marked as applied after success - Plan command - Verify command
Adds batch migration support to the CLI: - `apply --all` runs all pending migrations in sequence - Each migration is verified after application before proceeding - Stops immediately on any failure (apply or verification) - Shows progress [1/N], [2/N], etc. Also refactors Apply/ApplyOne: - Apply(ctx, autoApprove) - batch mode for all pending - ApplyOne(ctx, autoApprove, rerun, name) - single migration Includes tests for the new batch functionality: - applies all pending migrations in order - stops on migration failure - stops on verification failure - marks all migrations as applied
Adds applicability checks so migrations can declare themselves as "not needed" based on configuration: - Add IsApplicable(ctx) (bool, string) to Migration interface - 001_hash_tags returns false when DEPLOYMENT_ID is set (hash tags already in place) - 002_timestamps and 003_entity always return true Migration status handling: - New status: "not_applicable" alongside "applied" - isSatisfied() checks both statuses for startup/CLI checks - Non-applicable migrations don't block init --current Includes tests for: - Runner marks non-applicable as not_applicable - CLI Apply skips and marks non-applicable migrations - Subsequent runs skip already-marked migrations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.