Skip to content

Repo Sync: If all errors are warnings, delete repos with bad permissions

Warren Gifford requested to merge iv/fix-non-fatal-errors-stopping-sync into main

Created by: varsanojidan

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

If all errors during repo sync are warnings of either Unauthorized/Forbidden, we should remove the related repos. Warning errors are generally reserved for smaller portions of repo-syncs (i.e. just bitbucket projectKeys atm), and if all the errors during a sync are just permissions based (401 or 403) its fair to assume that there was a change of permissions and we can properly complete the sync and delete any not-seen repos.

Test plan

Tested manually against bitbucket.sgdev.org

Merge request reports

Loading