Replace calling ::Gitlab::Elastic::Helper.default.client with calling Gitlab::Search::Client
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Instead of calling Gitlab::Elastic::Helper.default.client, call Gitlab::Search::Client which has an adapter for Gitlab::Elastic::Helper.default.client. This sets us up to add a new adapter which eventually will remove reliance on the gem.
There are some places where Gitlab::Elastic::Helper.default.client is called directly and others where Gitlab::Elastic::Helper.default is stored into a variable (example helper) and helper.client is called.
Implementation plan
The fix depends on the use of the .client call in the code. It could include:
- replace existing code in
clientmethod withGitlab::Search::Client.new - create a new
clientmethod which usesGitlab::Search::Client.new. replace all calls tohelper.clientwith the new method
Files which need to be changed:
-
ee/spec/support/elastic.rb -
ee/app/models/elastic/migration_record.rb -
ee/app/workers/elastic_delete_project_worker.rb - ee/lib/elastic/migration.rb
- ee/lib/search/cluster_health_check/elastic.rb
-
ee/spec/support/helpers/elasticsearch_helpers.rb. Note: If any specs calles_helper.clientthis file needs a newes_clientmethod added and documentation for spec support helpers must be updated also.
Edited by 🤖 GitLab Bot 🤖