Skip to content

Use search_files_by_regexp instead of search_files_by_name

What does this MR do and why?

This will use the search_files_by_regexp instead of search_files_by_name if the feature_flag code_basic_search_files_by_regexp is turned on for the project. search_files_by_regexp returns a better result. We can also make case insensitive search with search_files_by_regexp

Screenshots or screen recordings

How to set up and validate locally

  1. Start the local development environment.
gdk start
  1. In the rails console turn on the feature
Feature.enable :code_basic_search_files_by_regexp, Project.find(7)

You can choose any project in your local DB

  1. Make sure the advanced search is disabled

  2. Search for adopters under the project scope with project id 7 selected. You will see the result ADOPTERS.md as well

  3. Now disable the feature

Feature.disable :code_basic_search_files_by_regexp, Project.find(7)
  1. Search for adopters under the project scope with project id 7 selected. You will not see the result ADOPTERS.md

MR acceptance checklist

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

Related to #382489 (closed)

Edited by Ravi Kumar

Merge request reports

Loading