Dear Joerg, On Sun, Sep 26, 2010 at 12:40:13PM +0200, Joerg Jaspert wrote: > > In <87aan8rzo0.fsf@gkar.ganneff.de>, you had said that you wanted to > > "highlight packages in NEW fixing rc bugs". I thought I could take a > > stab at that. > > Great, thanks. > > > The code is "tested" only as individual functions; I don't know how to > > test out the dak code myself (could you point me to the right place, > > please?). > > > Please let me know if this helps. > > Well, you need a dak instance to really test stuff, and in case of > queue-report also access to the queues. > Should you dive more into coding for dak we can arrange something, but for a > one-off contribution its a bit much work... :) No problems; since this is a change which wouldn't break much, I'll test parts of the code, and let you test it live; I think that should work. > At another place we already use python-debianbts. (rm and > bts-categorize). Unless there is a good reason against it I would want > to keep the number of additional libraries small, so could you look if > you can use that too? Sure. This has simplified the code a bit. > Besides this it does look good, except: Whats it doing when the BTS is > unreachable? We dont like exceptions in that case and should probably > just continue (and dont have rc foo hilighted). I have now caught the exception, but do nothing; the function returns "False" if the BTS is unreachable; it could return None, but this just simplifies the logic elsewhere a little. > Also, you do this in the html output only. How about fetching this data > earlier in the data gathering state, so its just an entry in the entries > dict and we could also output it on the normal report (like, having an > extra flag for the text report). I have done this now, but, again, haven't tested the code. It should just be a matter of a couple of ValueErrors or so, which you need to handle, though I _think_ it should work with no changes. I have attached a new patch. Please let me know if this is closer to what you would expect. Thanks! Kumar -- Anyone who thinks UNIX is intuitive should be forced to write 5000 lines of code using nothing but vi or emacs. AAAAACK! -- Discussion on the intuitiveness of commands, especially Emacs
From 07b32662da657399c5c4e21770df2dbebab25c13 Mon Sep 17 00:00:00 2001 From: Kumar Appaiah <a.kumar@alumni.iitm.ac.in> Date: Sat, 25 Sep 2010 17:04:10 -0500 Subject: [PATCH] Add functions to colourize RC bug fixing packages differently This commit adds some functions to query the BTS Soap interface to determine if the package closes an RC bug or not. If it does close an RC bug, it allows for differently colourizing the package line. It adds a variable to indicate if a package fixes an RC bug or not, and already allows for colourization of the HTML output; the new entry can be used to colourize in other output formats as well. Signed-off-by: Kumar Appaiah <a.kumar@alumni.iitm.ac.in> --- dak/queue_report.py | 40 ++++++++++++++++++++++++++++++++++------ 1 files changed, 34 insertions(+), 6 deletions(-) diff --git a/dak/queue_report.py b/dak/queue_report.py index e2d8578..9c34989 100755 --- a/dak/queue_report.py +++ b/dak/queue_report.py @@ -43,6 +43,7 @@ from daklib.queue import Upload from daklib.dbconn import DBConn, has_new_comment, DBChange, DBSource, get_uid_from_fingerprint from daklib.textutils import fix_maintainer from daklib.dak_exceptions import * +import debianbts Cnf = None direction = [] @@ -264,7 +265,30 @@ def table_footer(type): print "</tbody></table>" -def table_row(source, version, arch, last_mod, maint, distribution, closes, fingerprint, sponsor, changedby): +def find_bug_severities(bugnrs): + """Take a list of bug numbers and + return a dictionary with bug number - severity pairs.""" + statuses = None + try: statuses = debianbts.get_status(bugnrs) + except Exception: + return None + severities = {} + for bug_status in statuses: + severities[bug_status.bug_num] = bug_status.severity + return severities + +def rcbug_close_check(closes): + """Take a list of bug numbers and determine if at least one of them + is release critical.""" + severity_list = find_bug_severities(closes) + if severity_list: + severities = severity_list.values() + return ('critical' in severities) or \ + ('serious' in severities) or \ + ('grave' in severities) + return False + +def table_row(source, version, arch, last_mod, maint, distribution, closes, fingerprint, sponsor, changedby, fixes_rcbug): global row_number @@ -274,6 +298,9 @@ def table_row(source, version, arch, last_mod, maint, distribution, closes, fing if dist == "experimental": trclass = "exp" + if fixes_rcbug: + trclass = "rcfix" + if not len(session.query(DBSource).filter_by(source = source).all()): trclass += " binNEW" session.commit() @@ -443,7 +470,8 @@ def process_changes_files(changes_files, type, log): note = " | [N]" else: note = "" - entries.append([source, binary, version_list, arch_list, note, last_modified, maint, distribution, closes, fingerprint, sponsor, changedby, filename]) + fixes_rcbug = rcbug_close_check(closes) + entries.append([source, binary, version_list, arch_list, note, last_modified, maint, distribution, closes, fingerprint, sponsor, changedby, filename, fixes_rcbug]) # direction entry consists of "Which field, which direction, time-consider" where # time-consider says how we should treat last_modified. Thats all. @@ -485,7 +513,7 @@ def process_changes_files(changes_files, type, log): if Cnf.has_key("Queue-Report::Options::822"): # print stuff out in 822 format for entry in entries: - (source, binary, version_list, arch_list, note, last_modified, maint, distribution, closes, fingerprint, sponsor, changedby, changes_file) = entry + (source, binary, version_list, arch_list, note, last_modified, maint, distribution, closes, fingerprint, sponsor, changedby, changes_file, fixes_rcbug) = entry # We'll always have Source, Version, Arch, Mantainer, and Dist # For the rest, check to see if we have them, then print them out @@ -528,8 +556,8 @@ def process_changes_files(changes_files, type, log): source_count = len(per_source_items) table_header(type.upper(), source_count, total_count) for entry in entries: - (source, binary, version_list, arch_list, note, last_modified, maint, distribution, closes, fingerprint, sponsor, changedby, undef) = entry - table_row(source, version_list, arch_list, time_pp(last_modified), maint, distribution, closes, fingerprint, sponsor, changedby) + (source, binary, version_list, arch_list, note, last_modified, maint, distribution, closes, fingerprint, sponsor, changedby, undef, fixes_rcbug) = entry + table_row(source, version_list, arch_list, time_pp(last_modified), maint, distribution, closes, fingerprint, sponsor, changedby, entries, fixes_rcbug) table_footer(type.upper()) elif not Cnf.has_key("Queue-Report::Options::822"): # The "normal" output without any formatting. @@ -537,7 +565,7 @@ def process_changes_files(changes_files, type, log): msg = "" for entry in entries: - (source, binary, version_list, arch_list, note, last_modified, undef, undef, undef, undef, undef, undef, undef) = entry + (source, binary, version_list, arch_list, note, last_modified, undef, undef, undef, undef, undef, undef, undef, fixes_rcbug) = entry msg += format % (source, version_list, arch_list, note, time_pp(last_modified)) if msg: -- 1.7.1
Attachment:
signature.asc
Description: Digital signature