Merge lp:~dholbach/ubuntu-review-overview/simplify into lp:ubuntu-review-overview

Proposed by Daniel Holbach
Status: Merged
Merged at revision: 21
Proposed branch: lp:~dholbach/ubuntu-review-overview/simplify
Merge into: lp:ubuntu-review-overview
Diff against target: 145 lines (+33/-56)
3 files modified
clean-sweep.py (+11/-28)
data.py (+8/-4)
patch-overview.py (+14/-24)
To merge this branch: bzr merge lp:~dholbach/ubuntu-review-overview/simplify
Reviewer Review Type Date Requested Status
Nigel Babu Pending
Review via email: mp+26505@code.launchpad.net

This proposal supersedes a proposal from 2010-06-01.

To post a comment you must log in.
Revision history for this message
Nigel Babu (nigelbabu) wrote : Posted in a previous version of this proposal

Awesome, merging it in!

review: Approve
21. By Nigel Babu

Another set of changing from the amazing dholbach

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'clean-sweep.py'
2--- clean-sweep.py 2010-05-29 15:15:47 +0000
3+++ clean-sweep.py 2010-06-01 15:13:26 +0000
4@@ -26,43 +26,26 @@
5 ubuntu = launchpad.distributions['ubuntu']
6
7 # excluding needs-packaging since that has a separate process - revu
8-tasks = ubuntu.searchTasks(order_by='-date_last_updated',tags='-needs-packaging',has_patch=True)
9+tasks = ubuntu.searchTasks(order_by='-date_last_updated',
10+ tags=data.negate_all_tags(['needs-packaging']+data.reviewed_tags),
11+ tags_combinator='All', has_patch=True)
12
13 reviewers = launchpad.people['ubuntu-reviewers']
14 jfo = launchpad.people['jeremyfoshee']
15
16 for task in tasks:
17 bug = launchpad.bugs[task.bug.id]
18- # these bugs have been reviewed and require something
19- if set(data.reviewed_tags).intersection(bug.tags):
20- continue
21- subscribers = []
22- for subscriber in bug.subscriptions:
23- try:
24- subscribers.append(subscriber.person.name)
25- except lazr.restfulclient.errors.HTTPError, e:
26- if e.response.status == 410:
27- pass
28- else:
29- raise
30- # don't act on sync requests with the archive admin team subscribed
31- if 'sync' in bug.title.lower() and 'ubuntu-archive' in subscribers:
32- continue
33+ subscription_people = [a.person for a in bug.subscriptions]
34+ subscribers = [a.name for a in filter(lambda a: a.is_valid, subscription_people)]
35+
36 # don't act on bugs that already have a sponsor's team subscribed
37 if set(data.workflow_teams).intersection(subscribers):
38 continue
39 try:
40- for attachment in bug.attachments:
41- if attachment.type == 'Patch':
42- # depending on the queue's throughput we'll want to start adding historical bugs too
43- print "LP: #%s had patch %s added to it" % ( bug.id, attachment.title )
44- # subscribe the team and add the tag patch to the bug report
45- # the kernel's workflow is special just subscribe jfo
46- if task.bug_target_name in data.skip_packages:
47- bug.subscribe(person=jfo)
48- # skip this package altogether
49- elif task.bug_target_name in ['ubuntu-docs (Ubuntu)', 'xserver-xorg-video-openchrome (Ubuntu)'] :
50- continue
51- bug.subscribe(person=reviewers)
52+ if task.bug_target_name in data.kernel_packages:
53+ bug.subscribe(person=jfo)
54+ elif data.skip_packages:
55+ continue
56+ bug.subscribe(person=reviewers)
57 except lazr.restfulclient.errors.HTTPError, e:
58 print "Launchpad hates me and LP: #%s %s" % (bug.id,e.response.status)
59
60=== modified file 'data.py'
61--- data.py 2010-05-26 12:13:38 +0000
62+++ data.py 2010-06-01 15:13:26 +0000
63@@ -1,15 +1,16 @@
64 # teams that process bugs with patches
65 workflow_teams = [ 'ubuntu-universe-sponsors', 'ubuntu-main-sponsors', 'ubuntu-sru', \
66 'ubuntu-mir', 'ubuntu-release', 'ubuntu-reviewers', 'motu-sru', \
67- 'ubuntu-security-sponsors', 'ubuntu-sponsors' ]
68+ 'ubuntu-security-sponsors', 'ubuntu-sponsors', 'ubuntu-archive' ]
69 # tags that indicate a review has happened
70 reviewed_tags = [ 'patch-needswork', 'patch-forwarded-upstream', 'patch-forwarded-debian', \
71 'indicator-application', 'patch-accepted-upstream', 'patch-accepted-debian', \
72 'patch-rejected-upstream', 'patch-rejected-debian', 'patch-rejected']
73 # kernel packages are special and subject to change
74-skip_packages = ['linux (Ubuntu)', 'linux-fsl-imx51 (Ubuntu)', 'ubuntu-imx (Ubuntu)', \
75- 'linux-backports-modules-2.6.32 (Ubuntu)', 'linux-ti-omap (Ubuntu)', \
76- 'ubuntu-docs (Ubuntu)', 'xserver-xorg-video-openchrome (Ubuntu)']
77+kernel_packages = ['linux (Ubuntu)', 'linux-fsl-imx51 (Ubuntu)', 'ubuntu-imx (Ubuntu)', \
78+ 'linux-backports-modules-2.6.32 (Ubuntu)', 'linux-ti-omap (Ubuntu)']
79+skip_packages = kernel_packages + \
80+ ['ubuntu-docs (Ubuntu)', 'xserver-xorg-video-openchrome (Ubuntu)']
81
82 open_status = ['New','Incomplete','Confirmed','Triaged','In Progress', 'Fix Committed']
83
84@@ -34,3 +35,6 @@
85
86 def get_count(collection):
87 return int(collection._wadl_resource.representation['total_size'])
88+
89+def negate_all_tags(tags):
90+ return ",".join(map(lambda a: "-"+a , tags))
91
92=== modified file 'patch-overview.py'
93--- patch-overview.py 2010-05-27 15:53:32 +0000
94+++ patch-overview.py 2010-06-01 15:13:26 +0000
95@@ -27,37 +27,27 @@
96 '-patch-rejected-debian'],tags_combinator='All')
97 accept_upstream = ubuntu.searchTasks(has_patch=True,
98 status=data.open_status,bug_subscriber=ur,status_upstream=['resolved_upstream'])
99- tasks = ubuntu.searchTasks(order_by='-date_last_updated',status=data.open_status,tags='-needs-packaging',has_patch=True)
100+ tasks = ubuntu.searchTasks(order_by='-date_last_updated',
101+ status=data.open_status,
102+ tags=data.negate_all_tags(['needs-packaging']+data.reviewed_tags),
103+ tags_combinator='All',
104+ has_patch=True)
105
106 for task in tasks:
107 bug = launchpad.bugs[task.bug.id]
108- # these bugs have been reviewed and require something
109- if set(data.reviewed_tags).intersection(bug.tags):
110- continue
111- subscribers = []
112- for subscriber in bug.subscriptions:
113- try:
114- subscribers.append(subscriber.person.name)
115- except lazr.restfulclient.errors.HTTPError, e:
116- if e.response.status == 410:
117- pass
118- else:
119- raise
120- # don't act on sync requests with the archive admin team subscribed
121- if 'sync' in bug.title.lower() and 'ubuntu-archive' in subscribers:
122- continue
123+ subscription_people = [a.person for a in bug.subscriptions]
124+ subscribers = [a.name for a in filter(lambda a: a.is_valid, subscription_people)]
125+
126 # don't act on bugs that already have a sponsor's team subscribed
127 if set(data.workflow_teams).intersection(subscribers):
128 continue
129 try:
130- for attachment in bug.attachments:
131- if attachment.type == 'Patch':
132- if task.bug_target_name in data.skip_packages:
133- continue
134- if bug.id in list_bugs:
135- continue
136- total_rq = total_rq + 1
137- list_bugs.append(bug.id)
138+ if bug.id in list_bugs:
139+ continue
140+ if task.bug_target_name in data.skip_packages:
141+ continue
142+ total_rq += 1
143+ list_bugs.append(bug.id)
144 except HTTPError:
145 print "Launchpad hates me and LP: #%s" % ( bug.id )
146

Subscribers

People subscribed via source and target branches

to all changes: