Add traversal ids query for zoekt searches
What does this MR do and why?
Add traversal ids query for zoekt searches.
AI Summary:
This code change introduces a new feature flag called
zoekt_traversal_id_queries
that modernizes how GitLab's search system handles group and global searches.The main improvement is replacing the old method of searching through specific project lists with a more efficient approach that uses "traversal IDs" - essentially breadcrumb trails that help the system understand organizational hierarchies and user permissions.
Key changes include:
- Adding safety checks to prevent using the old search method when the new feature is enabled
- Creating a new authorization system that better handles user permissions across different visibility levels (public, internal, private)
- Updating the search request builder to construct more sophisticated queries that respect GitLab's permission model
- Adding proper error handling for unsupported search scenarios
- Improving how the system selects which search nodes to use when no specific target is provided
The feature is currently disabled by default (
default_enabled: false
) and is being rolled out as a risk-reduction measure for GitLab.com. This allows for gradual testing and rollback if issues arise.The changes primarily affect enterprise edition code and focus on making searches more secure and efficient by better understanding user access rights within GitLab's group and project hierarchy structure.
References
Screenshots or screen recordings
How to set up and validate locally
Run important test coverage
./bin/rspec \
./ee/spec/requests/api/graphql/search/blob_search_spec.rb \
./ee/spec/services/ee/search/group_service_blob_and_commit_visibility_spec.rb:49 \
./ee/spec/services/ee/search/global_service_blob_and_commit_visibility_spec.rb:47 \
./ee/spec/services/ee/search/project_service_blob_and_commit_spec.rb:48
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.