Gitlab::GithubImport:ImportPullRequestMergedByWorker: Rescue the exception in execute method
Problem
We have noticed an increased number of failing jobs over the past 7 days (Oct., 11th - Oct., 18th):
As for the failures related to Gitlab::GithubImport:ImportPullRequestMergedByWorker
, we can see in Kibana that there was a spike on Oct., 14th:
Octokit::Unauthorized
It seems that the exception is raised in the execute
method in https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/github_import/importer/pull_request_merged_by_importer.rb#L18
Proposal
We should probably rescue the Octokit::Unauthorized
in PullRequestMergedByImporter
workers execute
method.
We decided to rescue just the Octokit::NotFound
since the Octokit::Unauthorized
was most likely raised because the AccessToken of the user expired. Therefore, in this case, we shouldn't rescue the error and let it fail.