Add filtering to RepositoryService.SearchFilesByName

The Go proxy MVC gitlab!27746 (merged) uses RepositoryService.SearchFilesByName to identify all go.mod files in the repository for a given ref. Currently, this requires query: '.'. For repositories with many files, this will result in significant wasted bandwidth, since the only records that are needed are go.mod and **/go.mod. This impacts gitlab#218083 (closed), gitlab#219311 (closed), and gitlab!29642 (closed).

I propose that an optional field is added to SearchFilesByNameRequest, such as include, exclude, filter, or similar. This field will be a glob, regex, or some other type of pattern that will be applied as a filter to the response prior to sending.

If this proposal is acceptable, I would be happy to work on a MR.

Edited by Ethan Reesor
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information