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_filter and every private helper only it used:

    • should_use_project_ids_filter?
    • project_ids_filter
    • project_ids_query
    • pick_projects_by_membership
    • pick_projects_by_visibility
    • limit_by_feature
    • rejected_project_filter
    • traversal_ids_filter
    • traversal_ids_ancestry_filter
    • ancestry_filter
    • authorized_namespace_ids
    • authorized_project_ids
    • scoped_project_ids
    • filter_ids_by_feature

    Search::Elastic::Filters and Search::Elastic::Concerns::AuthorizationUtils have their own methods with some of these names. Those stay.

  • In ee/lib/elastic/latest/git_class_proxy.rb, removed the options[:no_join_project] assignments in commit and blob search, and disable_project_joins_for_blob?. Nothing downstream read the option there. Search::Elastic::Filters ignores it.

  • no_join_project itself stays. basic_query_hash and Search::Elastic::Queries use 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_except from app/models/namespace.rb. Its only caller was rejected_project_filter, and Keela (the unused-code linter) flagged it.

  • Updated a comment in ee/lib/gitlab/elastic/search_results.rb that pointed at the deleted project_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.

🤖 Generated with Claude Code

Edited by Ravi Kumar

Merge request reports

Loading
Loading