Skip to content

Add project transsfer worker for zoekt

Siddharth Dungarwal requested to merge 389761-zoekt-indexing into master

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.

  1. Make sure you have Advanced Search enabled
  2. Enable zoekt by adding following lines in gdk.yml
zoekt:
  enabled: true
  1. 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)
  1. Test the following scenarios for moving project
    1. from namespace_A to namespace_A/subgroup_A (zoekt enabled)
    2. from namespace_A to namespace_B (zoekt enabled in both)
    3. from namespace_C (no zoekt) to namespace_A (zoekt enabled)
    4. 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.

Related to #389761 (closed)

Edited by Siddharth Dungarwal

Merge request reports

Loading