Replacement for repos.list
Created by: nicksnyder
https://github.com/sourcegraph/sourcegraph/pull/1391 removed support for repos.list because that configuration option didn't fit in with how we wanted to model code host connections with external services.
repos.list served as an escape hatch for code hosts that we don't have explicit API integrations for (e.g. bitbucket.com). It is incredibly valuable to be able to say "we support any Git code host", even if we don't have a direct integration with that code host.
To support any code host in the new external services model, the proposal is to create a new external service type called "Other". The JSON config will look roughly like this:
{
"url": "https://bitbucket.com",
"repos": [
"a/b",
"c/d"
]
}
This will cause repo-updater/gitserver to clone the following repos:
git clone https://bitbucket.com/a/b
git clone https://bitbucket.com/c/d
When inserting into the repo
table in the database, external_*
columns will be populated as follows
-
external_service_type
will be set toother
-
external_service_id
will be set to the url of the external service (e.g. "https://bitbucket.com"). -
external_id
will be the fully qualified clone uri (e.g. "https://bitbucket.com/a/b")
Note that repositories synchronized in this way will not support renames, but that is the state of the current system today (which is why we moved toward the external services model).
Checklist
-
Add "OtherExternalServiceConnection" type to site.schema.json -
Add code to https://github.com/sourcegraph/sourcegraph/tree/master/cmd/repo-updater/repos to fetch repos for these other connections. -
Write a test plan