From 3181b736fce04cfe649a85394b247ccc7c9a2fc5 Mon Sep 17 00:00:00 2001 From: Anton Chernov Date: Tue, 26 Mar 2019 16:07:16 +0100 Subject: [PATCH] Added retries to GitHub status update --- ci/Jenkinsfile_utils.groovy | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/ci/Jenkinsfile_utils.groovy b/ci/Jenkinsfile_utils.groovy index 054deb5f87d2..0402dfada497 100644 --- a/ci/Jenkinsfile_utils.groovy +++ b/ci/Jenkinsfile_utils.groovy @@ -186,18 +186,26 @@ def update_github_commit_status(state, message) { context = get_github_context() echo "context=${context}" - step([ - $class: 'GitHubCommitStatusSetter', - reposSource: [$class: "ManuallyEnteredRepositorySource", url: repoUrl], - contextSource: [$class: "ManuallyEnteredCommitContextSource", context: context], - commitShaSource: [$class: "ManuallyEnteredShaSource", sha: commitSha], - statusBackrefSource: [$class: "ManuallyEnteredBackrefSource", backref: "${env.RUN_DISPLAY_URL}"], - errorHandlers: [[$class: 'ShallowAnyErrorHandler']], - statusResultSource: [ - $class: 'ConditionalStatusResultSource', - results: [[$class: "AnyBuildResult", message: message, state: state]] - ] - ]) + // a few attempts need to be made: /~https://github.com/apache/incubator-mxnet/issues/11654 + def attempts = 1..3 + attempts.each { attempt -> + echo "Sending GitHub status attempt ${attempt}..." + + step([ + $class: 'GitHubCommitStatusSetter', + reposSource: [$class: "ManuallyEnteredRepositorySource", url: repoUrl], + contextSource: [$class: "ManuallyEnteredCommitContextSource", context: context], + commitShaSource: [$class: "ManuallyEnteredShaSource", sha: commitSha], + statusBackrefSource: [$class: "ManuallyEnteredBackrefSource", backref: "${env.RUN_DISPLAY_URL}"], + errorHandlers: [[$class: 'ShallowAnyErrorHandler']], + statusResultSource: [ + $class: 'ConditionalStatusResultSource', + results: [[$class: "AnyBuildResult", message: message, state: state]] + ] + ]) + + sleep 1 + } echo "Publishing commit status done."