Add parent action name to ProcessorGenerationContext for system gener…#22195
Add parent action name to ProcessorGenerationContext for system gener…#22195shatejas wants to merge 2 commits into
Conversation
…ated processors This exposes the parent transport action (e.g., _msearch, _async_search) to SystemGeneratedFactory.shouldGenerate() so processors can conditionally generate based on the calling action. Signed-off-by: Tejas Shah <shatejas@amazon.com>
PR Reviewer Guide 🔍(Review updated until commit 684e48c)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 684e48c
Previous suggestionsSuggestions up to commit d02e58d
|
|
❌ Gradle check result for d02e58d: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
Persistent review updated to latest commit 684e48c |
|
❌ Gradle check result for 684e48c: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
| } | ||
|
|
||
| private Task extractParentTask(final SearchRequest searcRequest) { | ||
| TaskId taskId = searcRequest.getParentTask(); |
There was a problem hiding this comment.
nit: searchRequest.getParentTask
| try ( | ||
| Engine.GetResult get = indexShard.get( | ||
| new Engine.Get(realtime, true, id, uidTerm).version(version) | ||
| new Engine.Get(realtime, true, id, uidTerm) |
There was a problem hiding this comment.
nit: Not needed for this change.
| } | ||
| // Resolve system generated search pipeline | ||
| final Map<String, Object> config = Map.of(SEARCH_REQUEST, searchRequest); | ||
| final String parentAction = parentTask != null ? parentTask.getAction() : null; |
There was a problem hiding this comment.
Should we use structured task types here instead of raw strings? I was thinking of going one step ahead and adding in the necessary details instead of just the task name
There was a problem hiding this comment.
The idea is to limit access to whats required. Having said that we can add type, id is available from searchRequest. I am not sure if requestHeaders are needed
…ated processors
This exposes the parent transport action (e.g., _msearch, _async_search) to SystemGeneratedFactory.shouldGenerate() so processors can conditionally generate based on the calling action.
Related Issues
Resolves #22165
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.