From 09391a8b9b270829df1bf142d40b036eb22a1cbb Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Fri, 7 Aug 2015 16:00:53 +0000 Subject: reproducible: also find pending bugs and mark them with a brown P in the pages --- bin/reproducible_common.py | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'bin/reproducible_common.py') diff --git a/bin/reproducible_common.py b/bin/reproducible_common.py index d6a820d7..0ed8011c 100755 --- a/bin/reproducible_common.py +++ b/bin/reproducible_common.py @@ -200,7 +200,8 @@ html_foot_page_style_note = Template((tab*2).join(""" A # sign after the name of a package indicates that a bug is filed against it. Likewise, a + sign indicates there is - a patch available. # + a patch available, a P means a + pending bug while # indicates a closed bug. In cases of several bugs, the symbol is repeated.

""".splitlines(True))) @@ -476,12 +477,13 @@ def get_bugs(): } """ query = """ - SELECT DISTINCT bugs.id, bugs.source, bugs.done, tags.tag + SELECT bugs.id, bugs.source, bugs.done, ARRAY_AGG(tags.tag) FROM bugs JOIN bugs_tags ON bugs.id = bugs_tags.id JOIN bugs_usertags ON bugs_tags.id = bugs_usertags.id JOIN sources ON bugs.source=sources.source LEFT JOIN ( - SELECT id, tag FROM bugs_tags WHERE tag='patch' + SELECT id, tag FROM bugs_tags + WHERE tag='patch' OR tag='pending' ) AS tags ON bugs.id = tags.id WHERE bugs_usertags.email = 'reproducible-builds@lists.alioth.debian.org' AND bugs.id NOT IN ( @@ -492,6 +494,7 @@ def get_bugs(): bugs_usertags.tag = 'toolchain' OR bugs_usertags.tag = 'infrastructure') ) + GROUP BY bugs.id, bugs.source, bugs.done """ # returns a list of tuples [(id, source, done)] global conn_udd @@ -508,14 +511,20 @@ def get_bugs(): if bug[1] not in packages: packages[bug[1]] = {} # bug[0] = bug_id, bug[1] = source_name, bug[2] = who_when_done, - # bug[3] = tag (patch) - packages[bug[1]][bug[0]] = {'done': False, 'patch': False} + # bug[3] = tag (patch or pending) + packages[bug[1]][bug[0]] = { + 'done': False, 'patch': False, 'pending': False + } if bug[2]: # if the bug is done packages[bug[1]][bug[0]]['done'] = True - if bug[3]: # the bug is patched + if 'patch' in bug[3]: # the bug is patched packages[bug[1]][bug[0]]['patch'] = True + if 'pending' in bug[3]: # the bug is pending + packages[bug[1]][bug[0]]['pending'] = True + log.debug(packages) return packages + def get_trailing_icon(package, bugs): html = '' if package in bugs: @@ -523,6 +532,8 @@ def get_trailing_icon(package, bugs): html += '#' + elif bugs[package][bug]['pending']: + html += 'bug-pending" title="#' + str(bug) + ', pending">P' elif bugs[package][bug]['patch']: html += 'bug-patch" title="#' + str(bug) + ', with patch">+' else: @@ -542,6 +553,8 @@ def get_trailing_bug_icon(bug, bugs, package=None): html += '#' + elif bugs[package][bug]['pending']: + html += 'bug-pending" title="#' + str(bug) + ', pending">P' elif bugs[package][bug]['patch']: html += 'bug-patch" title="#' + str(bug) + ', with patch">+' else: @@ -551,6 +564,7 @@ def get_trailing_bug_icon(bug, bugs, package=None): pass return html + def irc_msg(msg): kgb = ['kgb-client', '--conf', '/srv/jenkins/kgb/debian-reproducible.conf', '--relay-msg'] -- cgit v1.2.3-54-g00ecf