Merge lp:~stgraber/ubuntu-archive-tools/detect-broken-bugs into lp:ubuntu-archive-tools

Proposed by Stéphane Graber
Status: Merged
Merged at revision: 550
Proposed branch: lp:~stgraber/ubuntu-archive-tools/detect-broken-bugs
Merge into: lp:ubuntu-archive-tools
Diff against target: 83 lines (+25/-9)
1 file modified
sru-report (+25/-9)
To merge this branch: bzr merge lp:~stgraber/ubuntu-archive-tools/detect-broken-bugs
Reviewer Review Type Date Requested Status
Ubuntu Package Archive Administrators Pending
Review via email: mp+116564@code.launchpad.net

Description of the change

Detect inaccessible bugs, add them to a set and if the bug is in that set, then
have it show striked in the report (black foreground color).

This also makes the lp.bugs try/except more consistent, including debug
logging.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'sru-report'
2--- sru-report 2012-07-20 13:10:40 +0000
3+++ sru-report 2012-07-24 22:56:17 +0000
4@@ -62,6 +62,7 @@
5 ubuntu = None
6 archive = None
7 releases = {} # name -> distro_series
8+broken_bugs = set()
9
10
11 def current_versions(distro_series, sourcename):
12@@ -134,6 +135,7 @@
13 a.verificationpartial { color: #660099; font-weight: bold; }
14 a.kerneltracking { font-style: italic; }
15 a.testing { color: blue; }
16+ a.broken { text-decoration: line-through; color: black; }
17 </style>
18 </head>
19 <body>
20@@ -163,7 +165,9 @@
21 bugs in <span style="color: #999900;">golden</span> have received a comment
22 since the package was accepted in -proposed,
23 bugs in <span style="font-style: italic">italic</span> are kernel tracking
24-bugs.</p>''')
25+bugs and bugs that are
26+<span style="text-decoration: line-through;">striked</span> weren't accessible
27+at the time the report was generated.</p>''')
28
29 #
30 # pending SRUs
31@@ -226,14 +230,22 @@
32 elif ('verification-done' in t or
33 'verification-done-%s' % release in t):
34 cls += ' verified'
35+ elif str(b) in broken_bugs:
36+ cls += ' broken'
37 else:
38- bug = lp.bugs[b]
39- message_date = bug.date_last_message.replace(
40- minute=0, second=0, microsecond=0)
41- published_date = rpkg['published'].replace(
42- minute=0, second=0, microsecond=0)
43- if message_date > published_date:
44- cls += ' messages'
45+ try:
46+ bug = lp.bugs[b]
47+ message_date = bug.date_last_message.replace(
48+ minute=0, second=0, microsecond=0)
49+ published_date = rpkg['published'].replace(
50+ minute=0, second=0, microsecond=0)
51+ if message_date > published_date:
52+ cls += ' messages'
53+ except KeyError:
54+ logging.debug(
55+ 'bug %s does not exist or is not accessible' % (
56+ str(b)))
57+ broken_bugs.add(str(b))
58 cls += '"'
59
60 print('<a href="https://bugs.launchpad.net/bugs/%s" %s>'
61@@ -399,10 +411,11 @@
62 try:
63 bug = lp.bugs[int(b)]
64 bugs[b] = bug.tags
65- except:
66+ except KeyError:
67 logging.debug(
68 '%s: bug %s does not exist or is not accessible' %
69 (changesfileurl, str(b)))
70+ broken_bugs.add(str(b))
71 bugs[b] = []
72
73 logging.debug("%d bugs found: %s" % (len(bugs), " ".join(bugs)))
74@@ -485,6 +498,9 @@
75 try:
76 lpbug = lp.bugs[int(b)]
77 except KeyError:
78+ logging.debug('%s: bug %s does not exist or is not accessible' % (
79+ change_url, str(b)))
80+ broken_bugs.add(str(b))
81 continue
82 if lpbug.title.startswith('CVE-'):
83 cves.add(b)

Subscribers

People subscribed via source and target branches