Fix TypeError for empty blob.path
What does this MR do and why?
This MR fixes argument error exceptions for the cases when blob.path
is not set in Elasticsearch. The root cause for empty fields is not determined, but this MR is aimed to provide graceful degradation instead of raising an exception.
Screenshots or screen recordings
before | after |
---|---|
How to set up and validate locally
- Enable Advanced Search integration
- Update a specific document you can find with this curl command to set
blob.path
tonull
:
curl -H 'Content-type: application/json' -XPOST 'http://localhost:9200/gitlab-development/_update_by_query' -d '{
"query": {
"term": {
"_id": "11_vendor/gems/bundler-checksum/bin/bundler-checksum"
}
},
"script": {
"source": "ctx._source['blob']['path'] = null",
"lang": "painless"
}
}'
- Refresh the search page where you found this document
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #325308 (closed)
Edited by Dmitry Gruzd