[Qa-jenkins-scm] [jenkins.debian.net] 01/02: reproducible: html_packages: add a status icon next to the suite link

Holger Levsen holger at moszumanska.debian.org
Sat Mar 7 17:13:30 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 6d05972d4b1a3d50cb4f877ab20c6173902bc418
Author: Mattia Rizzolo <mattia at mapreri.org>
Date:   Sat Mar 7 18:04:54 2015 +0100

    reproducible: html_packages: add a status icon next to the suite link
---
 bin/reproducible_html_packages.py | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/bin/reproducible_html_packages.py b/bin/reproducible_html_packages.py
index 91f7217..9083013 100755
--- a/bin/reproducible_html_packages.py
+++ b/bin/reproducible_html_packages.py
@@ -151,8 +151,8 @@ def gen_extra_links(package, version, suite, arch):
 
 def gen_suites_links(package, suite):
     html = ''
-    query = 'SELECT s.suite, s.architecture ' + \
-            'FROM sources AS s ' + \
+    query = 'SELECT s.suite, s.architecture, r.status ' + \
+            'FROM sources AS s LEFT JOIN results AS r ON r.package_id=s.id ' + \
             'WHERE s.name="{pkg}"'.format(pkg=package)
     results = query_db(query)
     if len(results) < 1:
@@ -161,12 +161,15 @@ def gen_suites_links(package, suite):
     if len(results) == 1:
         return html
     for i in results:
-        # i[0]: suite, i[1]: arch
+        # i[0]: suite, i[1]: arch, i[2]: status (NULL if untested)
         if i[0] == suite:
             continue
+        status = 'untested' if not i[2] else i[2]
+        icon = '<img src="/static/{icon}" alt="{status}" title="{status}"/>\n'
+        html += icon.format(icon=join_status_icon(status)[1], status=status)
         html += '<a href="' + RB_PKG_URI + '/' + i[0] + '/' + i[1] + '/' + \
-                str(package) + '.html" target="_parent">' + i[0] + '</a>\n'
-    return html
+                str(package) + '.html" target="_parent">' + i[0] + '</a>'
+    return tab*5 + (tab*7).join(html.splitlines(True))
 
 
 def gen_packages_html(packages, suite=None, arch=None, no_clean=False, nocheck=False):

-- 
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