Skip to content

repo-updater: Use NewDiff instead of Upsert for sourcegraph.com repoLookup

Administrator requested to merge core/sourcegraph-dot-com into master

Created by: keegancsmith

Previously we directly used upsert, which doesn't actually upsert unless the repos correctly have ID set. It relied on ID to decide between an update or an insert. Since we directly passed a sourced repo, it would never have ID set (nor would we have updated_at fields, etc set).

So we introduce SyncSubset. SyncSubset takes a list of sourced repositories and runs the diff algorithm on related repositories from the store. IE those with matching names or external repository specs. Additionally this allows us to detect renames on Sourcegraph.com.

Fixes https://github.com/sourcegraph/sourcegraph/issues/4046

Merge request reports

Loading