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

[UII] Make constant keyword backfill optional #192921

Merged
merged 4 commits into from
Sep 14, 2024

Conversation

jen-huang
Copy link
Contributor

@jen-huang jen-huang commented Sep 13, 2024

Summary

Follow up to #188145. In some edge cases (https://github.com/elastic/sdh-beats/issues/5156), users could override the index template used by integration data streams. It is possible to create an index template without mappings, this causes fillConstantKeywordValues to receive an undefined object when upgrading the integration, and the upgrade then fails.

This PR makes the backfill operation here more fail-safe.

@jen-huang jen-huang added release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team backport:prev-major Backport to (8.x, 8.16, 8.15) the previous major branch and all later branches still in development labels Sep 13, 2024
@jen-huang jen-huang self-assigned this Sep 13, 2024
@jen-huang jen-huang requested a review from a team as a code owner September 13, 2024 19:20
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@obltmachine
Copy link

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

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

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 🚀 do you think it will make sense to add a unit test to document that scenario?

@jen-huang
Copy link
Contributor Author

@nchaulet I added a few unit tests here :)

@jen-huang jen-huang enabled auto-merge (squash) September 14, 2024 00:31
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

✅ unchanged

History

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

cc @jen-huang

@jen-huang jen-huang merged commit b5abc4e into elastic:main Sep 14, 2024
37 of 38 checks passed
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 14, 2024
## Summary

Follow up to elastic#188145. In some edge cases
(elastic/sdh-beats#5156), users could override
the index template used by integration data streams. It is possible to
create an index template without mappings, this causes
`fillConstantKeywordValues` to receive an undefined object when
upgrading the integration, and the upgrade then fails.

This PR makes the backfill operation here more fail-safe.

(cherry picked from commit b5abc4e)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 14, 2024
## Summary

Follow up to elastic#188145. In some edge cases
(elastic/sdh-beats#5156), users could override
the index template used by integration data streams. It is possible to
create an index template without mappings, this causes
`fillConstantKeywordValues` to receive an undefined object when
upgrading the integration, and the upgrade then fails.

This PR makes the backfill operation here more fail-safe.

(cherry picked from commit b5abc4e)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.15
8.x

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

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Sep 14, 2024
# Backport

This will backport the following commits from `main` to `8.x`:
- [[UII] Make constant keyword backfill optional
(#192921)](#192921)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Jen
Huang","email":"its.jenetic@gmail.com"},"sourceCommit":{"committedDate":"2024-09-14T02:34:46Z","message":"[UII]
Make constant keyword backfill optional (#192921)\n\n##
Summary\r\n\r\nFollow up to #188145. In some edge
cases\r\n(elastic/sdh-beats#5156), users could
override\r\nthe index template used by integration data streams. It is
possible to\r\ncreate an index template without mappings, this
causes\r\n`fillConstantKeywordValues` to receive an undefined object
when\r\nupgrading the integration, and the upgrade then
fails.\r\n\r\nThis PR makes the backfill operation here more
fail-safe.","sha":"b5abc4ec7e308815b0f338f4c836a9caf3ee48a3","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","v9.0.0","backport:prev-major"],"title":"[UII]
Make constant keyword backfill
optional","number":192921,"url":"https://github.com/elastic/kibana/pull/192921","mergeCommit":{"message":"[UII]
Make constant keyword backfill optional (#192921)\n\n##
Summary\r\n\r\nFollow up to #188145. In some edge
cases\r\n(elastic/sdh-beats#5156), users could
override\r\nthe index template used by integration data streams. It is
possible to\r\ncreate an index template without mappings, this
causes\r\n`fillConstantKeywordValues` to receive an undefined object
when\r\nupgrading the integration, and the upgrade then
fails.\r\n\r\nThis PR makes the backfill operation here more
fail-safe.","sha":"b5abc4ec7e308815b0f338f4c836a9caf3ee48a3"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/192921","number":192921,"mergeCommit":{"message":"[UII]
Make constant keyword backfill optional (#192921)\n\n##
Summary\r\n\r\nFollow up to #188145. In some edge
cases\r\n(elastic/sdh-beats#5156), users could
override\r\nthe index template used by integration data streams. It is
possible to\r\ncreate an index template without mappings, this
causes\r\n`fillConstantKeywordValues` to receive an undefined object
when\r\nupgrading the integration, and the upgrade then
fails.\r\n\r\nThis PR makes the backfill operation here more
fail-safe.","sha":"b5abc4ec7e308815b0f338f4c836a9caf3ee48a3"}}]}]
BACKPORT-->

Co-authored-by: Jen Huang <its.jenetic@gmail.com>
kibanamachine added a commit that referenced this pull request Sep 14, 2024
# Backport

This will backport the following commits from `main` to `8.15`:
- [[UII] Make constant keyword backfill optional
(#192921)](#192921)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Jen
Huang","email":"its.jenetic@gmail.com"},"sourceCommit":{"committedDate":"2024-09-14T02:34:46Z","message":"[UII]
Make constant keyword backfill optional (#192921)\n\n##
Summary\r\n\r\nFollow up to #188145. In some edge
cases\r\n(elastic/sdh-beats#5156), users could
override\r\nthe index template used by integration data streams. It is
possible to\r\ncreate an index template without mappings, this
causes\r\n`fillConstantKeywordValues` to receive an undefined object
when\r\nupgrading the integration, and the upgrade then
fails.\r\n\r\nThis PR makes the backfill operation here more
fail-safe.","sha":"b5abc4ec7e308815b0f338f4c836a9caf3ee48a3","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","v9.0.0","backport:prev-major"],"title":"[UII]
Make constant keyword backfill
optional","number":192921,"url":"https://github.com/elastic/kibana/pull/192921","mergeCommit":{"message":"[UII]
Make constant keyword backfill optional (#192921)\n\n##
Summary\r\n\r\nFollow up to #188145. In some edge
cases\r\n(elastic/sdh-beats#5156), users could
override\r\nthe index template used by integration data streams. It is
possible to\r\ncreate an index template without mappings, this
causes\r\n`fillConstantKeywordValues` to receive an undefined object
when\r\nupgrading the integration, and the upgrade then
fails.\r\n\r\nThis PR makes the backfill operation here more
fail-safe.","sha":"b5abc4ec7e308815b0f338f4c836a9caf3ee48a3"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/192921","number":192921,"mergeCommit":{"message":"[UII]
Make constant keyword backfill optional (#192921)\n\n##
Summary\r\n\r\nFollow up to #188145. In some edge
cases\r\n(elastic/sdh-beats#5156), users could
override\r\nthe index template used by integration data streams. It is
possible to\r\ncreate an index template without mappings, this
causes\r\n`fillConstantKeywordValues` to receive an undefined object
when\r\nupgrading the integration, and the upgrade then
fails.\r\n\r\nThis PR makes the backfill operation here more
fail-safe.","sha":"b5abc4ec7e308815b0f338f4c836a9caf3ee48a3"}}]}]
BACKPORT-->

Co-authored-by: Jen Huang <its.jenetic@gmail.com>
@jen-huang jen-huang deleted the fix/sdh-5156 branch September 16, 2024 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-major Backport to (8.x, 8.16, 8.15) the previous major branch and all later branches still in development release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v8.15.2 v8.16.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants