Skip to content

Rename snippet_titles for search scoping

Summary

As part of a refactor of snippet searching in #208882 (closed), it became apparent that in multiple places we reference snippet_titles when searching and scoping search for Snippets.

This term is inaccurate because we actually search titles and descriptions.

I think we should change this to either be a generic snippets scope or make it more specific with something like snippet_titles_descriptions (I personally prefer the generic option)

This terminology is used across the app in the API, controllers, views, helpers, etc and would be fairly substantial change.

Improvements

This change will make the scope and associated methods in the codebase more accurate

Risks

Involved in many places in both CE and EE searching (elasticsearch for EE) so care must be taken

Involved components

Files at time of writing:

app/controllers/search_controller.rb
app/views/search/_category.html.haml
app/helpers/search_helper.rb
app/services/search/snippet_service.rb
ee/spec/support/shared_examples/services/search_service_shared_examples.rb
ee/spec/lib/gitlab/elastic/snippet_search_results_spec.rb
ee/spec/lib/ee/gitlab/snippet_search_results_spec.rb
ee/spec/services/search/snippet_service_spec.rb
ee/lib/gitlab/elastic/snippet_search_results.rb
spec/requests/api/search_spec.rb
spec/lib/gitlab/snippet_search_results_spec.rb
spec/controllers/search_controller_spec.rb
spec/helpers/search_helper_spec.rb
spec/services/search_service_spec.rb
spec/services/search/snippet_service_spec.rb
lib/gitlab/snippet_search_results.rb
lib/api/search.rb
lib/api/helpers/search_helpers.rb
doc/api/search.md
Edited by 🤖 GitLab Bot 🤖