Skip to content

Use native JSON type in ElasticCommitIndexerWorker

What does this MR do and why?

I started seeing this warning any time I ran specs where indexing into Elasticsearch was happening

Job arguments to ElasticCommitIndexerWorker must be native JSON types, but :force is a Symbol.
See https://github.com/sidekiq/sidekiq/wiki/Best-Practices
To disable this error, add `Sidekiq.strict_args!(false)` to your initializer.

This MR changes:

  • any caller of ElasticCommitIndexerWorker to send the force param as a string key instead of a symbol
  • updates all specs to expect the new format

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

N/A

How to set up and validate locally

  1. make sure your gdk is setup for elasticsearch or the specs will not run

  2. checkout master branch

  3. run this spec (specifically the 'visibility levels' describe block

    bundle exec rspec -f d ee/spec/lib/gitlab/elastic/search_results_spec.rb:1314
  4. verify the warnings come up for ElasticCommitIndexerWorker

  5. check out this branch

  6. run the same spec

  7. verify you do not see the warnings for ElasticCommitIndexerWorker (you may still see messages for ElasticWikiIndexerWorker)

Edited by Terri Chu

Merge request reports

Loading