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
=== modified file 'sru-report'
--- sru-report 2012-07-20 13:10:40 +0000
+++ sru-report 2012-07-24 22:56:17 +0000
@@ -62,6 +62,7 @@
62ubuntu = None62ubuntu = None
63archive = None63archive = None
64releases = {} # name -> distro_series64releases = {} # name -> distro_series
65broken_bugs = set()
6566
6667
67def current_versions(distro_series, sourcename):68def current_versions(distro_series, sourcename):
@@ -134,6 +135,7 @@
134 a.verificationpartial { color: #660099; font-weight: bold; }135 a.verificationpartial { color: #660099; font-weight: bold; }
135 a.kerneltracking { font-style: italic; }136 a.kerneltracking { font-style: italic; }
136 a.testing { color: blue; }137 a.testing { color: blue; }
138 a.broken { text-decoration: line-through; color: black; }
137 </style>139 </style>
138</head>140</head>
139<body>141<body>
@@ -163,7 +165,9 @@
163bugs in <span style="color: #999900;">golden</span> have received a comment165bugs in <span style="color: #999900;">golden</span> have received a comment
164since the package was accepted in -proposed,166since the package was accepted in -proposed,
165bugs in <span style="font-style: italic">italic</span> are kernel tracking167bugs in <span style="font-style: italic">italic</span> are kernel tracking
166bugs.</p>''')168bugs and bugs that are
169<span style="text-decoration: line-through;">striked</span> weren't accessible
170at the time the report was generated.</p>''')
167171
168 #172 #
169 # pending SRUs173 # pending SRUs
@@ -226,14 +230,22 @@
226 elif ('verification-done' in t or230 elif ('verification-done' in t or
227 'verification-done-%s' % release in t):231 'verification-done-%s' % release in t):
228 cls += ' verified'232 cls += ' verified'
233 elif str(b) in broken_bugs:
234 cls += ' broken'
229 else:235 else:
230 bug = lp.bugs[b]236 try:
231 message_date = bug.date_last_message.replace(237 bug = lp.bugs[b]
232 minute=0, second=0, microsecond=0)238 message_date = bug.date_last_message.replace(
233 published_date = rpkg['published'].replace(239 minute=0, second=0, microsecond=0)
234 minute=0, second=0, microsecond=0)240 published_date = rpkg['published'].replace(
235 if message_date > published_date:241 minute=0, second=0, microsecond=0)
236 cls += ' messages'242 if message_date > published_date:
243 cls += ' messages'
244 except KeyError:
245 logging.debug(
246 'bug %s does not exist or is not accessible' % (
247 str(b)))
248 broken_bugs.add(str(b))
237 cls += '"'249 cls += '"'
238250
239 print('<a href="https://bugs.launchpad.net/bugs/%s" %s>'251 print('<a href="https://bugs.launchpad.net/bugs/%s" %s>'
@@ -399,10 +411,11 @@
399 try:411 try:
400 bug = lp.bugs[int(b)]412 bug = lp.bugs[int(b)]
401 bugs[b] = bug.tags413 bugs[b] = bug.tags
402 except:414 except KeyError:
403 logging.debug(415 logging.debug(
404 '%s: bug %s does not exist or is not accessible' %416 '%s: bug %s does not exist or is not accessible' %
405 (changesfileurl, str(b)))417 (changesfileurl, str(b)))
418 broken_bugs.add(str(b))
406 bugs[b] = []419 bugs[b] = []
407420
408 logging.debug("%d bugs found: %s" % (len(bugs), " ".join(bugs)))421 logging.debug("%d bugs found: %s" % (len(bugs), " ".join(bugs)))
@@ -485,6 +498,9 @@
485 try:498 try:
486 lpbug = lp.bugs[int(b)]499 lpbug = lp.bugs[int(b)]
487 except KeyError:500 except KeyError:
501 logging.debug('%s: bug %s does not exist or is not accessible' % (
502 change_url, str(b)))
503 broken_bugs.add(str(b))
488 continue504 continue
489 if lpbug.title.startswith('CVE-'):505 if lpbug.title.startswith('CVE-'):
490 cves.add(b)506 cves.add(b)

Subscribers

People subscribed via source and target branches