Use new auth filter in merge requests
What does this MR do and why?
This MR introduces using the new query builder authorization filter to merge request search behind a FF.
Changes (generated by Duo)
- Created feature flag
search_advanced_merge_requests_new_auth_filterto enable new authorization filter for merge request searches - Updated
MergeRequestQueryBuilderto conditionally useby_search_level_and_membership(new filter) when feature flag is enabled, orby_project_authorization(old filter) when disabled - Added comprehensive specs to test both feature flag enabled and disabled scenarios, ensuring proper filter selection and backward compatibility
- Implemented gradual rollout mechanism for improved query performance while maintaining safe rollback capability
References
Relates to issue #491211
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
- enable elasticsearch in gdk
- perform searches at global, group, and project level for
*(note how many merge requests you get) - enable the FF
search_advanced_merge_requests_new_auth_filter - perform the same searches, make sure the numbers match
- repeat with a non-admin user
- repeat with an anonymous user
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.
Edited by Terri Chu