Skip to content

Commit

Permalink
Recognise 'Branch cannot be merged' error and retry later
Browse files Browse the repository at this point in the history
  • Loading branch information
Nir Izraeli committed Feb 24, 2021
1 parent 0c0e044 commit 4bf0f35
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion marge/single_merge_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ def execute(self):
log.warning("Skipping MR !%s: %s", merge_request.info['iid'], err.reason)
except CannotMerge as err:
message = "I couldn't merge this branch: %s" % err.reason
if "'Branch cannot be merged'" in err.reason:
message += ", probably due to a race condition with a manual merge. I will try again later..."
else:
self.unassign_from_mr(merge_request)
log.warning(message)
self.unassign_from_mr(merge_request)
merge_request.comment(message)
except git.GitError:
log.exception('Unexpected Git error')
Expand Down

0 comments on commit 4bf0f35

Please sign in to comment.