-
Notifications
You must be signed in to change notification settings - Fork 179
persistence-elastic: handle es8 bulk response #3391
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
persistence-elastic: handle es8 bulk response #3391
Conversation
✅ Deploy Preview for docs-securecodebox ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Hi @conleth, The description says: " All commits include a Signed-off-by line for DCO compliance." but thats not the case :D |
Signed-off-by: conleth <conlethkennedy@gmail.com>
Signed-off-by: conleth <conlethkennedy@gmail.com>
Signed-off-by: conleth <conlethkennedy@gmail.com>
1766837 to
7618b71
Compare
Signed-off-by: conleth <conlethkennedy@gmail.com>
|
Updated and fix the duplicate code issue from the quality gate. |



# Description
This PR fixes an issue where the
persistence-elastichook fails on Elasticsearch 8 because the bulk API response is no longer wrapped in a.bodyproperty (as it was in Elasticsearch 7). This results inbulkResponse.bodybeingundefined, preventing proper error checks and breaking bulk indexing for ES 8.This change normalises the bulk response format so it works for both ES 7 and ES 8 by:
client.bulk({ refresh: true, body })response.body) or unwrapped (response)Fixes #3385
# Checklist
General
Fixes #3385).Signed-off-byline for DCO compliance.Testing
I ran the existing test suite for the persistence-elastic hook.
Command used:
PATH=$HOME/.bun/bin:$PATH bun test
I added a unit test for the ES 8 bulk response format.
Tests pass locally.
Documentation / Misc
# Types of Changes
# Screenshots / Logs (optional)
N/A — behaviour validated through unit tests.