Skip to content

Comments

Fix ignored dynamic templates#219875

Merged
ersin-erdal merged 6 commits intoelastic:mainfrom
ersin-erdal:fix-ignored-dynamic-templates
May 2, 2025
Merged

Fix ignored dynamic templates#219875
ersin-erdal merged 6 commits intoelastic:mainfrom
ersin-erdal:fix-ignored-dynamic-templates

Conversation

@ersin-erdal
Copy link
Contributor

@ersin-erdal ersin-erdal commented May 1, 2025

This PR fixes the bug introduced with: #216719

We didn't pass the dynamic_templates param while creating the component template.
The fields were still being added because the fields were marked as dynamic: true

As the dynamic_template was ignored, the fields were added with an extra mapping like filedname.keyword
This PR fixes that too.

@prodsecmachine
Copy link
Collaborator

prodsecmachine commented May 1, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

@ersin-erdal ersin-erdal added release_note:fix Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// v9.0.0 backport:version Backport to applied version labels v9.1.0 v8.19.0 v9.0.1 v9.0.2 labels May 1, 2025
Copy link
Contributor

@ymao1 ymao1 left a comment

Choose a reason for hiding this comment

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

LGTM. Left a comment about adding a unit test.

const componentTemplate = getComponentTemplate({
fieldMap: mappings.fieldMap,
dynamic: mappings.dynamic,
dynamicTemplates: mappings.dynamicTemplates,
Copy link
Contributor

Choose a reason for hiding this comment

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

i would add a unit test to the getComponent template function to verify this is passed through

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added a unit test

@ersin-erdal ersin-erdal marked this pull request as ready for review May 1, 2025 21:06
@ersin-erdal ersin-erdal requested a review from a team as a code owner May 1, 2025 21:06
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #9 / RegisteredAttachmentsPropertyActions renders the correct number of actions

Metrics [docs]

✅ unchanged

History

@ersin-erdal ersin-erdal merged commit 8c6c928 into elastic:main May 2, 2025
9 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19, 9.0

https://github.com/elastic/kibana/actions/runs/14791684758

kibanamachine added a commit to kibanamachine/kibana that referenced this pull request May 2, 2025
This PR fixes the bug introduced with:
elastic#216719

We didn't pass the dynamic_templates param while creating the component
template.
The fields were still being added because the fields were marked as
`dynamic: true`

As the dynamic_template was ignored, the fields were added with an extra
mapping like `filedname.keyword`
This PR fixes that too.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 8c6c928)
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request May 2, 2025
This PR fixes the bug introduced with:
elastic#216719

We didn't pass the dynamic_templates param while creating the component
template.
The fields were still being added because the fields were marked as
`dynamic: true`

As the dynamic_template was ignored, the fields were added with an extra
mapping like `filedname.keyword`
This PR fixes that too.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 8c6c928)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.19
9.0

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 May 2, 2025
# Backport

