Subscribe to the GroupArchivedEvent for Zoekt
What does this MR do and why?
This code change improves how the search system handles archived groups and projects. The main updates include:
-
New event handling: Added a new worker that automatically updates search indexes when an entire group (and all its projects) gets archived, ensuring search results stay current.
-
Better archive detection: Changed the system to check if a project OR any of its parent groups are archived, rather than just checking the project itself. This provides more accurate archive status.
-
Performance improvements: Added database query optimizations to reduce the number of database calls when loading project and namespace settings, making the system faster.
-
Code cleanup: Updated test files to use more consistent coding patterns and removed some outdated configuration entries.
The changes ensure that when administrators archive a group, all related projects are properly updated in the search system, and the archive status is determined more comprehensively by looking at the entire group hierarchy rather than just individual projects.
References
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
- Create a group with projects inside it
- Disable the caching testing: https://docs.gitlab.com/integration/zoekt/#cache-search-results
- Perform a zoekt code search on the group
- Ensure the project is shown in the search result
- Archive the group
- Again perform the search, you will see that the project is not shown in the search result. There might be some delay in indexing.
- Check the checkbox
Include archivedand verify that the project is shown in the search result
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #577146 (closed)