Skip to content
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

[Fleet] set typeMigrationVersion instead of migrationVersion #164712

Merged
merged 1 commit into from
Aug 24, 2023

Conversation

juliaElastic
Copy link
Contributor

@juliaElastic juliaElastic commented Aug 24, 2023

Summary

Fix #164690

migrationVersion was removed from es mapping in 8.8: #154246
Replacing it with typeMigrationVersion using the same logic as in kibana core:

...(migrationVersion ? { typeMigrationVersion: migrationVersion[doc.type] ?? '' } : {}),

To verify:

  • add Kubernetes integration to a new policy
  • verify that it is added successfully

Checklist

@juliaElastic juliaElastic added release_note:skip Skip the PR/issue when compiling release notes v8.10.0 v8.11.0 v8.9.2 labels Aug 24, 2023
@juliaElastic juliaElastic self-assigned this Aug 24, 2023
@juliaElastic juliaElastic requested a review from a team as a code owner August 24, 2023 13:12
@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Aug 24, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • /oblt-deploy-serverless : Deploy a serverless Kibana instance using the Observability test environments.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@juliaElastic juliaElastic force-pushed the fix-migration-version branch from b82e3ee to 692a6cb Compare August 24, 2023 13:14
Copy link
Member

@nchaulet nchaulet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM 🚀

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Unknown metric groups

References to deprecated APIs

id before after diff
fleet 91 100 +9

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @juliaElastic

@juliaElastic juliaElastic merged commit 0146dc8 into elastic:main Aug 24, 2023
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Aug 24, 2023
…#164712)

## Summary

Fix elastic#164690

`migrationVersion` was removed from es mapping in 8.8:
elastic#154246
Replacing it with `typeMigrationVersion` using the same logic as in
kibana core:

https://github.com/elastic/kibana/blob/ba843882a7bb35aa3062efd6562ed85d5db157f4/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/document_migrator/migrations/transform_migration_version.ts#L17

To verify:
- add Kubernetes integration to a new policy
- verify that it is added successfully

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

(cherry picked from commit 0146dc8)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.10
8.9

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Aug 24, 2023
…#164712)

## Summary

Fix elastic#164690

`migrationVersion` was removed from es mapping in 8.8:
elastic#154246
Replacing it with `typeMigrationVersion` using the same logic as in
kibana core:

https://github.com/elastic/kibana/blob/ba843882a7bb35aa3062efd6562ed85d5db157f4/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/document_migrator/migrations/transform_migration_version.ts#L17

To verify:
- add Kubernetes integration to a new policy
- verify that it is added successfully

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

