Repository navigation
UNOMI-998: Cover a 3.0 to 4.0 migration in the integration tests - #910
Merged
Merged
Conversation
Add a synthetic 3.0 seed that runs unomi:migrate before Unomi starts, and correct the tenant API key file header names written by the migration.
Clear open context-* indices before the 1.6 snapshot restore, and mirror OpenSearch connection settings into the elasticsearch.* keys that migration.cfg uses so unomi:migrate does not hit localhost:9200.
Contributor
Author
|
CI diagnosis and follow-up push ( Elasticsearch job: OpenSearch job: Fix: delete existing |
Clear the migration history between migration ITs so the 1.6 run no longer skips the 4.0.0 steps, and check what the migration itself wrote before Unomi starts and redeploys definitions and the test tenant. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…clone The reindex script sees the "-cloned" source index in ctx._index, so the systemitems and geonameentry checks never matched during a real migration. Strip the suffix before testing the index name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Started by the 3.0 migration test, Unomi kept running on indices that the 1.6 test then deletes and restores, and never redeployed its definitions and schemas. Where the snapshot migration runs next, the 3.0 test now only checks the migrated indices. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GitHub's runner image now ships Maven 3.10.0, on which extension 2.5.0 fails with an internal error before the build starts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
The existing migration test starts from a 1.6 snapshot with the full feature set already installed. That setup did not catch the 3.0 upgrade problems fixed in UNOMI-996 and UNOMI-997. This PR adds an integration test that seeds a small synthetic 3.0 data set over HTTP, runs
unomi:migrate 3.0.0before Unomi starts, then checks the post-migration shape.What changed
Migrate30ToCurrentVersionIT, registered first inAllITs/CorePersistenceITsso it runs before the 1.6 snapshot restore.booleanConditionwins over the seeded 3.0 marker; migration-mappings are present in the shell-commands bundle; the API key file names the real headers.initialize_tenant_and_audit_fields.painless: during the migration reindexctx._indexis the-clonedsource index, so the-systemitems/-geonameentrychecks never matched. System items whose id lacked the_itemtypesuffix did not get it, and geonames were not skipped for audit fields. The suffix is now stripped before the checks.system, default tenant document) run before Unomi starts, since startup redeploys definitions andBaseITcreates the test tenant.data/migration/history.jsonfirst, soMigrate16xToCurrentVersionITno longer skips the 4.0.0 steps after this test has run.OpenSearchITBackendmirrors its connection settings into theorg.apache.unomi.elasticsearch.*properties, whichorg.apache.unomi.migration.cfgreads.Migrate16xToCurrentVersionITrestores its snapshot next, this test leaves Unomi stopped and only checks the migrated indices; the two checks that need a running Unomi (tenant viatenantService, 4.0booleanConditionwinning) run on OpenSearch only.migrate-4.0.0-10-tenantInitialization.groovy(X-Unomi-Api-Key/ Basic auth) so it matches what Unomi actually accepts.Test plan
./build.sh --skip-unit-tests --no-javadoc --no-clean --integration-tests --single-test org.apache.unomi.itests.migration.Migrate30ToCurrentVersionIT