codeintel: Update candidate repos for auto-indexing
Created by: efritz
Fixes https://github.com/sourcegraph/sourcegraph/issues/26852.
This PR makes the following high-level changes:
- The repositories we choose to auto-index now come from indexing policies and does not use search contexts as a back-door way to collect sets of repositories.
- We now have global limits (configured in site settings) to restrict the blast radius of indexing patterns like
*
- Update the
PreviewRepositoryFilter
graphql resolver to take multiple patterns and return a paginate-able response - Better UI!
Disallow global policies:
Allowed global policies:
This PR makes the following lower-level changes:
- Replace
RepoIDsByGlobPattern
withRepoIDsByGlobPatterns
that takes multiple glob patterns and handles pagination - Update
UpdateReposMatchingPatterns
to takes a optional maximum number of matching repositories per pattern set (presumably belonging to the same policy) - Update
SelectRepositoriesForIndexScan
to scan the repos matching configuration policies instead of using search contexts. We'll be able to delete our large corpus search context in prod after this PR becomes effective. - Adds two new site config flags under
codeIntelAutoIndexing
- Exposes the site config value
codeIntelAutoIndexingAllowGlobalPolicies
to the UI context