Skip to content

Add force option to the index API

Dmitry Gruzd requested to merge add-force-option into main

What does this MR do and why?

This MR adds Force argument to the indexing API. I believe it will be very useful for us. The latest example when we could've used it is gitlab-com/gl-infra/production#17105 (closed). Instead of deleting and then indexing, we could just use "Force": true

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Obtain the payload from the Rails console via
    puts Gitlab::Search::Zoekt::Client.instance.send(:indexing_payload, Project.find(7)).merge(Force: true).to_json
  2. Send this payload to the indexer
    curl -XPOST -d '<PAYLOAD>' -H 'Content-Type: application/json' http://127.0.0.1:6080/indexer/index
  3. Ensure that it reindexes the repository
Edited by Dmitry Gruzd

Merge request reports

Loading