Allow to search environments within folders
Release notes
With this release, we are adding improved support for searching for environments within folders. Previously, you needed to write out the complete name to find this type of folder. Now, the search allows you to more easily find folders even if they are nested.
Background and proposal
Started from !97834 (comment 1099458438)
In Search for environment name in the Environments... (#10754 - closed) we inroduced the environments search. But it only works for foldered environments if you search with the folder name
(it would work if we searched for review/gitaly
)
To make it work we can add the index on remove_prefix(name, environment_type)
, and add or
(UNION) clause to the for_names_like
query.
That would actually be helpful in more places:
- autocomplete when adding protected environment
- autocomplete when editing feature flag
(note that it may be costly from the performance standpoint)