UNOMI-943: Fix 3.1.0 migration resume and document script authoring#810
Merged
Conversation
Hoist rollover alias configuration to a top-level migration step so resume after failure can still configure write aliases. Fail fast in getFileWithoutComments when a bundled resource is missing.
Add a contributor guide covering step tracking, nested performMigrationStep anti-patterns, idempotent transforms, bundled resources, and testing.
Regression test seeds history with a completed outer step and proves nested performMigrationStep never runs on resume. Extract requireResource helper; clean up history.json in MigrationIT finally blocks.
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.
Plain-language summary
Operators who upgrade from Unomi 3.0 to 3.1 run Groovy migration scripts while the server is stopped. If a migration run fails partway through and is resumed, rollover index aliases for events and sessions could stay misconfigured. That breaks new writes after restart.
This change fixes that resume bug and adds a short manual for contributors so future migration scripts avoid the same mistake.
What changed
3.1.0-configure-rollover-aliasesto a top-level migration step inmigrate-3.1.0-01-tenantDocumentIds.groovyso resume after failure still configures event/session write aliases (UNOMI-943).MigrationUtils.getFileWithoutCommentswhen a bundled Painless/JSON resource is missing, with the same message asresourceAsString.writing-migration-scripts.adoc): step tracking, nested-step pitfall, idempotent transforms, testing, and a pre-merge checklist. Link from migrations hub,unomi:migratehelp, and 3.0→3.1 guide.Test plan
mvn -pl tools/shell-commands -am test -Dtest=MigrationUtilsTestMigrate16xToCurrentVersionITmigration chain on ES)References
UNOMI-943