Remove hardcoded Zoekt::Shard first
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_idin the constructor of this classGitlab:: Zoekt::SearchResults. - Add a method
zoekt_shard_idin the concernSearch::ZoektSearchablewhich finds theshardfrom thezoekt_searchable_scoperoot_namespace. - Finally, pass the
shard_idto theSearch::Zoekt::Clientmethods.
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.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #424747 (closed)
Edited by Ravi Kumar