[Qa-jenkins-scm] [jenkins.debian.net] 01/01: reproducible: also find pending bugs and mark them with a brown P in the pages

Holger Levsen holger at moszumanska.debian.org
Fri Aug 7 18:02:56 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 09391a8b9b270829df1bf142d40b036eb22a1cbb
Author: Mattia Rizzolo <mattia at mapreri.org>
Date:   Fri Aug 7 16:00:53 2015 +0000

    reproducible: also find pending bugs and mark them with a brown P in the pages
---
 TODO                                      |  1 -
 bin/reproducible_common.py                | 26 ++++++++++++++++++++------
 bin/reproducible_common.sh                |  2 +-
 userContent/reproducible/static/style.css | 11 +++++++++++
 4 files changed, 32 insertions(+), 8 deletions(-)

diff --git a/TODO b/TODO
index 4d9a2a1..95a1be1 100644
--- a/TODO
+++ b/TODO
@@ -193,7 +193,6 @@ properties:
 ** replace submit form by one without javascript (maybe with more url rewriting)
 ** when a package is automatically rescheduled because of the mirror was updated between the two tests, there will be three rbuild logs in one. thats confusing, the first one should be dropped.
 ** adopt usertag script from pkg-apparmor to notify us about new usertagged bugs automatically
-** create a symbol for pending bugs or use a different color to indicate them
 
 * notes related
 ** #786396: classify issue by "toolchain" or "package" fix needed: show bugs which block a bug
diff --git a/bin/reproducible_common.py b/bin/reproducible_common.py
index d6a820d..0ed8011 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 <code><span class="bug">#</span></code> sign after the name of a
   package indicates that a bug is filed against it. Likewise, a
   <code><span class="bug-patch">+</span></code> sign indicates there is
-  a patch available. <code><span class="bug-done">#</span></code>
+  a patch available, a <code><span class="bug-pending">P</span></code> means a
+  pending bug while <code><span class="bug-done">#</span></code>
   indicates a closed bug. In cases of several bugs, the symbol is repeated.
 </p>""".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 at 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 += '<span class="'
             if bugs[package][bug]['done']:
                 html += 'bug-done" title="#' + str(bug) + ', done">#</span>'
+            elif bugs[package][bug]['pending']:
+                html += 'bug-pending" title="#' + str(bug) + ', pending">P</span>'
             elif bugs[package][bug]['patch']:
                 html += 'bug-patch" title="#' + str(bug) + ', with patch">+</span>'
             else:
@@ -542,6 +553,8 @@ def get_trailing_bug_icon(bug, bugs, package=None):
                 html += '<span class="'
                 if bugs[package][bug]['done']:
                     html += 'bug-done" title="#' + str(bug) + ', done">#'
+                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']
diff --git a/bin/reproducible_common.sh b/bin/reproducible_common.sh
index 107c55e..15a8c37 100755
--- a/bin/reproducible_common.sh
+++ b/bin/reproducible_common.sh
@@ -262,7 +262,7 @@ write_page_footer() {
 
 write_page_meta_sign() {
 	write_page "<p style=\"font-size:0.9em;\">A package name displayed with a bold font is an indication that this package has a note. Visited packages are linked in green, those which have not been visited are linked in blue.</br>"
-	write_page "A <code><span class=\"bug\">#</span></code> sign after the name of a package indicates that a bug is filed against it. Likewise, a <code><span class=\"bug-patch\">+</span></code> sign indicates there is a patch available. <code><span class=\"bug-done\">#</span></code> indicates a closed bug. In cases of several bugs, the symbol is repeated.</p>"
+	write_page "A <code><span class=\"bug\">#</span></code> sign after the name of a package indicates that a bug is filed against it. Likewise, a <code><span class=\"bug-patch\">+</span></code> sign indicates there is a patch available, a <code><span class="bug-pending">P</span></code> means a pending bug while <code><span class=\"bug-done\">#</span></code> indicates a closed bug. In cases of several bugs, the symbol is repeated.</p>"
 }
 
 write_explaination_table() {
diff --git a/userContent/reproducible/static/style.css b/userContent/reproducible/static/style.css
index 5c6af26..92efd7a 100644
--- a/userContent/reproducible/static/style.css
+++ b/userContent/reproducible/static/style.css
@@ -179,6 +179,12 @@ a.bug-patch:after {
 	font-weight: bold;
 }
 
+a.bug-pending:after {
+	content: "P";
+	color: #663300;
+	font-weight: bold;
+}
+
 a.bug-done {
 	text-decoration: line-through;
 	color: #73d216;
@@ -195,6 +201,11 @@ span.bug-patch {
 	font-weight: bold;
 }
 
+span.bug-pending {
+	color: #663300;
+	font-weight: bold;
+}
+
 span.bug-done {
 	text-decoration: line-through;
 	color: #73d216;

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