persistence-elastic: handle es8 bulk response#3391
persistence-elastic: handle es8 bulk response#3391J12934 merged 5 commits intosecureCodeBox:mainfrom
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.