Skip to content

Conversation

@masseyke
Copy link
Member

This prevents a user from accidentally passing a pipeline in an index request item to the logs stream.

@masseyke masseyke added >bug :Data Management/Data streams Data streams and their lifecycles v9.3.0 labels Nov 12, 2025
@masseyke masseyke marked this pull request as draft November 12, 2025 23:21
@elasticsearchmachine
Copy link
Collaborator

Hi @masseyke, I've created a changelog YAML for you.

@masseyke masseyke marked this pull request as ready for review November 13, 2025 14:59
@masseyke masseyke requested a review from lukewhiting November 13, 2025 14:59
@elasticsearchmachine elasticsearchmachine added the Team:Data Management Meta label for data/management team label Nov 13, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@lukewhiting lukewhiting requested a review from Copilot November 13, 2025 15:01
Copy link
Contributor

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

This PR prevents users from accidentally providing a pipeline parameter when indexing documents to a logs stream, as pipelines should not be specified in this context.

Key Changes:

  • Adds validation to reject index requests with pipelines when writing to log streams
  • Includes test coverage to verify the new validation behavior

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
server/src/main/java/org/elasticsearch/action/bulk/TransportAbstractBulkAction.java Adds validation logic to reject pipeline parameters in log stream index requests
modules/streams/src/yamlRestTest/resources/rest-api-spec/test/streams/logs/40_index_request_restrictions.yml Adds test case verifying pipeline rejection behavior
docs/changelog/137992.yaml Documents the bug fix in the changelog

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

);
}

if (e == null && streamType.getStreamName().equals(ir.index()) && ir.getPipeline() != null) {
Copy link

Copilot AI Nov 13, 2025

Choose a reason for hiding this comment

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

The condition streamType.getStreamName().equals(ir.index()) is redundant here. At line 479, we already know that req.index().equals(streamType.getStreamName()) from earlier context, and ir.index() should match req.index() for the same request. Consider simplifying the condition to just check ir.getPipeline() != null.

Suggested change
if (e == null && streamType.getStreamName().equals(ir.index()) && ir.getPipeline() != null) {
if (e == null && ir.getPipeline() != null) {

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

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

I mean technically yes... You could combine it with the check above I guess to save a couple of cycles but it's also absolutely fine as it is. Your call.

Copy link
Contributor

@lukewhiting lukewhiting left a comment

Choose a reason for hiding this comment

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

One absolutely microscopic wording change suggestion to the change log but not going to block for that. It all looks solid to me! 👍🏻

Co-authored-by: Luke Whiting <luke.whiting@elastic.co>
@masseyke masseyke added auto-backport Automatically create backport pull requests when merged v9.2.2 labels Nov 13, 2025
@masseyke masseyke merged commit 70a79bc into elastic:main Nov 13, 2025
34 checks passed
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
9.2

masseyke added a commit to masseyke/elasticsearch that referenced this pull request Nov 13, 2025
flash1293 added a commit to elastic/kibana that referenced this pull request Nov 14, 2025
Fixes #242994

With elastic/elasticsearch#137992, the approach
we used to do field simulation for wired streams doesn't work anymore.
This PR fixes this by switching to a similar strategy we use for the
processing simulation: Overwrite the root logs pipeline to reroute the
doc, then overwrite the current stream pipeline with a noop.

For classic streams we keep the existing behavior.
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 17, 2025
Fixes elastic#242994

With elastic/elasticsearch#137992, the approach
we used to do field simulation for wired streams doesn't work anymore.
This PR fixes this by switching to a similar strategy we use for the
processing simulation: Overwrite the root logs pipeline to reroute the
doc, then overwrite the current stream pipeline with a noop.

For classic streams we keep the existing behavior.

(cherry picked from commit 1555156)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 17, 2025
Fixes elastic#242994

With elastic/elasticsearch#137992, the approach
we used to do field simulation for wired streams doesn't work anymore.
This PR fixes this by switching to a similar strategy we use for the
processing simulation: Overwrite the root logs pipeline to reroute the
doc, then overwrite the current stream pipeline with a noop.

For classic streams we keep the existing behavior.

(cherry picked from commit 1555156)
kibanamachine added a commit to elastic/kibana that referenced this pull request Nov 17, 2025
# Backport

This will backport the following commits from `main` to `9.2`:
- [🌊 Streams: Fix field simulation
(#243065)](#243065)

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

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

<!--BACKPORT [{"author":{"name":"Joe
Reuter","email":"johannes.reuter@elastic.co"},"sourceCommit":{"committedDate":"2025-11-14T16:59:47Z","message":"🌊
Streams: Fix field simulation (#243065)\n\nFixes
https://github.com/elastic/kibana/issues/242994\n\nWith
elastic/elasticsearch#137992, the approach\nwe
used to do field simulation for wired streams doesn't work
anymore.\nThis PR fixes this by switching to a similar strategy we use
for the\nprocessing simulation: Overwrite the root logs pipeline to
reroute the\ndoc, then overwrite the current stream pipeline with a
noop.\n\nFor classic streams we keep the existing
behavior.","sha":"155515607bdfb2cfb4168b07d26d01a3371acada","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:obs-onboarding","backport:version","Feature:Streams","v9.3.0","v9.2.2"],"title":"🌊
Streams: Fix field
simulation","number":243065,"url":"https://github.com/elastic/kibana/pull/243065","mergeCommit":{"message":"🌊
Streams: Fix field simulation (#243065)\n\nFixes
https://github.com/elastic/kibana/issues/242994\n\nWith
elastic/elasticsearch#137992, the approach\nwe
used to do field simulation for wired streams doesn't work
anymore.\nThis PR fixes this by switching to a similar strategy we use
for the\nprocessing simulation: Overwrite the root logs pipeline to
reroute the\ndoc, then overwrite the current stream pipeline with a
noop.\n\nFor classic streams we keep the existing
behavior.","sha":"155515607bdfb2cfb4168b07d26d01a3371acada"}},"sourceBranch":"main","suggestedTargetBranches":["9.2"],"targetPullRequestStates":[{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/243065","number":243065,"mergeCommit":{"message":"🌊
Streams: Fix field simulation (#243065)\n\nFixes
https://github.com/elastic/kibana/issues/242994\n\nWith
elastic/elasticsearch#137992, the approach\nwe
used to do field simulation for wired streams doesn't work
anymore.\nThis PR fixes this by switching to a similar strategy we use
for the\nprocessing simulation: Overwrite the root logs pipeline to
reroute the\ndoc, then overwrite the current stream pipeline with a
noop.\n\nFor classic streams we keep the existing
behavior.","sha":"155515607bdfb2cfb4168b07d26d01a3371acada"}},{"branch":"9.2","label":"v9.2.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Joe Reuter <johannes.reuter@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged >bug :Data Management/Data streams Data streams and their lifecycles Team:Data Management Meta label for data/management team v9.2.2 v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants