Add project transsfer worker for zoekt
What does this MR do and why?
We have added a project transfer worker which does the following:
- If a project is moved out of a Zoekt indexed namespace we need to trigger a delete to clean up the data in Zoekt.
- If a project is moved into a Zoekt indexed namespace we need to trigger the project to be indexed.
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
Numbered steps to set up and validate the change are strongly suggested.
- Make sure you have Advanced Search enabled
- Enable zoekt by adding following lines in
gdk.yml
zoekt:
enabled: true
- Run the following commands from rails console to enable zoekt for a specific namespace
::Feature.enable(:index_code_with_zoekt)
::Feature.enable(:search_code_with_zoekt)
zoekt_shard = ::Zoekt::Shard.find_or_create_by!(index_base_url: 'http://127.0.0.1:6080/', search_base_url: 'http://127.0.0.1:6090/')
namespace = Namespace.find_by_full_path("flightjs") # Some namespace you want to enable
::Zoekt::IndexedNamespace.find_or_create_by!(shard: zoekt_shard, namespace: namespace.root_ancestor)
::Feature.enable(:use_new_zoekt_indexer)
- Test the following scenarios for moving project
- from namespace_A to namespace_A/subgroup_A (zoekt enabled)
- from namespace_A to namespace_B (zoekt enabled in both)
- from namespace_C (no zoekt) to namespace_A (zoekt enabled)
- from namespace A (zoekt enabled) to namespace_C (no zoekt)
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 #389761 (closed)
Edited by Siddharth Dungarwal