(cherry picked from commit 0146dc8)
kibanamachine added a commit that referenced this pull request Aug 24, 2023
…164712) (#164727)

# Backport

This will backport the following commits from `main` to `8.10`:
- [[Fleet] set typeMigrationVersion instead of migrationVersion
(#164712)](#164712)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Julia
Bardi","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-08-24T14:37:58Z","message":"[Fleet]
set typeMigrationVersion instead of migrationVersion (#164712)\n\n##
Summary\r\n\r\nFix
https://github.com/elastic/kibana/issues/164690\r\n\r\n`migrationVersion`
was removed from es mapping in
8.8:\r\nhttps://github.com//issues/154246\r\nReplacing it
with `typeMigrationVersion` using the same logic as in\r\nkibana
core:\r\n\r\nhttps://github.com/elastic/kibana/blob/ba843882a7bb35aa3062efd6562ed85d5db157f4/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/document_migrator/migrations/transform_migration_version.ts#L17\r\n\r\n\r\nTo
verify:\r\n- add Kubernetes integration to a new policy\r\n- verify that
it is added successfully\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"0146dc87e8db9ed085295ad63d5863f2964d4eb6","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","v8.10.0","v8.11.0","v8.9.2"],"number":164712,"url":"https://github.com/elastic/kibana/pull/164712","mergeCommit":{"message":"[Fleet]
set typeMigrationVersion instead of migrationVersion (#164712)\n\n##
Summary\r\n\r\nFix
https://github.com/elastic/kibana/issues/164690\r\n\r\n`migrationVersion`
was removed from es mapping in
8.8:\r\nhttps://github.com//issues/154246\r\nReplacing it
with `typeMigrationVersion` using the same logic as in\r\nkibana
core:\r\n\r\nhttps://github.com/elastic/kibana/blob/ba843882a7bb35aa3062efd6562ed85d5db157f4/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/document_migrator/migrations/transform_migration_version.ts#L17\r\n\r\n\r\nTo
verify:\r\n- add Kubernetes integration to a new policy\r\n- verify that
it is added successfully\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"0146dc87e8db9ed085295ad63d5863f2964d4eb6"}},"sourceBranch":"main","suggestedTargetBranches":["8.10","8.9"],"targetPullRequestStates":[{"branch":"8.10","label":"v8.10.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/164712","number":164712,"mergeCommit":{"message":"[Fleet]
set typeMigrationVersion instead of migrationVersion (#164712)\n\n##
Summary\r\n\r\nFix
https://github.com/elastic/kibana/issues/164690\r\n\r\n`migrationVersion`
was removed from es mapping in
8.8:\r\nhttps://github.com//issues/154246\r\nReplacing it
with `typeMigrationVersion` using the same logic as in\r\nkibana
core:\r\n\r\nhttps://github.com/elastic/kibana/blob/ba843882a7bb35aa3062efd6562ed85d5db157f4/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/document_migrator/migrations/transform_migration_version.ts#L17\r\n\r\n\r\nTo
verify:\r\n- add Kubernetes integration to a new policy\r\n- verify that
it is added successfully\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"0146dc87e8db9ed085295ad63d5863f2964d4eb6"}},{"branch":"8.9","label":"v8.9.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Julia Bardi <[email protected]>
kibanamachine added a commit that referenced this pull request Aug 24, 2023
…164712) (#164728)

# Backport

This will backport the following commits from `main` to `8.9`:
- [[Fleet] set typeMigrationVersion instead of migrationVersion
(#164712)](#164712)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Julia
Bardi","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-08-24T14:37:58Z","message":"[Fleet]
set typeMigrationVersion instead of migrationVersion (#164712)\n\n##
Summary\r\n\r\nFix
https://github.com/elastic/kibana/issues/164690\r\n\r\n`migrationVersion`
was removed from es mapping in
8.8:\r\nhttps://github.com//issues/154246\r\nReplacing it
with `typeMigrationVersion` using the same logic as in\r\nkibana
core:\r\n\r\nhttps://github.com/elastic/kibana/blob/ba843882a7bb35aa3062efd6562ed85d5db157f4/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/document_migrator/migrations/transform_migration_version.ts#L17\r\n\r\n\r\nTo
verify:\r\n- add Kubernetes integration to a new policy\r\n- verify that
it is added successfully\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"0146dc87e8db9ed085295ad63d5863f2964d4eb6","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","v8.10.0","v8.11.0","v8.9.2"],"number":164712,"url":"https://github.com/elastic/kibana/pull/164712","mergeCommit":{"message":"[Fleet]
set typeMigrationVersion instead of migrationVersion (#164712)\n\n##
Summary\r\n\r\nFix
https://github.com/elastic/kibana/issues/164690\r\n\r\n`migrationVersion`
was removed from es mapping in
8.8:\r\nhttps://github.com//issues/154246\r\nReplacing it
with `typeMigrationVersion` using the same logic as in\r\nkibana
core:\r\n\r\nhttps://github.com/elastic/kibana/blob/ba843882a7bb35aa3062efd6562ed85d5db157f4/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/document_migrator/migrations/transform_migration_version.ts#L17\r\n\r\n\r\nTo
verify:\r\n- add Kubernetes integration to a new policy\r\n- verify that
it is added successfully\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"0146dc87e8db9ed085295ad63d5863f2964d4eb6"}},"sourceBranch":"main","suggestedTargetBranches":["8.10","8.9"],"targetPullRequestStates":[{"branch":"8.10","label":"v8.10.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/164712","number":164712,"mergeCommit":{"message":"[Fleet]
set typeMigrationVersion instead of migrationVersion (#164712)\n\n##
Summary\r\n\r\nFix
https://github.com/elastic/kibana/issues/164690\r\n\r\n`migrationVersion`
was removed from es mapping in
8.8:\r\nhttps://github.com//issues/154246\r\nReplacing it
with `typeMigrationVersion` using the same logic as in\r\nkibana
core:\r\n\r\nhttps://github.com/elastic/kibana/blob/ba843882a7bb35aa3062efd6562ed85d5db157f4/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/document_migrator/migrations/transform_migration_version.ts#L17\r\n\r\n\r\nTo
verify:\r\n- add Kubernetes integration to a new policy\r\n- verify that
it is added successfully\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"0146dc87e8db9ed085295ad63d5863f2964d4eb6"}},{"branch":"8.9","label":"v8.9.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Julia Bardi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v8.9.2 v8.10.0 v8.11.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[EPM] Kubernetes integration fails to install
6 participants