add default_repos table and use it if it is nonempty and the repo: field is missing
Created by: ijt
This PR makes progress on https://github.com/sourcegraph/sourcegraph/issues/4992#issuecomment-517559931. The goal is to make queries without a repo:
field work on sourcegraph.com.
Test plan: Unit test for defaultRepos.List
.
Manual testing:
- In
psql
add a row todefault_repos
for some repo in therepo
table. - Run a query with something to be found in that repo, but without a
repo:
field. - The search results should only show matches for that repo and no others.
-
delete from default_repos;
and check that search results appear for other repos as well.