Skip to content

Commit

Permalink
Increase to 30 seconds wait time before trying to merge previous MRs
Browse files Browse the repository at this point in the history
When a queued MR (previously blocked by another MR causing conflicts) is not blocked anymore, Gitlab needs time to correctly report the status of that MR. 5 seconds wasn't always enough. Ref #24
  • Loading branch information
fbpe committed Oct 31, 2024
1 parent 129adbe commit edf6487
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/service/GitLabService.java
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ private void mergePreviousAutoMr(CascadeResult result, String gitlabEventUUID, L
Log.infof("GitlabEvent: '%s' | Found auto merge request between '%s' and '%s' - iid: '%s', mergeWhenPipelineSucceeds: '%s'", gitlabEventUUID, prevSourceBranch, sourceBranch, mr.getIid(), mr.getMergeWhenPipelineSucceeds());
if (mr.getMergeWhenPipelineSucceeds() == Boolean.FALSE) {
if (mr.getHasConflicts() != null && mr.getHasConflicts()) {
//wait 5 seconds in order for GitLab to have time to update the merge request status
sleepSeconds(5);
// wait some seconds in order for GitLab to have time to update the merge request status
sleepSeconds(30);
mr = getExistingMr(gitlabEventUUID, mr);
}
MergeRequestResult mrResult = acceptAutoMergeRequest(gitlabEventUUID, mr);
Expand Down

0 comments on commit edf6487

Please sign in to comment.