-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Fleet] Expand subfields of nested objects when generating template #191730
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
Conversation
|
Pinging @elastic/fleet (Team:Fleet) |
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
80ab845 to
f5a1a65
Compare
juliaElastic
left a comment
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.
LGTM, should we add tests on group-nested too?
|
43c8e96 to
e5ab20d
Compare
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]
History
To update your PR or re-run it, just comment with: cc @jsoriano |
…lastic#191730) There are definitions of nested objects whose fields are defined as subfields, like this: ``` - name: a type: nested fields: - name: b type: keyword ``` This should generate a template with the subfields as subproperties: ``` "properties": { ... "a": { "type": "nested", "properties": { "b": { "ignore_above": 1024, "type": "keyword", }, }, }, }, ``` This change adds support for this. Without it the nested object is empty, without subfields, what is unexpected. See elastic/package-spec#784 for more context. (cherry picked from commit cdb1eb8)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…plate (#191730) (#191879) # Backport This will backport the following commits from `main` to `8.15`: - [[Fleet] Expand subfields of nested objects when generating template (#191730)](#191730) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Jaime Soriano Pastor","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-08-30T19:25:15Z","message":"[Fleet] Expand subfields of nested objects when generating template (#191730)\n\nThere are definitions of nested objects whose fields are defined as\r\nsubfields, like this:\r\n```\r\n - name: a\r\n type: nested\r\n fields:\r\n - name: b\r\n type: keyword\r\n```\r\nThis should generate a template with the subfields as subproperties:\r\n```\r\n \"properties\": {\r\n ...\r\n \"a\": {\r\n \"type\": \"nested\",\r\n \"properties\": {\r\n \"b\": {\r\n \"ignore_above\": 1024,\r\n \"type\": \"keyword\",\r\n },\r\n },\r\n },\r\n },\r\n```\r\nThis change adds support for this. Without it the nested object is\r\nempty, without subfields, what is unexpected.\r\n\r\nSee elastic/package-spec#784 for more context.","sha":"cdb1eb8fe475c3f1dad0805586c06775538d2d40","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Team:Fleet","backport:prev-minor","v8.16.0"],"title":"[Fleet] Expand subfields of nested objects when generating template","number":191730,"url":"https://github.com/elastic/kibana/pull/191730","mergeCommit":{"message":"[Fleet] Expand subfields of nested objects when generating template (#191730)\n\nThere are definitions of nested objects whose fields are defined as\r\nsubfields, like this:\r\n```\r\n - name: a\r\n type: nested\r\n fields:\r\n - name: b\r\n type: keyword\r\n```\r\nThis should generate a template with the subfields as subproperties:\r\n```\r\n \"properties\": {\r\n ...\r\n \"a\": {\r\n \"type\": \"nested\",\r\n \"properties\": {\r\n \"b\": {\r\n \"ignore_above\": 1024,\r\n \"type\": \"keyword\",\r\n },\r\n },\r\n },\r\n },\r\n```\r\nThis change adds support for this. Without it the nested object is\r\nempty, without subfields, what is unexpected.\r\n\r\nSee elastic/package-spec#784 for more context.","sha":"cdb1eb8fe475c3f1dad0805586c06775538d2d40"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/191730","number":191730,"mergeCommit":{"message":"[Fleet] Expand subfields of nested objects when generating template (#191730)\n\nThere are definitions of nested objects whose fields are defined as\r\nsubfields, like this:\r\n```\r\n - name: a\r\n type: nested\r\n fields:\r\n - name: b\r\n type: keyword\r\n```\r\nThis should generate a template with the subfields as subproperties:\r\n```\r\n \"properties\": {\r\n ...\r\n \"a\": {\r\n \"type\": \"nested\",\r\n \"properties\": {\r\n \"b\": {\r\n \"ignore_above\": 1024,\r\n \"type\": \"keyword\",\r\n },\r\n },\r\n },\r\n },\r\n```\r\nThis change adds support for this. Without it the nested object is\r\nempty, without subfields, what is unexpected.\r\n\r\nSee elastic/package-spec#784 for more context.","sha":"cdb1eb8fe475c3f1dad0805586c06775538d2d40"}}]}] BACKPORT--> Co-authored-by: Jaime Soriano Pastor <[email protected]>
…mplate (elastic#191730)" This reverts commit cdb1eb8.
(cherry picked from commit 4928797)
…#11016) These mappings were correctly defined as expected by the spec, but Fleet was only installing empty nested objects. To workaround that, subfields can be moved to have their own definitions. Issue in Fleet is fixed in elastic/kibana#191730, we can apply this workaround for current versions of the stack.
…emplate (elastic#191730)" (elastic#191897) This reverts commit 7cf77b3.
…emplate (#191730)" (#191897) (#192246) This change was released at the end in 8.15.1, so let's keep it the branch. There are definitions of nested objects whose fields are defined as subfields, like this: ``` - name: a type: nested fields: - name: b type: keyword ``` This should generate a template with the subfields as subproperties: ``` "properties": { ... "a": { "type": "nested", "properties": { "b": { "ignore_above": 1024, "type": "keyword", }, }, }, }, ``` This change adds support for this. Without it the nested object is empty, without subfields, what is unexpected. See elastic/package-spec#784 for more context. This change was originally reverted in 8.15 in #191897 Release notes were manually added in elastic/ingest-docs#1292
Adapt definitions of subfields of nested objects so they are actually installed by Fleet. New mappings are otherwise equivalent. These mappings were correctly defined as expected by the spec, but Fleet was only installing empty nested objects. To workaround that, subfields can be moved to have their own definitions. Issue in Fleet is fixed in elastic/kibana#191730, but we can apply this workaround for older versions of the stack.
(cherry picked from commit 4928797) Co-authored-by: Jaime Soriano Pastor <[email protected]>
…elastic#11016) These mappings were correctly defined as expected by the spec, but Fleet was only installing empty nested objects. To workaround that, subfields can be moved to have their own definitions. Issue in Fleet is fixed in elastic/kibana#191730, we can apply this workaround for current versions of the stack.
…#11031) Adapt definitions of subfields of nested objects so they are actually installed by Fleet. New mappings are otherwise equivalent. These mappings were correctly defined as expected by the spec, but Fleet was only installing empty nested objects. To workaround that, subfields can be moved to have their own definitions. Issue in Fleet is fixed in elastic/kibana#191730, but we can apply this workaround for older versions of the stack.
…elastic#11016) These mappings were correctly defined as expected by the spec, but Fleet was only installing empty nested objects. To workaround that, subfields can be moved to have their own definitions. Issue in Fleet is fixed in elastic/kibana#191730, we can apply this workaround for current versions of the stack.
…#11031) Adapt definitions of subfields of nested objects so they are actually installed by Fleet. New mappings are otherwise equivalent. These mappings were correctly defined as expected by the spec, but Fleet was only installing empty nested objects. To workaround that, subfields can be moved to have their own definitions. Issue in Fleet is fixed in elastic/kibana#191730, but we can apply this workaround for older versions of the stack.
Summary
There are definitions of nested objects whose fields are defined as subfields, like this:
This should generate a template with the subfields as subproperties:
This change adds support for this. Without it the nested object is empty, without subfields, what is unexpected.
See elastic/package-spec#784 for more context.
Checklist
Delete any items that are not applicable to this PR.
Risk Matrix
For maintainers