[Qa-jenkins-scm] [jenkins.debian.net] 05/06: reproducible: html_packages: build pages also for untested packages. Add another icon

Holger Levsen holger at moszumanska.debian.org
Fri Mar 6 19:11:02 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 62a956483e4163bff07a2cba9aa272ff0da2c3c1
Author: Mattia Rizzolo <mattia at mapreri.org>
Date:   Fri Mar 6 18:59:00 2015 +0100

    reproducible: html_packages: build pages also for untested packages. Add another icon
---
 bin/reproducible_common.py                 |   1 +
 bin/reproducible_html_packages.py          |  37 +++++++++++++++++------------
 userContent/static/weather-clear-night.png | Bin 0 -> 961 bytes
 3 files changed, 23 insertions(+), 15 deletions(-)

diff --git a/bin/reproducible_common.py b/bin/reproducible_common.py
index ff5496e..554e95e 100755
--- a/bin/reproducible_common.py
+++ b/bin/reproducible_common.py
@@ -336,6 +336,7 @@ def join_status_icon(status, package=None, version=None):
              '404': 'weather-severe-alert.png',
              'not for us': 'weather-few-clouds-night.png',
              'not_for_us': 'weather-few-clouds-night.png',
+             'untested': 'weather-clear-night.png',
              'blacklisted': 'error.png'}
     if status == 'unreproducible':
             status = 'FTBR'
diff --git a/bin/reproducible_html_packages.py b/bin/reproducible_html_packages.py
index 197e96b..442edee 100755
--- a/bin/reproducible_html_packages.py
+++ b/bin/reproducible_html_packages.py
@@ -19,7 +19,7 @@ html_package_page = Template((tab*2).join(("""
             <a href="/index_$status.html" target="_parent" title="$status">
                 <img src="/static/$icon" alt="$status" />
             </a>
-            <span style="font-size:0.9em;">at $build_time:</span>
+            <span style="font-size:0.9em;">$build_time:</span>
 $links
             <a href="https://tracker.debian.org/$package" target="main">PTS</a>
             <a href="https://bugs.debian.org/src:$package" target="main">BTS</a>
@@ -69,15 +69,25 @@ def check_package_status(package, suite, nocheck=False):
                  'AND s.suite="{suite}"').format(pkg=package, suite=suite)
         result = query_db(query)[0]
     except IndexError:
-        if nocheck:
-            return False
-        print_critical_message('This query produces no results: ' + query +
-                '\nThis means there is no tested package with the name ' +
-                package + '.')
-        raise
+        query = 'SELECT version FROM sources WHERE name="{pkg}" AND suite="{suite}"'
+        query = query.format(pkg=package, suite=suite)
+        try:
+            result = query_db(query)[0][0]
+            if result:
+                result = ('untested', str(result), False)
+        except IndexError:
+            if nocheck:
+                return False
+            print_critical_message('This query produces no results: ' + query +
+                    '\nThis means there is no available package with the name '
+                    + package + '.')
+            raise
     status = str(result[0])
     version = str(result[1])
-    build_date = str(result[2])+" UTC"
+    if result[2]:
+        build_date = 'at ' + str(result[2]) + ' UTC'
+    else:
+        build_date = '<span style="color:red;font-weight:bold;">UNTESTED</span>'
     return (status, version, build_date)
 
 def gen_extra_links(package, version, suite, arch):
@@ -132,7 +142,7 @@ 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 JOIN results AS r ON r.package_id=s.id ' + \
+            'FROM sources AS s ' + \
             'WHERE s.name="{pkg}"'.format(pkg=package)
     results = query_db(query)
     if len(results) < 1:
@@ -215,9 +225,7 @@ def gen_packages_html(packages, suite=None, arch=None, no_clean=False, nocheck=F
         purge_old_pages() # housekeep is always good
 
 def gen_all_rb_pkg_pages(suite='sid', arch='amd64', no_clean=False):
-    query = 'SELECT s.name ' + \
-            'FROM results AS r JOIN sources AS s ON r.package_id=s.id ' + \
-            'WHERE r.status !="" AND s.suite="%s"' % suite
+    query = 'SELECT name FROM sources WHERE suite="%s" AND architecture="%s"' % (suite, arch)
     rows = query_db(query)
     pkgs = [str(i[0]) for i in rows]
     log.info('Processing all the package pages, ' + str(len(pkgs)))
@@ -238,9 +246,8 @@ def purge_old_pages():
             for page in presents:
                 pkg = page.rsplit('.', 1)[0]
                 query = 'SELECT s.name ' + \
-                    'FROM results AS r ' + \
-                    'JOIN sources AS s ON r.package_id=s.id ' + \
-                    'WHERE s.name="{name}" AND r.status != "" ' + \
+                    'FROM sources AS s ' + \
+                    'WHERE s.name="{name}" ' + \
                     'AND s.suite="{suite}" AND s.architecture="{arch}"'
                 query = query.format(name=pkg, suite=suite, arch=arch)
                 result = query_db(query)
diff --git a/userContent/static/weather-clear-night.png b/userContent/static/weather-clear-night.png
new file mode 100644
index 0000000..4345752
Binary files /dev/null and b/userContent/static/weather-clear-night.png differ

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