You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
logger.Info("GitLab returned HTTP [200 OK] after updating commit status")
473
+
}
474
+
475
+
returnnil
476
+
}
477
+
ifattempt==maxAttempts {
478
+
returnerrors.Wrap(err, fmt.Sprintf("failed to update commit status for '%s' @ '%s' to '%s' after %d attempts", repo.FullName, pull.HeadCommit, src, attempt))
// GitLab does not allow merge requests to be merged when the pipeline status is "running."
482
493
483
494
ifresp.StatusCode==http.StatusConflict {
484
-
sleep:=retryer.ForAttempt(float64(i))
485
-
486
-
logger.With("retry_in", sleep).Warn("GitLab returned HTTP [409 Conflict] when updating commit status")
487
-
time.Sleep(sleep)
488
-
489
-
continue
495
+
logger.Warn("GitLab returned HTTP [409 Conflict] when updating commit status")
490
496
}
491
497
}
492
498
493
-
// Log we got a 200 OK response from GitLab after at least one retry to help with debugging/understanding delays/errors.
494
-
iferr==nil&&i>0 {
495
-
logger.Info("GitLab returned HTTP [200 OK] after updating commit status")
496
-
}
499
+
sleep:=retryer.Duration()
497
500
498
-
// Return the err, which might be nil if everything worked out
499
-
returnerr
501
+
logger.With("retry_in", sleep).Warn("GitLab errored when updating commit status: %w", err)
502
+
time.Sleep(sleep)
500
503
}
501
-
502
-
// If we got here, we've exhausted all attempts to update the commit status and still failed, so return the error upstream
503
-
returnerrors.Wrap(err, fmt.Sprintf("failed to update commit status for '%s' @ '%s' to '%s' after %d attempts", repo.FullName, pull.HeadCommit, src, maxAttempts))
0 commit comments