Skip to content

Adding a test for data stream effective mappings #130491

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

Merged

Conversation

masseyke
Copy link
Member

@masseyke masseyke commented Jul 2, 2025

This adds a new test that show what exactly comes back as effective_mappings from the data stream mappings APIs. Right now, it is just the template mapping merged with the mapping overrides. Component template mappings are not considered (they are used during rollover though).

@masseyke masseyke added >non-issue :Data Management/Data streams Data streams and their lifecycles v9.2.0 labels Jul 2, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@elasticsearchmachine elasticsearchmachine added the Team:Data Management Meta label for data/management team label Jul 2, 2025
@masseyke masseyke requested review from jbaiera and lukewhiting July 2, 2025 21:28
@lukewhiting lukewhiting requested a review from Copilot July 3, 2025 07:58
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds a new YAML REST test case that verifies how effective_mappings is computed for a data stream backed only by component templates and after applying overrides and rollover.

  • Introduces a test block "Test mappings component templates only"
  • Covers get_data_stream, put_data_stream_mappings, rollover, and get_data_stream_mappings scenarios
  • Asserts initial absence of mappings, correct merge of overrides, and null effective_mappings on certain endpoints
Comments suppressed due to low confidence (1)

modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/250_data_stream_mappings.yml:201

  • This match assertion is missing a colon before null. It should be { data_streams.0.mappings: null } to be valid YAML and align with other assertions.
  - match: { data_streams.0.mappings null }

@masseyke masseyke merged commit 72f2121 into elastic:main Jul 3, 2025
32 checks passed
@masseyke masseyke deleted the data-stream-mappings-effective-mappings-test branch July 3, 2025 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Data Management/Data streams Data streams and their lifecycles >non-issue Team:Data Management Meta label for data/management team v9.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants