Remove unused has_parent search path from Advanced Search
What does this MR do and why?
Removes the unused has_parent search code from Advanced Search.
Nothing calls it. ApplicationClassProxy#authorization_filter lost its last caller when the git class proxy moved to the shared filters (commit eaf8adc0, "Remove search_query_authorization_refactor feature flag").
No behavior change.
This is independent of the companion MR that stops writing join_field (!259064 (merged)). The two touch different files and can merge in either order.
Details
-
Deleted from
ee/lib/elastic/latest/application_class_proxy.rb:authorization_filterand every private helper only it used:should_use_project_ids_filter?project_ids_filterproject_ids_querypick_projects_by_membershippick_projects_by_visibilitylimit_by_featurerejected_project_filtertraversal_ids_filtertraversal_ids_ancestry_filterancestry_filterauthorized_namespace_idsauthorized_project_idsscoped_project_idsfilter_ids_by_feature
Search::Elastic::FiltersandSearch::Elastic::Concerns::AuthorizationUtilshave their own methods with some of these names. Those stay. -
In
ee/lib/elastic/latest/git_class_proxy.rb, removed theoptions[:no_join_project]assignments in commit and blob search, anddisable_project_joins_for_blob?. Nothing downstream read the option there.Search::Elastic::Filtersignores it. -
no_join_projectitself stays.basic_query_hashandSearch::Elastic::Queriesuse it to skip the doc type filter. Snippet search depends on that filter because snippets share the main index with blobs and milestones. -
Removed
Namespace#all_project_ids_exceptfromapp/models/namespace.rb. Its only caller wasrejected_project_filter, and Keela (the unused-code linter) flagged it. -
Updated a comment in
ee/lib/gitlab/elastic/search_results.rbthat pointed at the deletedproject_ids_query.
References
Related to #630682
Screenshots or screen recordings
Not applicable: no UI change.
How to set up and validate locally
No behavior change. Existing Advanced Search specs cover the remaining search paths. ee/spec/services/ee/search/global_service_spec.rb already asserts no search uses has_parent.
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.