From: David Galloway Date: Fri, 13 Mar 2026 17:16:04 +0000 (-0400) Subject: ceph-dev-cron: ls-remote failure is not fatal X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=90e0ebacc200317af4246aecb71c390a0a28b4e7;p=ceph-build.git ceph-dev-cron: ls-remote failure is not fatal Signed-off-by: David Galloway --- diff --git a/ceph-dev-cron/build/Jenkinsfile b/ceph-dev-cron/build/Jenkinsfile index 4ab6768e..9d52e2e6 100644 --- a/ceph-dev-cron/build/Jenkinsfile +++ b/ceph-dev-cron/build/Jenkinsfile @@ -85,15 +85,26 @@ node('built-in') { // b is short for branch. We're just looping over branches here. // Ultimately we end up with array "tips" that looks like "last" but is the current // tip of each branch instead of the last job's tips. + + // branches = branches.findAll rewrites branches[] by removing a branch (b) if ls-remote fails. + // This is useful when we are adding a new lettered Ceph release but the actual branch hasn't been + // created yet. Or even if there is some github infra issue with the ls-remote. stage('Retrieve branch tip SHAs') { - branches.each { b -> + branches = branches.findAll { b -> def sha = sh( script: "git ls-remote ${repoUrl} refs/heads/${b} | awk '{print \$1}'", returnStdout: true ).trim() - if (!sha) { error "Could not resolve remote SHA for branch ${b}" } + + if (!sha) { + echo "Could not resolve remote SHA for branch ${b}." + echo "This is either due to an infra issue or ${b} doesn't exist." + return false + } + tips[b] = sha echo "Branch ${b} -> ${sha}" + return true } }