This will backport the following commits from `main` to `9.0`:
- [Fix ignored dynamic templates
(#219875)](#219875)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Ersin
Erdal","email":"92688503+ersin-erdal@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-05-02T08:28:56Z","message":"Fix
ignored dynamic templates (#219875)\n\nThis PR fixes the bug introduced
with:\nhttps://github.com//pull/216719\n\nWe didn't pass
the dynamic_templates param while creating the component\ntemplate.\nThe
fields were still being added because the fields were marked
as\n`dynamic: true`\n\nAs the dynamic_template was ignored, the fields
were added with an extra\nmapping like `filedname.keyword`\nThis PR
fixes that too.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"8c6c928e7cde2233da4145c6e712785acf54c5f9","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:ResponseOps","v9.0.0","backport:version","v9.1.0","v8.19.0","v9.0.1","v9.0.2"],"title":"Fix
ignored dynamic
templates","number":219875,"url":"https://github.com/elastic/kibana/pull/219875","mergeCommit":{"message":"Fix
ignored dynamic templates (#219875)\n\nThis PR fixes the bug introduced
with:\nhttps://github.com//pull/216719\n\nWe didn't pass
the dynamic_templates param while creating the component\ntemplate.\nThe
fields were still being added because the fields were marked
as\n`dynamic: true`\n\nAs the dynamic_template was ignored, the fields
were added with an extra\nmapping like `filedname.keyword`\nThis PR
fixes that too.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"8c6c928e7cde2233da4145c6e712785acf54c5f9"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.19"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/219875","number":219875,"mergeCommit":{"message":"Fix
ignored dynamic templates (#219875)\n\nThis PR fixes the bug introduced
with:\nhttps://github.com//pull/216719\n\nWe didn't pass
the dynamic_templates param while creating the component\ntemplate.\nThe
fields were still being added because the fields were marked
as\n`dynamic: true`\n\nAs the dynamic_template was ignored, the fields
were added with an extra\nmapping like `filedname.keyword`\nThis PR
fixes that too.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"8c6c928e7cde2233da4145c6e712785acf54c5f9"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

---------

Co-authored-by: Ersin Erdal <92688503+ersin-erdal@users.noreply.github.com>
Co-authored-by: Ersin Erdal <ersin.erdal@elastic.co>
kibanamachine added a commit that referenced this pull request May 2, 2025
# Backport

This will backport the following commits from `main` to `8.19`:
- [Fix ignored dynamic templates
(#219875)](#219875)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Ersin
Erdal","email":"92688503+ersin-erdal@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-05-02T08:28:56Z","message":"Fix
ignored dynamic templates (#219875)\n\nThis PR fixes the bug introduced
with:\nhttps://github.com//pull/216719\n\nWe didn't pass
the dynamic_templates param while creating the component\ntemplate.\nThe
fields were still being added because the fields were marked
as\n`dynamic: true`\n\nAs the dynamic_template was ignored, the fields
were added with an extra\nmapping like `filedname.keyword`\nThis PR
fixes that too.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"8c6c928e7cde2233da4145c6e712785acf54c5f9","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:ResponseOps","v9.0.0","backport:version","v9.1.0","v8.19.0","v9.0.1","v9.0.2"],"title":"Fix
ignored dynamic
templates","number":219875,"url":"https://github.com/elastic/kibana/pull/219875","mergeCommit":{"message":"Fix
ignored dynamic templates (#219875)\n\nThis PR fixes the bug introduced
with:\nhttps://github.com//pull/216719\n\nWe didn't pass
the dynamic_templates param while creating the component\ntemplate.\nThe
fields were still being added because the fields were marked
as\n`dynamic: true`\n\nAs the dynamic_template was ignored, the fields
were added with an extra\nmapping like `filedname.keyword`\nThis PR
fixes that too.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"8c6c928e7cde2233da4145c6e712785acf54c5f9"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.19"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/219875","number":219875,"mergeCommit":{"message":"Fix
ignored dynamic templates (#219875)\n\nThis PR fixes the bug introduced
with:\nhttps://github.com//pull/216719\n\nWe didn't pass
the dynamic_templates param while creating the component\ntemplate.\nThe
fields were still being added because the fields were marked
as\n`dynamic: true`\n\nAs the dynamic_template was ignored, the fields
were added with an extra\nmapping like `filedname.keyword`\nThis PR
fixes that too.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"8c6c928e7cde2233da4145c6e712785acf54c5f9"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

---------

Co-authored-by: Ersin Erdal <92688503+ersin-erdal@users.noreply.github.com>
Co-authored-by: Ersin Erdal <ersin.erdal@elastic.co>
kapral18 added a commit to kapral18/kibana that referenced this pull request May 4, 2025
…ends-crash

* main: (111 commits)
  [ResponseOps][Rules] Cases action title length too long (elastic#219226)
  [main] Sync bundled packages with Package Storage (elastic#219839)
  Fix ignored dynamic templates (elastic#219875)
  Enforce dependency review by kibana-security workflow (elastic#219262)
  [Security Solution] [Detections] Removes tech preview text from eql seq suppression ui (elastic#219870)
  [Security Solution] Fix alerts table potentially not applying alert assignees (elastic#219460)
  fix(slo): alert deletion (elastic#219876)
  [AI4DSOC] fix styling to address cutoff when screen is narrow (elastic#219306)
  [Security Solution][Endpoint] Response action create and history log API updates in of space awareness (elastic#218674)
  Update publish_oas_docs.sh to deploy Kibana Serverless API docs (elastic#219867)
  feat(slo): lock resource installation (elastic#219747)
  [AI4DSOC] Alert flyout code cleanup (elastic#219810)
  [fleet] fixing `isAgentlessDefault` config usage and readability improvements to `isAgentlessSetupDefault` (elastic#219423)
  feat(slo): Bulk delete UI (elastic#219634)
  m1 demo prep (elastic#219588)
  [Security Solution] Replace sourcerer in EQL tab with dataview picker (elastic#218897)
  [AI4DSOC] Attack discovery widget follow up follow up (elastic#219849)
  [AI Assistant] Fix some OpenAI models not accepting temperature for Inference service (elastic#218887)
  Update dependency msw to ~2.7.5 (main) (elastic#219289)
  Use new client URLs in doc link service (elastic#219600)
  ...
@mistic
Copy link
Contributor

mistic commented May 6, 2025

This PR didn't make it into the latest 9.0.1 BC. Updating the labels.

akowalska622 pushed a commit to akowalska622/kibana that referenced this pull request May 29, 2025
This PR fixes the bug introduced with:
elastic#216719

We didn't pass the dynamic_templates param while creating the component
template.
The fields were still being added because the fields were marked as
`dynamic: true`

As the dynamic_template was ignored, the fields were added with an extra
mapping like `filedname.keyword`
This PR fixes that too.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
qn895 pushed a commit to qn895/kibana that referenced this pull request Jun 3, 2025
This PR fixes the bug introduced with:
elastic#216719

We didn't pass the dynamic_templates param while creating the component
template.
The fields were still being added because the fields were marked as
`dynamic: true`

As the dynamic_template was ignored, the fields were added with an extra
mapping like `filedname.keyword`
This PR fixes that too.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:fix Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// v8.19.0 v9.0.2 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants