[ci/getCheckoutInfo] retry fetching upstream changes to calculate mergeBase (#69320)

Co-authored-by: spalger <spalger@users.noreply.github.com>
This commit is contained in:
Spencer 2020-06-16 13:45:20 -07:00 committed by GitHub
parent ade4c8dded
commit 5c327a12dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -22,10 +22,14 @@ def call(branchOverride) {
).trim()
if (repoInfo.targetBranch) {
sh(
script: "git fetch origin ${repoInfo.targetBranch}",
label: "fetch latest from '${repoInfo.targetBranch}' at origin"
)
// Try to clone fetch from Github up to 8 times, waiting 15 secs between attempts
retryWithDelay(8, 15) {
sh(
script: "git fetch origin ${repoInfo.targetBranch}",
label: "fetch latest from '${repoInfo.targetBranch}' at origin"
)
}
repoInfo.mergeBase = sh(
script: "git merge-base HEAD FETCH_HEAD",
label: "determining merge point with '${repoInfo.targetBranch}' at origin",