Skip to content

repo-updater: Skip listing conflicting repos when sourcing fails

Administrator requested to merge repo-updater/fix-memory-spikes into main

Created by: tsenart

This commit makes it so we don't list conflicting repos when sourcing fails. When len(sourced) == 0, by construction, there won't be any conflicting repos.

What was happening instead, was that we were loading all repos from the repo table, because sourced.Names() was empty, and no other predicates were included in the resulting query.

This bug was introduced in https://github.com/sourcegraph/sourcegraph/pull/16516, which made it so we don't abort the sync when there are authorization errors during sourcing, so that we'd end up removing repos associated with that external service in that event.

Fixes #16679

Merge request reports

Loading