Create SST in backend for scope used by Search
Problem
There are edge cases where the backend will completely ignore the scope param in the URL for searches (counts, autocompletes, etc). That code is in app/services/search/project_service.rb and app/services/search/global_service.rb. It's basically dealing with a switch to the search where the scope is no longer supported (example: epics in project scoped searches).
Proposal
The backend should be the a single source of truth for what scope is being used and every reference to scope in the backend and frontend should pull from that source. The source should not be located in the search service so it could be used more widely in the codebase.
The following discussion from !118525 (merged) should be addressed:
-
@terrichu started a discussion: thought (non-blocking): one thing I thought about is that the backend ignores the
params[:scope]in some cases. These are edge case scenarios, such as being in an Epic Group scoped search, and selecting a project from the drop down. the URL hasparams[:scope] = 'epics'but the backend will overwrite that to use a scope ofblobs(code is in app/services/search/project_service.rb and app/services/search/global_service.rb). In those cases, if a user has reached the limit for epics and switches over to project search (and should have received blobs scope), they will be blocked. The experience isn't great but it's an edge case so do not feel it's a blocker.The backend should be the a single source of truth for what scope is being used and every reference to scope in the backend and frontend should pull from that source (related: #393053 (closed)). I'm going to resolve this discussion into a follow up issue