Skip to content

Use blobs as default scope in project search context

What does this MR do and why?

Related to #391808 (closed)

backend

  • allow no scope param for search/aggregations endpoint (this now works like search and search/count endpoints) and will pull in scope from search_service methods in project_service.rb and global_service.rb. This effectively defaults searches with no scope param defined for project searches => blobs and group/global searches => projects
  • update specs

frontend

  • use active field to determine which tab is active (this comes from the backend)

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

  1. make sure gdk is enabled for elasticsearch and advanced search is enabled (code language filter only works for advanced search)
  2. Enable the Advanced Search http://gdk:3000/admin/application_settings/advanced_search
  3. make sure the feature flag is enabled
    echo 'Feature.enable(:search_blobs_language_aggregation)' | rails c
  4. perform a search from within a project at the top left nav search bar
  5. verify that code is the default tab in the results
  6. verify that the language filter shows up

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Terri Chu

Merge request reports