Handle project deletion by also deleting in Zoekt
What does this MR do and why?
Right now we do nothing in Zoekt when a project is deleted. This means that we leave orphaned bare repos and index data laying around in Zoekt.
This MR changes that since we've merged the delete action to the new indexer.
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
- Enable Zoekt
- Update the flight project visibility to public (since we haven't enabled private repository support yet)
::Feature.enable(:use_new_zoekt_indexer)
Zoekt::IndexerWorker.new.perform(Project.find_by_full_path('flightjs/flight').id)
- Ensure that you have index files in
$GDK_DIR/zoekt-data/development/index
- Execute these commands for the indexed project
project = Project.find_by_full_path('flightjs/flight')
::Gitlab::Search::Zoekt::Client.delete(root_namespace_id: project.root_namespace.id, project_id: project.id)
- Ensure that the index files of this project were deleted from
$GDK_DIR/zoekt-data/development/index
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 #389760 (closed)
Edited by Dmitry Gruzd