Add group transfer hook for zoekt
What does this MR do and why?
Add group transfer hook for zoekt
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)
- Now you have to do a group transfer, for that go to
Settings > General > Advanced > Transfer Group
- Then you can verify all the cases mentioned below by doing ls in
gitlab-development-kit/zoekt-data/development/index
- Transfer a non-indexed group to a non-indexed group you will observe no new data is being added.
- Transfer a indexed group to a zoekt indexed group you will observe no new data is being added and all the old project data is at the same place.
- Transfer a non-indexed group to a zoekt indexed group you will see that a new file(s) are added of format
<project-id>_xxxxxxx.zoekt
of the projects that are part of the group. - Transfer a zoekt indexed group to a non-indexed group you will see that the file(s) are deleted of format
<project-id>_xxxxxxx.zoekt
of the projects that are part of the group.
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