-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Refactor KibanaMigrator, improve readability, maintainability and UT #155693
Refactor KibanaMigrator, improve readability, maintainability and UT #155693
Conversation
Pinging @elastic/kibana-core (Team:Core) |
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.
nice cleanup!
LGTM
// .kibana_task_manager migrator is NOT involved in relocation, must not sync | ||
expect(logs).toMatch('[.kibana_task_manager] LEGACY_REINDEX_WAIT_FOR_TASK -> LEGACY_DELETE.'); | ||
expect(logs).toMatch('[.kibana_task_manager] CREATE_REINDEX_TEMP'); | ||
// .kibana_task_manager migrator is NOT involved in relocation, must not sync with others |
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.
Thanks for leaving that comment here!
@@ -69,4 +69,4 @@ export type { | |||
SavedObjectAttributes, | |||
SavedObjectAttributeSingle, | |||
SavedObjectReference, | |||
} from '@kbn/core-saved-objects-common/src/server_types'; |
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.
You're importing the client-side, deprecated versions by doing so.
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.
Nice catch, will undo these changes!
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
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: |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…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
…nd UT (#155693) (#158953) # Backport This will backport the following commits from `main` to `8.8`: - [Refactor KibanaMigrator, improve readability, maintainability and UT (#155693)](#155693) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Gerard Soldevila","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-06-01T12:47:40Z","message":"Refactor KibanaMigrator, improve readability, maintainability and UT (#155693)\n\nAddresses the following feedback:\r\nhttps://github.com//pull/154151#discussion_r1158470566\r\n\r\nSimilar to what has been done for ZDT, the goal of this PR is to extract\r\nthe logic of the `runV2Migration()` from the `KibanaMigrator` into a\r\nseparate file.\r\n\r\nThe PR also fixes some incomplete / incorrect UTs and adds a few missing\r\nones.","sha":"06c337f903a5b310f8a21a66065b186bbbc9642e","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Core","enhancement","technical debt","release_note:skip","backport:skip","Feature:Migrations","Epic:KBNA-7838","v8.9.0"],"number":155693,"url":"https://github.com/elastic/kibana/pull/155693","mergeCommit":{"message":"Refactor KibanaMigrator, improve readability, maintainability and UT (#155693)\n\nAddresses the following feedback:\r\nhttps://github.com//pull/154151#discussion_r1158470566\r\n\r\nSimilar to what has been done for ZDT, the goal of this PR is to extract\r\nthe logic of the `runV2Migration()` from the `KibanaMigrator` into a\r\nseparate file.\r\n\r\nThe PR also fixes some incomplete / incorrect UTs and adds a few missing\r\nones.","sha":"06c337f903a5b310f8a21a66065b186bbbc9642e"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/155693","number":155693,"mergeCommit":{"message":"Refactor KibanaMigrator, improve readability, maintainability and UT (#155693)\n\nAddresses the following feedback:\r\nhttps://github.com//pull/154151#discussion_r1158470566\r\n\r\nSimilar to what has been done for ZDT, the goal of this PR is to extract\r\nthe logic of the `runV2Migration()` from the `KibanaMigrator` into a\r\nseparate file.\r\n\r\nThe PR also fixes some incomplete / incorrect UTs and adds a few missing\r\nones.","sha":"06c337f903a5b310f8a21a66065b186bbbc9642e"}}]}] BACKPORT--> --------- Co-authored-by: kibanamachine <[email protected]>
Addresses the following feedback:
#154151 (comment)
Similar to what has been done for ZDT, the goal of this PR is to extract the logic of the
runV2Migration()
from theKibanaMigrator
into a separate file.The PR also fixes some incomplete / incorrect UTs and adds a few missing ones.