repo-updater: Improved repository handling for Github external services
Created by: tsenart
This change-set is a test-bed for using the new repository syncing code with a single external service kind, namely, Github.
Once we nail this one together, @keegancsmith and I will split the remainder of the code hosts between ourselves.
Part of #2025 (closed)
TODO before merging this PR:
-
Add feature flag. -
Add and test migrations to drop "global_dep" and "pkgs" tables. These migrations need to come before the migration that adds a unique (external_service_type, external_service_id, external_id) constraint to the repo table because it only knows how to update foreign key constraints on the "discussion_threads_target_repo" table and it'd fail because of the other existing foreign key constraints on "global_dep_repo_id" and "pkgs_repo_id". -
Make api.ExternalServicesListRequest{Kind -> Kinds}
change backwards compatible. (Keep old fieldKind
for the roll-out) -
Address TODO around repos being renamed that are marked as deleted. -
Test feature flag. -
Ensure that repos are always upserted with external_service_xxx
columns fully set in the old code. -
Review the PR
Deployment notes
- Deployment on sourcegraph.com will likely require some hand-holding because the migrations will take relatively long.
- Ensure that Kubernetes timeouts don't kill the migrations mid-way.