Skip to content

Zoekt data is not be dependant on elasticsearch settings

What does this MR do and why?

Remove the elasticsearch dependency for the Zoekt data cleaning on the project deletion.

Added a new worker Zoekt::DeleteProjectInZoektWorker which gets called on the event Projects::ProjectDeletedEvent if the Zoekt search is enabled for the project.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

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. Checkout to the master
  2. Setup Zoekt for a namespace.
  3. Create a new project under the selected namespace.
  4. Perform a code search under the project just to make sure zoekt is setup.
  5. Now uncheck the Elasticsearch indexing under the AdvancedSearch setting.
  6. Restart the gdk. This step might be skipped. I did just to do a fresh test.
  7. tail the log/sidekiq.log in a new tab
  8. Delete this project immediately from the setting
  9. Notice that there will be no call to the Search::Zoekt::DeleteProjectWorker in the logs. Also, you can verify that the zoekt data for this project is still present under gitlab-development-kit/zoekt-data/development/index path. The data format is "#{project_id}_v16.00000.zoekt"
  10. Now create a new project under the same namespace and perform a code search just to make sure zoekt is setup.
  11. Switch to the branch of this MR. 467183-zoekt-data-is-not-getting-deleted-when-elasticsearch_indexing-is-false-in-application
  12. Delete this project immediately from the setting
  13. Notice that there will be a call to the Search::Zoekt::DeleteProjectWorker in the logs. Also, you can verify that the zoekt data for this project is not present under gitlab-development-kit/zoekt-data/development/index path. The data format is "#{project_id}_v16.00000.zoekt"

Related to #467183 (closed)

Edited by Ravi Kumar

Merge request reports

Loading