Skip to content
Snippets Groups Projects

Automatically index projects in Zoekt when namespace is enabled

All threads resolved!

What does this MR do and why?

Zoekt is a new code search database being gradually rolled out on GitLab.com . It is intended to replace Elasticsearch for code search.

We use the ::Zoekt::IndexedNamespace model as a way to keep track of namespaces that are enabled as part of our rollout of using Zoekt for code search. When we implemented this we did not automate the indexing of the projects when this was enabled and we had this as another manual step as part of the rollout. Now that we're building APIs to enable a namespace in !116650 (merged) we want this to also automatically index all the projects in the namespace when it is enabled.

This MR just adds an after create hook on the model to trigger a Sidekiq worker which then loops through all projects in the namespace and triggers another Sidekiq worker to do the indexing. This is larger a copy of the way we do it with the ElasticNamespaceIndexerWorker and as such we have added a 2nd argument to the worker which will be used in the future to handle deletes.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

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 #389756 (closed)

Edited by Dylan Griffith

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Dylan Griffith
  • Siddharth Dungarwal approved this merge request

    approved this merge request

  • :wave: @sdungarwal, thanks for approving this merge request.

    This is the first time the merge request is approved. To ensure full test coverage, a new pipeline will be started shortly.

    For more info, please refer to the following links:

  • Siddharth Dungarwal removed review request for @sdungarwal

    removed review request for @sdungarwal

  • Dylan Griffith requested review from @kassio

    requested review from @kassio

  • Kassio Borges
  • Kassio Borges removed review request for @kassio

    removed review request for @kassio

  • Dylan Griffith mentioned in issue #407329

    mentioned in issue #407329

  • @kassio back to you for another review. I responded and applied your suggestion.

  • Dylan Griffith requested review from @kassio

    requested review from @kassio

  • Dylan Griffith mentioned in commit 5670f066

    mentioned in commit 5670f066

  • Dylan Griffith added 1 commit

    added 1 commit

    • 5670f066 - Automatically index projects in Zoekt when namespace is enabled

    Compare with previous version

  • Jessie Young approved this merge request

    approved this merge request

  • Jessie Young resolved all threads

    resolved all threads

  • Jessie Young enabled an automatic merge when the pipeline for bed93fd9 succeeds

    enabled an automatic merge when the pipeline for bed93fd9 succeeds

  • merged

  • Jessie Young mentioned in commit d949db08

    mentioned in commit d949db08

  • Dylan Griffith mentioned in commit f95a5c98

    mentioned in commit f95a5c98

  • added workflowstaging label and removed workflowcanary label

  • Dylan Griffith changed milestone to %16.0

    changed milestone to %16.0

  • mentioned in issue #389756 (closed)

  • Please register or sign in to reply
    Loading