[Qa-jenkins-scm] [jenkins.debian.net] 03/05: reproducible: notes: add a +/# sign after bug numbers, if they are close/with-patch

Holger Levsen holger at moszumanska.debian.org
Sat Mar 7 09:50:03 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 97ab048fb68fbc3aec66cc83947692a390e62e35
Author: Mattia Rizzolo <mattia at mapreri.org>
Date:   Fri Mar 6 23:02:50 2015 +0100

    reproducible: notes: add a +/# sign after bug numbers, if they are close/with-patch
---
 bin/reproducible_common.py     | 19 +++++++++++++++++++
 bin/reproducible_html_notes.py |  7 ++++---
 2 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/bin/reproducible_common.py b/bin/reproducible_common.py
index 554e95e..7dc0e21 100755
--- a/bin/reproducible_common.py
+++ b/bin/reproducible_common.py
@@ -446,6 +446,25 @@ def get_trailing_icon(package, bugs):
     return html
 
 
+def get_trailing_bug_icon(bug, bugs, package=None):
+    html = ''
+    if not package:
+        for pkg in bugs.keys():
+            if get_trailing_bug_icon(bug, bugs, pkg):
+                return get_trailing_bug_icon(bug, bugs, pkg)
+    else:
+        try:
+            if bug in bugs[package].keys():
+                html += '<span class="'
+                if bugs[package][bug]['done']:
+                    html += 'bug-done" title="#' + str(bug) + ', done">#'
+                elif bugs[package][bug]['patch']:
+                    html += 'bug-patch" title="#' + str(bug) + ', with patch">+'
+                html += '</span>'
+        except KeyError:
+            pass
+    return html
+
 # init the databases connections
 conn_db = start_db_connection() # the local sqlite3 reproducible db
 conn_udd = start_udd_connection()
diff --git a/bin/reproducible_html_notes.py b/bin/reproducible_html_notes.py
index 3fec2dd..993d784 100755
--- a/bin/reproducible_html_notes.py
+++ b/bin/reproducible_html_notes.py
@@ -188,7 +188,7 @@ def fill_issue_in_note(issue):
     return note_issue_html.substitute(issue=issue, issue_info=html)
 
 
-def gen_html_note(note):
+def gen_html_note(package, note):
     """
     Given a note as input (as a dict:
     {"package_name": {"version": "0.0.0", "comments": "blablabla",
@@ -211,7 +211,8 @@ def gen_html_note(note):
         bugurls = ''
         for bug in note['bugs']:
             bugurls += '<a href="https://bugs.debian.org/' + str(bug) + \
-                       '" target="_parent">' + str(bug) + '</a><br />'
+                       '" target="_parent">' + str(bug) + '</a>' + \
+                       get_trailing_bug_icon(bug, bugs, package) + '<br />'
         infos += note_bugs_html.substitute(bugs=bugurls)
     # check for comments:
     if 'comments' in note:
@@ -292,7 +293,7 @@ def iterate_over_notes(notes):
         note = notes[package]
         note['package'] = package
         log.debug('\t' + str(note))
-        html = gen_html_note(note)
+        html = gen_html_note(package, note)
 
         title = 'Notes for ' + package + ' - reproducible builds result'
         destfile = NOTES_PATH + '/' + package + '_note.html'

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