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

Cherry-pick #23240 to 7.x: libbeat/template: duplicate entries in fields.yml leads to repeated dynamic templates #23894

Merged
merged 1 commit into from
Feb 24, 2021

Conversation

axw
Copy link
Member

@axw axw commented Feb 6, 2021

Cherry-pick of PR #23240 to 7.x branch. Original message:

What does this PR do?

In case of duplicate fields, do not generate duplicate dynamic_template items. We already deduplicate field mappings because there we update a map.

There's some light refactoring here to stop using a global list of dynamic templates, and instead maintain a map of dynamic templates on the processor.

Why is it important?

As part of APM Server's migration to Fleet and data streams, we now duplicate fields for each data stream. We still need to generate legacy templates for 7.x, so we gather all of these data stream fields.yml files together to generate docs, templates, etc. The combined fields.yml will therefore have duplicate entries.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
    - [ ] I have made corresponding changes to the documentation
    - [ ] I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
    - [ ] I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

How to test this PR locally

N/A

Related issues

elastic/apm-server#4576

…ynamic templates (elastic#23240)

* libbeat/template: deduplicate dynamic templates

In case of duplicate fields, do not generate duplicate
dynamic_template items. We already deduplicate field
mappings because we update a map.

* libbeat/template: preserve dynamic template order

(cherry picked from commit c0bfea4)
@axw axw added [zube]: In Review backport Team:Services (Deprecated) Label for the former Integrations-Services team labels Feb 6, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations-services (Team:Services)

@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Feb 6, 2021
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Pull request #23894 opened

    • Start Time: 2021-02-06T00:53:31.723+0000
  • Duration: 56 min 50 sec

  • Commit: 66e66e0

Test stats 🧪

Test Results
Failed 0
Passed 45653
Skipped 4799
Total 50452

Steps errors 1

Expand to view the steps failures

packetbeat-Lint - Install Go/Mage/Python/Docker/Terraform 1.15.7
  • Took 0 min 15 sec . View more details on here
  • Description: .ci/scripts/install-tools.sh

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 45653
Skipped 4799
Total 50452

@axw axw merged commit 68630eb into elastic:7.x Feb 24, 2021
@axw axw deleted the backport_23240_7.x branch February 24, 2021 07:09
@zube zube bot removed the [zube]: Done label May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Team:Services (Deprecated) Label for the former Integrations-Services team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants