Skip to content

Be explicit about global code hosts for Cloud

Created by: ryanslade

Currently when repo-updater starts up in “dotcom” mode it grabs a list of all admin external services and chooses the last GitHub and GitLab external service as our “global” service.

https://github.com/sourcegraph/sourcegraph/blob/2a4c4b45db94cc7df0df8a28b73499689e2d8139/cmd/repo-updater/shared/main.go#L135-L177

This is very brittle as if anyone adds a new admin external service it’ll be chosen instead. I see a few ways to solve this:

After some discussion we decided that the best option is to add a new bool flag to one GitHub and one GitLab external service marking them as global. We will enforce on save that only one service of each type can have this flag set.

Slack thread for context: https://sourcegraph.slack.com/archives/CHPC7UX16/p1603356213372600