-
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
Update mappings if/when new SO types are introduced #197061
Conversation
Pinging @elastic/kibana-core (Team:Core) |
9448665
to
b07a05c
Compare
6892484
to
d05a3d3
Compare
💚 Build Succeeded
Metrics [docs]
History
|
// compatible migration: ONLY new SO types have been introduced, skip directly to UPDATE_TARGET_MAPPINGS_META | ||
return { | ||
...stateP, | ||
controlState: 'UPDATE_TARGET_MAPPINGS_META', |
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.
your test makes it look like this is working, but I'm unsure when do we actually update the mappings properties
since UPDATE_TARGET_MAPPINGS_META specifically doesn't update the properties https://github.com/elastic/kibana/blob/main/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/next.ts#L240
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.
The mappings properties
are already updated in the UPDATE_SOURCE_MAPPING_PROPERTIES
step:
diffMappings
will yield true
with this PR whenever new types are introduced. This will in turn cause the mappings properties
to be updated straight away in UPDATE_SOURCE_MAPPING_PROPERTIES
, to check if the updates are compatible (aka if ES does not complain). See https://github.com/elastic/kibana/blob/main/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/actions/update_source_mappings_properties.ts#L61
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.
For your peace of mind, I did test this with the integration test below:
expect(mappings.properties?.recent).toEqual({
properties: {
name: {
type: 'keyword',
},
},
});
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.
Yeah I saw the test, so knew I must be missing something, thanks that makes sense!
Starting backport for target branches: 8.15, 8.16, 8.x |
## Summary Addresses elastic/elastic-entity-model#70 Fixes regression introduced in elastic#176803 (cherry picked from commit 8de3636)
💔 Some backports could not be created
Note: Successful backport PRs will be merged automatically after passing CI. Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
…197573) # Backport This will backport the following commits from `main` to `8.16`: - [Update mappings if/when new SO types are introduced (#197061)](#197061) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Gerard Soldevila","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-24T08:21:43Z","message":"Update mappings if/when new SO types are introduced (#197061)\n\n## Summary\r\n\r\nAddresses https://github.com/elastic/elastic-entity-model/issues/70\r\nFixes regression introduced in\r\nhttps://github.com//pull/176803","sha":"8de3636e43be7c874b2c3457f1496a0fc31f224d","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","Team:Core","release_note:skip","v9.0.0","backport:prev-minor","backport:prev-major","v8.16.0","v8.15.3"],"title":"Update mappings if/when new SO types are introduced","number":197061,"url":"https://github.com/elastic/kibana/pull/197061","mergeCommit":{"message":"Update mappings if/when new SO types are introduced (#197061)\n\n## Summary\r\n\r\nAddresses https://github.com/elastic/elastic-entity-model/issues/70\r\nFixes regression introduced in\r\nhttps://github.com//pull/176803","sha":"8de3636e43be7c874b2c3457f1496a0fc31f224d"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.15"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197061","number":197061,"mergeCommit":{"message":"Update mappings if/when new SO types are introduced (#197061)\n\n## Summary\r\n\r\nAddresses https://github.com/elastic/elastic-entity-model/issues/70\r\nFixes regression introduced in\r\nhttps://github.com//pull/176803","sha":"8de3636e43be7c874b2c3457f1496a0fc31f224d"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.15","label":"v8.15.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Gerard Soldevila <[email protected]>
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
## Summary Addresses elastic/elastic-entity-model#70 Fixes regression introduced in elastic#176803 (cherry picked from commit 8de3636) # Conflicts: # src/core/server/integration_tests/saved_objects/migrations/group1/v2_migration.test.ts # src/core/server/integration_tests/saved_objects/migrations/group2/multiple_kb_nodes.test.ts # src/core/server/integration_tests/saved_objects/migrations/kibana_migrator_test_kit.fixtures.ts
## Summary Addresses elastic/elastic-entity-model#70 Fixes regression introduced in elastic#176803 (cherry picked from commit 8de3636) # Conflicts: # src/core/server/integration_tests/saved_objects/migrations/group1/v2_migration.test.ts
…197598) # Backport This will backport the following commits from `main` to `8.15`: - [Update mappings if/when new SO types are introduced (#197061)](#197061) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Gerard Soldevila","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-24T08:21:43Z","message":"Update mappings if/when new SO types are introduced (#197061)\n\n## Summary\r\n\r\nAddresses https://github.com/elastic/elastic-entity-model/issues/70\r\nFixes regression introduced in\r\nhttps://github.com//pull/176803","sha":"8de3636e43be7c874b2c3457f1496a0fc31f224d","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","Team:Core","release_note:skip","v9.0.0","backport:prev-minor","backport:prev-major","v8.16.0","v8.15.3"],"number":197061,"url":"https://github.com/elastic/kibana/pull/197061","mergeCommit":{"message":"Update mappings if/when new SO types are introduced (#197061)\n\n## Summary\r\n\r\nAddresses https://github.com/elastic/elastic-entity-model/issues/70\r\nFixes regression introduced in\r\nhttps://github.com//pull/176803","sha":"8de3636e43be7c874b2c3457f1496a0fc31f224d"}},"sourceBranch":"main","suggestedTargetBranches":["8.15"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197061","number":197061,"mergeCommit":{"message":"Update mappings if/when new SO types are introduced (#197061)\n\n## Summary\r\n\r\nAddresses https://github.com/elastic/elastic-entity-model/issues/70\r\nFixes regression introduced in\r\nhttps://github.com//pull/176803","sha":"8de3636e43be7c874b2c3457f1496a0fc31f224d"}},{"branch":"8.16","label":"v8.16.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/197573","number":197573,"state":"MERGED","mergeCommit":{"sha":"3687435cb4531b1a0470abf42f69a420e2041cd2","message":"[8.16] Update mappings if/when new SO types are introduced (#197061) (#197573)\n\n# Backport\n\nThis will backport the following commits from `main` to `8.16`:\n- [Update mappings if/when new SO types are introduced\n(#197061)](https://github.com/elastic/kibana/pull/197061)\n\n<!--- Backport version: 9.4.3 -->\n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sqren/backport)\n\n<!--BACKPORT [{\"author\":{\"name\":\"Gerard\nSoldevila\",\"email\":\"[email protected]\"},\"sourceCommit\":{\"committedDate\":\"2024-10-24T08:21:43Z\",\"message\":\"Update\nmappings if/when new SO types are introduced (#197061)\\n\\n##\nSummary\\r\\n\\r\\nAddresses\nhttps://github.com/elastic/elastic-entity-model/issues/70\\r\\nFixes\nregression introduced\nin\\r\\nhttps://github.com//pull/176803\",\"sha\":\"8de3636e43be7c874b2c3457f1496a0fc31f224d\",\"branchLabelMapping\":{\"^v9.0.0$\":\"main\",\"^v8.17.0$\":\"8.x\",\"^v(\\\\d+).(\\\\d+).\\\\d+$\":\"$1.$2\"}},\"sourcePullRequest\":{\"labels\":[\"bug\",\"Team:Core\",\"release_note:skip\",\"v9.0.0\",\"backport:prev-minor\",\"backport:prev-major\",\"v8.16.0\",\"v8.15.3\"],\"title\":\"Update\nmappings if/when new SO types are\nintroduced\",\"number\":197061,\"url\":\"https://github.com/elastic/kibana/pull/197061\",\"mergeCommit\":{\"message\":\"Update\nmappings if/when new SO types are introduced (#197061)\\n\\n##\nSummary\\r\\n\\r\\nAddresses\nhttps://github.com/elastic/elastic-entity-model/issues/70\\r\\nFixes\nregression introduced\nin\\r\\nhttps://github.com//pull/176803\",\"sha\":\"8de3636e43be7c874b2c3457f1496a0fc31f224d\"}},\"sourceBranch\":\"main\",\"suggestedTargetBranches\":[\"8.16\",\"8.15\"],\"targetPullRequestStates\":[{\"branch\":\"main\",\"label\":\"v9.0.0\",\"branchLabelMappingKey\":\"^v9.0.0$\",\"isSourceBranch\":true,\"state\":\"MERGED\",\"url\":\"https://github.com/elastic/kibana/pull/197061\",\"number\":197061,\"mergeCommit\":{\"message\":\"Update\nmappings if/when new SO types are introduced (#197061)\\n\\n##\nSummary\\r\\n\\r\\nAddresses\nhttps://github.com/elastic/elastic-entity-model/issues/70\\r\\nFixes\nregression introduced\nin\\r\\nhttps://github.com//pull/176803\",\"sha\":\"8de3636e43be7c874b2c3457f1496a0fc31f224d\"}},{\"branch\":\"8.16\",\"label\":\"v8.16.0\",\"branchLabelMappingKey\":\"^v(\\\\d+).(\\\\d+).\\\\d+$\",\"isSourceBranch\":false,\"state\":\"NOT_CREATED\"},{\"branch\":\"8.15\",\"label\":\"v8.15.3\",\"branchLabelMappingKey\":\"^v(\\\\d+).(\\\\d+).\\\\d+$\",\"isSourceBranch\":false,\"state\":\"NOT_CREATED\"}]}]\nBACKPORT-->\n\nCo-authored-by: Gerard Soldevila <[email protected]>"}},{"branch":"8.15","label":"v8.15.3","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT-->
…197597) # Backport This will backport the following commits from `main` to `8.x`: - [Update mappings if/when new SO types are introduced (#197061)](#197061) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Gerard Soldevila","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-24T08:21:43Z","message":"Update mappings if/when new SO types are introduced (#197061)\n\n## Summary\r\n\r\nAddresses https://github.com/elastic/elastic-entity-model/issues/70\r\nFixes regression introduced in\r\nhttps://github.com//pull/176803","sha":"8de3636e43be7c874b2c3457f1496a0fc31f224d","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","Team:Core","release_note:skip","v9.0.0","backport:prev-minor","backport:prev-major","v8.16.0","v8.15.3"],"number":197061,"url":"https://github.com/elastic/kibana/pull/197061","mergeCommit":{"message":"Update mappings if/when new SO types are introduced (#197061)\n\n## Summary\r\n\r\nAddresses https://github.com/elastic/elastic-entity-model/issues/70\r\nFixes regression introduced in\r\nhttps://github.com//pull/176803","sha":"8de3636e43be7c874b2c3457f1496a0fc31f224d"}},"sourceBranch":"main","suggestedTargetBranches":["8.15"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197061","number":197061,"mergeCommit":{"message":"Update mappings if/when new SO types are introduced (#197061)\n\n## Summary\r\n\r\nAddresses https://github.com/elastic/elastic-entity-model/issues/70\r\nFixes regression introduced in\r\nhttps://github.com//pull/176803","sha":"8de3636e43be7c874b2c3457f1496a0fc31f224d"}},{"branch":"8.16","label":"v8.16.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/197573","number":197573,"state":"MERGED","mergeCommit":{"sha":"3687435cb4531b1a0470abf42f69a420e2041cd2","message":"[8.16] Update mappings if/when new SO types are introduced (#197061) (#197573)\n\n# Backport\n\nThis will backport the following commits from `main` to `8.16`:\n- [Update mappings if/when new SO types are introduced\n(#197061)](https://github.com/elastic/kibana/pull/197061)\n\n<!--- Backport version: 9.4.3 -->\n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sqren/backport)\n\n<!--BACKPORT [{\"author\":{\"name\":\"Gerard\nSoldevila\",\"email\":\"[email protected]\"},\"sourceCommit\":{\"committedDate\":\"2024-10-24T08:21:43Z\",\"message\":\"Update\nmappings if/when new SO types are introduced (#197061)\\n\\n##\nSummary\\r\\n\\r\\nAddresses\nhttps://github.com/elastic/elastic-entity-model/issues/70\\r\\nFixes\nregression introduced\nin\\r\\nhttps://github.com//pull/176803\",\"sha\":\"8de3636e43be7c874b2c3457f1496a0fc31f224d\",\"branchLabelMapping\":{\"^v9.0.0$\":\"main\",\"^v8.17.0$\":\"8.x\",\"^v(\\\\d+).(\\\\d+).\\\\d+$\":\"$1.$2\"}},\"sourcePullRequest\":{\"labels\":[\"bug\",\"Team:Core\",\"release_note:skip\",\"v9.0.0\",\"backport:prev-minor\",\"backport:prev-major\",\"v8.16.0\",\"v8.15.3\"],\"title\":\"Update\nmappings if/when new SO types are\nintroduced\",\"number\":197061,\"url\":\"https://github.com/elastic/kibana/pull/197061\",\"mergeCommit\":{\"message\":\"Update\nmappings if/when new SO types are introduced (#197061)\\n\\n##\nSummary\\r\\n\\r\\nAddresses\nhttps://github.com/elastic/elastic-entity-model/issues/70\\r\\nFixes\nregression introduced\nin\\r\\nhttps://github.com//pull/176803\",\"sha\":\"8de3636e43be7c874b2c3457f1496a0fc31f224d\"}},\"sourceBranch\":\"main\",\"suggestedTargetBranches\":[\"8.16\",\"8.15\"],\"targetPullRequestStates\":[{\"branch\":\"main\",\"label\":\"v9.0.0\",\"branchLabelMappingKey\":\"^v9.0.0$\",\"isSourceBranch\":true,\"state\":\"MERGED\",\"url\":\"https://github.com/elastic/kibana/pull/197061\",\"number\":197061,\"mergeCommit\":{\"message\":\"Update\nmappings if/when new SO types are introduced (#197061)\\n\\n##\nSummary\\r\\n\\r\\nAddresses\nhttps://github.com/elastic/elastic-entity-model/issues/70\\r\\nFixes\nregression introduced\nin\\r\\nhttps://github.com//pull/176803\",\"sha\":\"8de3636e43be7c874b2c3457f1496a0fc31f224d\"}},{\"branch\":\"8.16\",\"label\":\"v8.16.0\",\"branchLabelMappingKey\":\"^v(\\\\d+).(\\\\d+).\\\\d+$\",\"isSourceBranch\":false,\"state\":\"NOT_CREATED\"},{\"branch\":\"8.15\",\"label\":\"v8.15.3\",\"branchLabelMappingKey\":\"^v(\\\\d+).(\\\\d+).\\\\d+$\",\"isSourceBranch\":false,\"state\":\"NOT_CREATED\"}]}]\nBACKPORT-->\n\nCo-authored-by: Gerard Soldevila <[email protected]>"}},{"branch":"8.15","label":"v8.15.3","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT-->
Summary
Addresses https://github.com/elastic/elastic-entity-model/issues/70
Fixes regression introduced in #176803