[Qa-jenkins-scm] [jenkins.debian.net] 01/01: reproducible: dont hardcode the number of build jobs, instead check the actual number on the fs

Holger Levsen holger at moszumanska.debian.org
Wed Dec 9 11:57:01 UTC 2015


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch master
in repository jenkins.debian.net.

commit 0f592ece90a3862d8c16bc64146768e326b3ce4d
Author: Holger Levsen <holger at layer-acht.org>
Date:   Wed Dec 9 12:56:50 2015 +0100

    reproducible: dont hardcode the number of build jobs, instead check the actual number on the fs
---
 bin/reproducible_html_live_status.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/bin/reproducible_html_live_status.py b/bin/reproducible_html_live_status.py
index 2f044c6..00eb8e2 100755
--- a/bin/reproducible_html_live_status.py
+++ b/bin/reproducible_html_live_status.py
@@ -10,7 +10,7 @@
 
 from reproducible_common import *
 from reproducible_html_indexes import build_leading_text_section
-
+import glob
 
 def generate_schedule(arch):
     """ the schedule pages are very different than others index pages """
@@ -64,11 +64,14 @@ def generate_live_status_table(arch):
     html += '<th>previous build duration</th><th>average build duration</th><th>builder job</th>'
     html += '</tr>\n'
     counter = 0
+    # the path should probably not be hard coded here…
+    builders = len(glob.glob('/var/lib/jenkins/jobs/reproducible_builder_' + arch + '_*'))
     for row in rows:
         counter += 1
-        # FIXME: the numbers 32 and 15 should really be derived from /var/lib/jenkins/jobs/reproducible_builder_${arch}_* instead of being hard-coded here...
-        if ( arch == 'amd64' and counter > 32 ) or ( arch == 'armhf' and counter > 15 ):
-             html += '<tr><td colspan="10">There are more builds marked as currently building in the database than there are ' + arch + ' build jobs. This does not compute, please investigate and fix the cause.</td></tr>'
+        if counter > builders:
+             html += '<tr><td colspan="10">There are more builds marked as currently building in the database (' + counter + ') than there are ' + arch + ' build jobs (' + builders + '). This does not compute, please investigate and fix the cause.</td></tr>'
+        elif builders == 0:
+             html += '<tr><td colspan="10">0 build jobs for ' + arch + ' detected. This does not compute, please investigate and fix the cause.</td></tr>'
         suite = row[1]
         arch = row[2]
         pkg = row[3]

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list