From cfab71930837319535c4ab3b0dd448f73371fff8 Mon Sep 17 00:00:00 2001 From: Anton Chernov Date: Tue, 26 Mar 2019 16:07:16 +0100 Subject: [PATCH 1/3] Added retries to GitHub status update --- ci/Jenkinsfile_utils.groovy | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/ci/Jenkinsfile_utils.groovy b/ci/Jenkinsfile_utils.groovy index 054deb5f87d2..16e6da76c728 100644 --- a/ci/Jenkinsfile_utils.groovy +++ b/ci/Jenkinsfile_utils.groovy @@ -186,18 +186,27 @@ 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 + for (int attempt = 1; attempt < 4; 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]] + ] + ]) + + if (attempt < 3) { + sleep 1 + } + } echo "Publishing commit status done." From 3d678c19d2f844f8e12dd6848d57249dd027a712 Mon Sep 17 00:00:00 2001 From: Anton Chernov Date: Thu, 28 Mar 2019 13:50:59 +0100 Subject: [PATCH 2/3] Update Jenkinsfile_utils.groovy --- ci/Jenkinsfile_utils.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/Jenkinsfile_utils.groovy b/ci/Jenkinsfile_utils.groovy index 16e6da76c728..836f02062284 100644 --- a/ci/Jenkinsfile_utils.groovy +++ b/ci/Jenkinsfile_utils.groovy @@ -187,7 +187,7 @@ def update_github_commit_status(state, message) { echo "context=${context}" // a few attempts need to be made: /~https://github.com/apache/incubator-mxnet/issues/11654 - for (int attempt = 1; attempt < 4; attempt++) { + for (int attempt = 1; attempt <= 3; attempt++) { echo "Sending GitHub status attempt ${attempt}..." step([ From 4c2efc4d3fe996c4f815627013a2e2199e36689f Mon Sep 17 00:00:00 2001 From: Anton Chernov Date: Thu, 28 Mar 2019 13:52:10 +0100 Subject: [PATCH 3/3] Update Jenkinsfile_utils.groovy --- ci/Jenkinsfile_utils.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/Jenkinsfile_utils.groovy b/ci/Jenkinsfile_utils.groovy index 836f02062284..38cc0b927c43 100644 --- a/ci/Jenkinsfile_utils.groovy +++ b/ci/Jenkinsfile_utils.groovy @@ -203,7 +203,7 @@ def update_github_commit_status(state, message) { ] ]) - if (attempt < 3) { + if (attempt <= 2) { sleep 1 } }