Client errors on imports from GitHub are classed as GitLab errors
On gitlab.com, we reguarly are alerted to increased sidekiq error rate due to client errors from GitHub imports (e.g. gitlab-com/gl-infra/production#1051 (closed)).
I started by enumerating the types of errors the GitHub service was producing:
- 401 - Bad Credentials
- 404 - Not Found
- 403 - Repository was archived so is read-only
- 422 - No commit found for SHA
- 422 - Validation Failed ... This SHA and context has reached the maximum number of statuses
These are all HTTP client errors, but we should split them into 2 groups: those that are problems that need to be fixed, and those that are user error.
I reckon the first 2 are user error. We can't control the credentials or URL that users enter.
The last 3 need to be investigated, it may be a problem with how we use the GH API.
It might be better to return success when we receive a client error from an API based on input we don't control, so that GitLab operators can distinguish our own errors from the client ones.