Distinguish permission errors from 404 deleted when loading changesets
Created by: eseliger
I discovered this while investigating how we could use a single bot account with multiple tokens over all changesets. Before, these errors were not handled properly and a token not having the right scope would mark a changeset as deleted in a syncer run, which is bad and currently may cause issues if an external service gets updated with an invalid token, for example. That would mean it would mark all changesets as deleted as the syncer proceeds. This fixes it by relying on the fact that every pull/merge request in a repo can be seen, if the repo can be seen. (This is at least valid for the three code hosts currently supported). So if the error is a project/repo not found error, it should be safe to assume that there is no access, instead of the changeset being deleted. This was already working for GitHub, but not for GitLab and Bitbucket Server. Sadly, GitLabs error reporting is a bit vague, but it works good enough, I think.