Skip to content

Fix TypeError for empty blob.path

Dmitry Gruzd requested to merge 325308-fix-empty-blob-path into master

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.

#325308 (closed)

Screenshots or screen recordings

before after
SCR-20230310-jub SCR-20230310-jtr

How to set up and validate locally

  1. Enable Advanced Search integration
  2. Update a specific document you can find with this curl command to set blob.path to null:
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"
 }
}'
  1. 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.

Related to #325308 (closed)

Edited by Dmitry Gruzd

Merge request reports

Loading