Skip to content

Sync and index all non global external services on Cloud

Created by: ryanslade

Currently we only sync and index repos owned by user external services in the background on Cloud.

This makes it difficult for site admins to add new special case external services, for example: https://github.com/sourcegraph/sourcegraph/issues/17424

Instead we should sync and index all external services except for our special "Cloud Global" services that we use as the default external services for GitHub and GitLab. We want to exclude these as they can own a very large number of repos.

We'll need to make the following changes:

  • Introduce a new cloud_global column on external_services which defaults to false
  • Add a DB constraint that only one cloud global service can exist per kind. Currently this is checked in code when we save an external service.
  • Deploy this change and manually set the flag for our global services.
  • Deprecate the CloudGlobal setting in our GitHub and GitLab external service configuration and use the value from the db instead
  • For background syncing, only exclude external services with the cloud_global flag set.
  • Update ListDefaultRepos to include repos in default_repos and any repos owned by external services where cloud_global is false.