repo-updater: Enforce unique constraint on external_service_repos
Created by: ryanslade
This change introduces a unique constraint on the external_service_repos table on (repo_id, external_service_id).
Our insert function was updated to handle this using an ON CONFLICT clause.
Merge request reports
Activity
Created by: ryanslade
Part of: https://gitlab.sgdev.org/root/sourcegraph/-/issues/15797
Created by: sourcegraph-bot
Notifying subscribers in CODENOTIFY files for diff 023542e396de2c81e8bbadfb6e0429cd4e77cbfc...db0d3a6d3c187c97e5ef51968abbea8f3e56e191.
Notify File(s) @LawnGnome internal/db/repos.go Created by: codecov[bot]
Codecov Report
Merging #16022 (db0d3a6) into main (023542e) will decrease coverage by
0.00%
. The diff coverage isn/a
.@@ Coverage Diff @@ ## main #16022 +/- ## ========================================== - Coverage 52.83% 52.83% -0.01% ========================================== Files 1641 1641 Lines 82248 82248 Branches 7337 7166 -171 ========================================== - Hits 43456 43452 -4 - Misses 34943 34945 +2 - Partials 3849 3851 +2
Flag Coverage Δ go 52.65% <ø> (-0.01%)
integration 28.65% <ø> (ø)
storybook 27.89% <ø> (ø)
typescript 53.26% <ø> (ø)
unit 35.38% <ø> (ø)
Impacted Files Coverage Δ cmd/repo-updater/internal/store.go 79.94% <ø> (ø)
cmd/repo-updater/repos/store.go 81.74% <ø> (ø)
internal/db/repos.go 69.03% <ø> (ø)
.../internal/codeintel/resolvers/graphql/locations.go 81.44% <0.00%> (-4.13%)
Created by: ryanslade
LGTM, I'm concerned that this will take a long time on customer large instances. Can we increase the migration timeout somehow?
I'm not sure where the timeout is configured, I don't see anything in the actual migration code. For reference, this takes less than 10 seconds on our prod DB.