Skip to content

Handle project deletion by also deleting in Zoekt

Dmitry Gruzd requested to merge 389760-zoekt-handle-project-deletion into master

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

  1. Enable Zoekt
  2. Update the flight project visibility to public (since we haven't enabled private repository support yet)
  3. ::Feature.enable(:use_new_zoekt_indexer)
  4. Zoekt::IndexerWorker.new.perform(Project.find_by_full_path('flightjs/flight').id)
  5. Ensure that you have index files in $GDK_DIR/zoekt-data/development/index
  6. 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)
  1. 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.

Related to #389760 (closed)

Edited by Dmitry Gruzd

Merge request reports