]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-dev-cron: ls-remote failure is not fatal 2552/head
authorDavid Galloway <david.galloway@ibm.com>
Fri, 13 Mar 2026 17:16:04 +0000 (13:16 -0400)
committerDavid Galloway <david.galloway@ibm.com>
Fri, 13 Mar 2026 18:02:03 +0000 (14:02 -0400)
Signed-off-by: David Galloway <david.galloway@ibm.com>
ceph-dev-cron/build/Jenkinsfile

index 4ab6768e8518b090ebae6cda159d48de612c87f9..9d52e2e660aed037106d464582e1fe3990c82bf2 100644 (file)
@@ -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
       }
     }