Skip to content

Remove hardcoded Zoekt::Shard first

Ravi Kumar requested to merge 424747-remove-hardcoded-zoekt-shard-first into master

What does this MR do and why?

The merge request removes hardcoded Zoekt::Shard.first usage and replaces it with a dynamic shard selection based on the project's root namespace.

  • Pass shard_id in the constructor of this classGitlab:: Zoekt::SearchResults.
  • Add a method zoekt_shard_id in the concern Search::ZoektSearchable which finds the shard from the zoekt_searchable_scope root_namespace.
  • Finally, pass the shard_id to the Search::Zoekt::Client methods.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

  • Set up Zoekt
  • Perform a code search in the project in which you have enabled Zoekt. Verify everything works fine
  • Add a new code in the chosen project and search for that code. Verify it works fine.

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 #424747 (closed)

Edited by Ravi Kumar

Merge request reports