Force to recreate all diffs on import
Summary
Today, if the PullRequestImporter
fails for whatever reason, for example when pulling git remote,
the subsequent run will likely fail, because of ActiveRecord::RecordNotUnique
, due to
-
MergeRequestDiff.create_bulk
, - and
MergeRequestDiff#create_merge_request_diff_files
And we receive an exception like this, that is not retryable afterwards:
2019-03-17_04:47:26.94173 2019-03-17T04:47:26.941Z 129639 TID-oteygqvx3 WARN: {"context":"Job raised exception","job":{"class":"Gitlab::GithubImport::ImportPullRequestWorker","args":[12000,{"iid":19221,"title":"...","description":"...","source_branch":"...","target_branch":"develop"
Steps to reproduce
Have Git network failure when importing pull requests.
What is the current bug behavior?
It fails, and does not retry.
What is the expected correct behavior?
It works, and it retries.