-
Notifications
You must be signed in to change notification settings - Fork 8.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[8.8] Refactor KibanaMigrator, improve readability, maintainability and UT (#155693) #158953
Conversation
…lastic#155693) Addresses the following feedback: elastic#154151 (comment) Similar to what has been done for ZDT, the goal of this PR is to extract the logic of the `runV2Migration()` from the `KibanaMigrator` into a separate file. The PR also fixes some incomplete / incorrect UTs and adds a few missing ones. (cherry picked from commit 06c337f) # Conflicts: # packages/core/saved-objects/core-saved-objects-migration-server-internal/src/kibana_migrator.test.ts # packages/core/saved-objects/core-saved-objects-migration-server-internal/src/kibana_migrator.ts # packages/core/saved-objects/core-saved-objects-migration-server-internal/src/run_resilient_migrator.ts # src/core/server/integration_tests/saved_objects/migrations/kibana_migrator_test_kit.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tiny nits but these don't need to go into this PR. I can go back after the fact and fix them.
options.logger.debug(`migrationVersion: ${migrationVersion} saved object type: ${type}`); | ||
}); | ||
|
||
// build a indexTypesMap from the info present in tye typeRegistry, e.g.: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo:
// build a indexTypesMap from the info present in tye typeRegistry, e.g.: | |
// build a indexTypesMap from the info present in typeRegistry, e.g.: |
|
||
// build a list of all migrators that must be started | ||
const migratorIndices = new Set(Object.keys(indexMap)); | ||
// indices involved in a relocation might no longer be present in current mappings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super nit: This sentence is confusing to me.
// indices involved in a relocation might no longer be present in current mappings | |
// the types in indices involved in relocation might not have mappings in the current mappings anymore |
|
||
// compare indexTypesMap with the one present (or not) in the .kibana index meta | ||
// and check if some SO types have been moved to different indices | ||
const indicesWithMovingTypes = await getIndicesInvolvedInRelocation({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: consistent naming
const indicesWithMovingTypes = await getIndicesInvolvedInRelocation({ | |
const indicesWithRelocatingTypes = await getIndicesInvolvedInRelocation({ |
@gsoldevila From what I can see, the failures are from a type issue: Lines 40 to 42 in b7064bd
|
Thanks for the heads up! It seems like I backported that property and I shouldn't have. Fixing |
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Public APIs missing exports
Unknown metric groupsAPI count
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
Feedback addressed in #158940 |
Backport
This will backport the following commits from
main
to8.8
:Questions ?
Please refer to the Backport tool documentation