Merge lp:~cyphermox/ubuntu-archive-tools/component-mismatches-mir into lp:ubuntu-archive-tools

Proposed by Mathieu Trudel-Lapierre
Status: Merged
Approved by: Łukasz Zemczak
Approved revision: 1162
Merged at revision: 1160
Proposed branch: lp:~cyphermox/ubuntu-archive-tools/component-mismatches-mir
Merge into: lp:ubuntu-archive-tools
Diff against target: 62 lines (+13/-7)
1 file modified
component-mismatches (+13/-7)
To merge this branch: bzr merge lp:~cyphermox/ubuntu-archive-tools/component-mismatches-mir
Reviewer Review Type Date Requested Status
Łukasz Zemczak code review Approve
Review via email: mp+340939@code.launchpad.net

Description of the change

Add assignee if a MIR bug is currently open and not yet approved (Fix Committed or Fix Released). This helps quickly parsing the component mismatches for the rough status of a MIR bug, if it's yet to be looked at or already been reviewed by a MIR team member and waiting for a security code-review.

To post a comment you must log in.
1161. By Mathieu Trudel-Lapierre

Make sure assignee is also unpacked for all code locations unpacking mir_bugs

Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Looks good, there's one small nitpick but I guess we could just ignore it. In line 810 there's a comment regarding get_mir_bugs():

 Return a map source -> [(id, status, title), ...]

So it would be nice if the assignee was added there for consistency. But as I said, this is a nitpick and otherwise it's all good code-wise.

review: Approve (code review)
1162. By Mathieu Trudel-Lapierre

Update comment for get_mir_bugs()

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'component-mismatches'
2--- component-mismatches 2017-03-18 07:19:41 +0000
3+++ component-mismatches 2018-03-07 14:23:54 +0000
4@@ -70,13 +70,18 @@
5
6
7 class MIRLink:
8- def __init__(self, id, status, title):
9+ def __init__(self, id, status, title, assignee):
10 self.id = id
11 self.status = status
12 self.title = title
13+ self.assignee = assignee
14
15 def __str__(self):
16- s = "MIR: #%d (%s)" % (self.id, self.status)
17+ if self.status not in ('Fix Committed', 'Fix Released') and assignee:
18+ s = "MIR: #%d (%s for %s)" % (self.id, self.status,
19+ self.assignee.display_name)
20+ else:
21+ s = "MIR: #%d (%s)" % (self.id, self.status)
22 # no need to repeat the standard title
23 if not self.title.startswith("[MIR]"):
24 s += " %s" % self.title
25@@ -377,7 +382,7 @@
26
27 mirs = mir_bugs.get(name, [])
28 approved_mirs = [
29- id for id, status, title in mirs
30+ id for id, status, title, assignee in mirs
31 if status in ('Fix Committed', 'Fix Released')]
32
33 url = None
34@@ -639,8 +644,8 @@
35 binaries = sorted(both[source])
36 entry = [[source] + binaries]
37
38- for (id, status, title) in mir_bugs.get(source, []):
39- entry.append(MIRLink(id, status, title))
40+ for (id, status, title, assignee) in mir_bugs.get(source, []):
41+ entry.append(MIRLink(id, status, title, assignee))
42
43 entry.extend(do_reverse(options, source, binaries, both))
44 output.append(entry)
45@@ -802,7 +807,7 @@
46 def get_mir_bugs(options, sources):
47 '''Return MIR bug information for a set of source packages.
48
49- Return a map source -> [(id, status, title), ...]
50+ Return a map source -> [(id, status, title, assignee), ...]
51 '''
52 result = defaultdict(list)
53 mir_team = options.launchpad.people['ubuntu-mir']
54@@ -812,7 +817,8 @@
55 tasks = options.distro.getSourcePackage(name=source).searchTasks(
56 bug_subscriber=mir_team, status=bug_statuses)
57 for task in tasks:
58- result[source].append((task.bug.id, task.status, task.bug.title))
59+ result[source].append((task.bug.id, task.status, task.bug.title,
60+ task.assignee))
61
62 return result
63

Subscribers

People subscribed via source and target branches