Merge lp:~wgrant/launchpad/show-package-sets-in-queue into lp:launchpad

Proposed by William Grant
Status: Merged
Approved by: Michael Hudson-Doyle
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~wgrant/launchpad/show-package-sets-in-queue
Merge into: lp:launchpad
Diff against target: 426 lines (+148/-64)
8 files modified
lib/lp/soyuz/browser/queue.py (+11/-0)
lib/lp/soyuz/doc/packageset.txt (+14/-2)
lib/lp/soyuz/interfaces/packageset.py (+7/-1)
lib/lp/soyuz/model/packageset.py (+7/-2)
lib/lp/soyuz/stories/soyuz/xx-queue-pages-delayed-copies.txt (+2/-2)
lib/lp/soyuz/stories/soyuz/xx-queue-pages-motu.txt (+7/-7)
lib/lp/soyuz/stories/soyuz/xx-queue-pages.txt (+94/-50)
lib/lp/soyuz/templates/distroseries-queue.pt (+6/-0)
To merge this branch: bzr merge lp:~wgrant/launchpad/show-package-sets-in-queue
Reviewer Review Type Date Requested Status
Paul Hummer (community) code ui* Approve
Review via email: mp+21521@code.launchpad.net

Commit message

Show source package sets in the queue UI.

Description of the change

It was requested that we show package sets on DistroSeries/+queue, since it is critical during freezes to be able to differentiate between those sources which are seeded onto CDs, and those which are not. This branch shows the package set inclusions in source queue rows (only direct inclusions -- anything else could get very wide and is not desired).

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) wrote :
Revision history for this message
Paul Hummer (rockstar) wrote :

Thanks for this branch. Anything to make Ubuntu packagers happy is a big +1 for me. The code looks good. Have you talked this over with anyone from Soyuz?

review: Approve (code ui*)
Revision history for this message
William Grant (wgrant) wrote :

Yeah, Julian gave it a +1 last night.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

I'll land this too.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/soyuz/browser/queue.py'
2--- lib/lp/soyuz/browser/queue.py 2010-03-09 08:33:19 +0000
3+++ lib/lp/soyuz/browser/queue.py 2010-03-17 02:52:22 +0000
4@@ -28,6 +28,7 @@
5 IBinaryPackageNameSet)
6 from lp.soyuz.interfaces.files import (
7 IBinaryPackageFileSet, ISourcePackageReleaseFileSet)
8+from lp.soyuz.interfaces.packageset import IPackagesetSet
9 from lp.soyuz.interfaces.publishing import name_priority_map
10 from canonical.launchpad.webapp import LaunchpadView
11 from canonical.launchpad.webapp.batching import BatchNavigator
12@@ -480,3 +481,13 @@
13 return self.sources[0].sourcepackagerelease.upload_changesfile
14 return self.context.changesfile
15
16+ @property
17+ def package_sets(self):
18+ assert self.sourcepackagerelease, \
19+ "Can only be used on a source upload."
20+ return ' '.join(sorted(ps.name for ps in
21+ getUtility(IPackagesetSet).setsIncludingSource(
22+ self.sourcepackagerelease.sourcepackagename,
23+ distroseries=self.distroseries,
24+ direct_inclusion=True)))
25+
26
27=== modified file 'lib/lp/soyuz/doc/packageset.txt'
28--- lib/lp/soyuz/doc/packageset.txt 2009-12-24 01:41:54 +0000
29+++ lib/lp/soyuz/doc/packageset.txt 2010-03-17 02:52:22 +0000
30@@ -500,6 +500,20 @@
31 1 -> umbrella
32 5 -> firefox
33
34+We can filter the package sets by series:
35+
36+ >>> from canonical.launchpad.interfaces import IDistributionSet
37+ >>> ubuntu = getUtility(IDistributionSet)['ubuntu']
38+ >>> print_data(
39+ ... ps_set.setsIncludingSource(firefox_spn,
40+ ... distroseries=ubuntu['hoary']))
41+ 1 -> umbrella
42+ 4 -> mozilla
43+ 5 -> firefox
44+ >>> print_data(
45+ ... ps_set.setsIncludingSource(firefox_spn,
46+ ... distroseries=ubuntu['warty']))
47+
48 It is also possible to ask the same question by providing the mere name of
49 the source package.
50
51@@ -622,10 +636,8 @@
52 Introduce a copy archive that will be used to disambiguate archive
53 permissions.
54
55- >>> from canonical.launchpad.interfaces import IDistributionSet
56 >>> from lp.soyuz.interfaces.archive import (
57 ... ArchivePurpose, IArchiveSet)
58- >>> ubuntu = getUtility(IDistributionSet)['ubuntu']
59 >>> rebuild_archive = getUtility(IArchiveSet).new(
60 ... owner=person1, purpose=ArchivePurpose.COPY,
61 ... distribution=ubuntu, name='copy-archive',
62
63=== modified file 'lib/lp/soyuz/interfaces/packageset.py'
64--- lib/lp/soyuz/interfaces/packageset.py 2009-11-03 14:43:22 +0000
65+++ lib/lp/soyuz/interfaces/packageset.py 2010-03-17 02:52:22 +0000
66@@ -27,6 +27,7 @@
67 operation_parameters, operation_returns_collection_of,
68 operation_returns_entry, webservice_error)
69 from lazr.restful.fields import Reference
70+from lazr.restful.interface import copy_field
71 from lp.registry.interfaces.distroseries import IDistroSeries
72 from lp.registry.interfaces.person import IPerson
73 from lp.registry.interfaces.role import IHasOwner
74@@ -413,10 +414,12 @@
75 @operation_parameters(
76 sourcepackagename=TextLine(
77 title=_('Source package name'), required=True),
78+ distroseries=copy_field(IPackageset['distroseries'], required=False),
79 direct_inclusion=Bool(required=False))
80 @operation_returns_collection_of(IPackageset)
81 @export_read_operation()
82- def setsIncludingSource(sourcepackagename, direct_inclusion=False):
83+ def setsIncludingSource(sourcepackagename, distroseries=None,
84+ direct_inclusion=False):
85 """Get the package sets that include this source package.
86
87 Return all package sets that directly or indirectly include the
88@@ -424,6 +427,9 @@
89
90 :param sourcepackagename: the included source package name; can be
91 either a string or a `ISourcePackageName`.
92+ :param distroseries: the `IDistroSeries` in which to look for sets.
93+ If omitted, matching package sets from all series will be
94+ returned.
95 :param direct_inclusion: if this flag is set to True, then only
96 package sets that directly include this source package name will
97 be considered.
98
99=== modified file 'lib/lp/soyuz/model/packageset.py'
100--- lib/lp/soyuz/model/packageset.py 2009-11-06 21:10:13 +0000
101+++ lib/lp/soyuz/model/packageset.py 2010-03-17 02:52:22 +0000
102@@ -403,7 +403,8 @@
103 source_name = getUtility(ISourcePackageNameSet)[source_name]
104 return source_name
105
106- def setsIncludingSource(self, sourcepackagename, direct_inclusion=False):
107+ def setsIncludingSource(self, sourcepackagename, distroseries=None,
108+ direct_inclusion=False):
109 """See `IPackagesetSet`."""
110 sourcepackagename = self._nameToSourcePackageName(sourcepackagename)
111
112@@ -421,5 +422,9 @@
113 '''
114 store = IStore(Packageset)
115 psets = SQL(query, (sourcepackagename.id,))
116- result_set = store.find(Packageset, In(Packageset.id, psets))
117+ clauses = [In(Packageset.id, psets)]
118+ if distroseries:
119+ clauses.append(Packageset.distroseries == distroseries)
120+
121+ result_set = store.find(Packageset, *clauses)
122 return _order_result_set(result_set)
123
124=== modified file 'lib/lp/soyuz/stories/soyuz/xx-queue-pages-delayed-copies.txt'
125--- lib/lp/soyuz/stories/soyuz/xx-queue-pages-delayed-copies.txt 2010-02-26 13:35:45 +0000
126+++ lib/lp/soyuz/stories/soyuz/xx-queue-pages-delayed-copies.txt 2010-03-17 02:52:22 +0000
127@@ -48,7 +48,7 @@
128
129 >>> for row in find_tags_by_class(anon_browser.contents, "queue-row"):
130 ... print extract_text(row)
131- Package Version Component Section Priority Pocket When
132+ Package Version Component Section Priority Sets Pocket When
133 foo, foo (delayed) (source, i386) 666 main base low ...
134
135 >>> anon_browser.getLink('foo, foo')
136@@ -84,7 +84,7 @@
137
138 >>> for row in find_tags_by_class(cprov_browser.contents, "queue-row"):
139 ... print extract_text(row)
140- Package Version Component Section Priority Pocket When
141+ Package Version Component Section Priority Sets Pocket When
142 foo, foo (delayed) (source, i386) 666 main base low ...
143
144 >>> anon_browser.getLink('foo, foo')
145
146=== modified file 'lib/lp/soyuz/stories/soyuz/xx-queue-pages-motu.txt'
147--- lib/lp/soyuz/stories/soyuz/xx-queue-pages-motu.txt 2009-07-01 13:16:44 +0000
148+++ lib/lp/soyuz/stories/soyuz/xx-queue-pages-motu.txt 2010-03-17 02:52:22 +0000
149@@ -38,13 +38,13 @@
150 ... "http://launchpad.dev/ubuntu/breezy-autotest/")
151 >>> motu_browser.getLink("Show uploads").click()
152 >>> print_queue(motu_browser.contents)
153- Package Version Component Section Priority Pocket When
154- netapplet...ddtp... - Release 2006...
155- netapplet...dist... - Release 2006...
156- alsa-utils (source) 1.0.9a-4... main base low Release 2006...
157- netapplet (source) 0.99.6-1 main web low Release 2006...
158- pmount (i386) 0.1-1 Release 2006...
159- moz...irefox (i386) 0.9 Release 2006...
160+ Package Version Component Section Priority Sets Pocket When
161+ netapplet...ddtp... - Release 2006...
162+ netapplet...dist... - Release 2006...
163+ alsa-utils (source) 1.0.9a-4... main base low Release 2006...
164+ netapplet (source) 0.99.6-1 main web low Release 2006...
165+ pmount (i386) 0.1-1 Release 2006...
166+ moz...irefox (i386) 0.9 Release 2006...
167
168 If we try and accept "alsa-utils" it will fail because our user does
169 not have permission to accept items in "main":
170
171=== modified file 'lib/lp/soyuz/stories/soyuz/xx-queue-pages.txt'
172--- lib/lp/soyuz/stories/soyuz/xx-queue-pages.txt 2010-03-05 17:04:27 +0000
173+++ lib/lp/soyuz/stories/soyuz/xx-queue-pages.txt 2010-03-17 02:52:22 +0000
174@@ -62,13 +62,13 @@
175 ... print extract_text(row)
176
177 >>> print_queue(anon_browser.contents)
178- Package Version Component Section Priority Pocket When
179- netapplet...ddtp... - Release 2006-...
180- netapplet...dist... - Release 2006-...
181- alsa-utils (source) 1.0.9a-4... main base low Release 2006-...
182- netapplet (source) 0.99.6-1 main web low Release 2006-...
183- pmount (i386) 0.1-1 Release 2006-...
184- moz...irefox (i386) 0.9 Release 2006-...
185+ Package Version Component Section Priority Sets Pocket When
186+ netapplet...ddtp... - Release 2006-...
187+ netapplet...dist... - Release 2006-...
188+ alsa-utils (source) 1.0.9a-4... main base low Release 2006-...
189+ netapplet (source) 0.99.6-1 main web low Release 2006-...
190+ pmount (i386) 0.1-1 Release 2006-...
191+ moz...irefox (i386) 0.9 Release 2006-...
192
193 The package name in the results list is a clickable link to the changes
194 file for that upload.
195@@ -92,12 +92,12 @@
196 ... name="queue_state", index=0).displayValue = ['Unapproved']
197 >>> anon_browser.getControl("Update").click()
198 >>> print_queue(anon_browser.contents)
199- Package Version Component Section Priority Pocket When
200- lang...-de (source) 1.0 main trans... low Proposed 2007-...
201- netapplet...ddtp... - Backp... 2006-...
202- cnews (source) 1.0 main base low Release 2006-...
203- cnews (source) 1.0 main base low Release 2006-...
204- netapplet...(raw-translations) - Updates 2006-...
205+ Package Version Component Section Priority Sets Pocket When
206+ lang...-de (source) 1.0 main trans... low Proposed 2007-...
207+ netapplet...ddtp... - Backp... 2006-...
208+ cnews (source) 1.0 main base low Release 2006-...
209+ cnews (source) 1.0 main base low Release 2006-...
210+ netapplet...(raw-translations) - Updates 2006-...
211
212 The results can be filtered matching source name, binary name or
213 custom-upload filename.
214@@ -105,24 +105,68 @@
215 >>> anon_browser.getControl(name="queue_text").value = 'language'
216 >>> anon_browser.getControl("Update").click()
217 >>> print_queue(anon_browser.contents)
218- Package Version Component Section Priority Pocket When
219- lang...-de (source) 1.0 main trans... low Proposed 2007-...
220+ Package Version Component Section Priority Sets Pocket When
221+ lang...-de (source) 1.0 main trans... low Proposed 2007-...
222
223 >>> anon_browser.getControl(name="queue_text").value = 'netapplet'
224 >>> anon_browser.getControl("Update").click()
225 >>> print_queue(anon_browser.contents)
226- Package Version Component Section Priority Pocket When
227- netapplet...(raw-translations) - Updates 2006-...
228- netapplet...ddtp... - Backp... 2006-...
229+ Package Version Component Section Priority Sets Pocket When
230+ netapplet...(raw-translations) - Updates 2006-...
231+ netapplet...ddtp... - Backp... 2006-...
232
233 >>> anon_browser.getControl(
234 ... name="queue_state", index=0).displayValue = ['New']
235 >>> anon_browser.getControl(name="queue_text").value = 'pmount'
236 >>> anon_browser.getControl("Update").click()
237 >>> print_queue(anon_browser.contents)
238- Package Version Component Section Priority Pocket When
239- pmount (i386) 0.1-1 Release 2006-...
240-
241+ Package Version Component Section Priority Sets Pocket When
242+ pmount (i386) 0.1-1 Release 2006-...
243+
244+A source's package sets are listed in the queue. Since there are none in
245+the sample data, we'll first add some.
246+
247+ >>> login('foo.bar@canonical.com')
248+ >>> from lp.soyuz.interfaces.packageset import IPackagesetSet
249+ >>> ubuntu = getUtility(IDistributionSet)['ubuntu']
250+ >>> hoary = ubuntu['hoary']
251+ >>> breezy_autotest = ubuntu['breezy-autotest']
252+ >>> pss = getUtility(IPackagesetSet)
253+ >>> desktop = pss.new(
254+ ... u'desktop', u'Ubuntu Desktop', name12, breezy_autotest)
255+ >>> server = pss.new(
256+ ... u'server', u'Ubuntu Server', name12, breezy_autotest)
257+ >>> core = pss.new(
258+ ... u'core', u'Ubuntu Core', name12, breezy_autotest)
259+ >>> desktop.add([core])
260+ >>> desktop.addSources(['alsa-utils'])
261+ >>> server.addSources(['alsa-utils'])
262+ >>> core.addSources(['netapplet'])
263+
264+Package sets from other series are not shown.
265+
266+ >>> kubuntu = pss.new(u'kubuntu', u'Kubuntu', name12, hoary)
267+ >>> kubuntu.addSources(['alsa-utils'])
268+ >>> logout()
269+
270+ >>> anon_browser.getControl(
271+ ... name="queue_state", index=0).displayValue = ['New']
272+ >>> anon_browser.getControl(name="queue_text").value = ''
273+ >>> anon_browser.getControl("Update").click()
274+ >>> print_queue(anon_browser.contents)
275+ Package Version Component Section Priority Sets Pocket When
276+ netapplet...ddtp... - Release 2006-...
277+ netapplet...dist... - Release 2006-...
278+ alsa-utils (source) 1.0.9a-4... main base low desktop server Release 2006-...
279+ netapplet (source) 0.99.6-1 main web low core Release 2006-...
280+ pmount (i386) 0.1-1 Release 2006-...
281+ moz...irefox (i386) 0.9 Release 2006-...
282+
283+ >>> login('foo.bar@canonical.com')
284+ >>> desktop.removeSources(['alsa-utils'])
285+ >>> server.removeSources(['alsa-utils'])
286+ >>> core.removeSources(['netapplet'])
287+ >>> logout()
288
289 == Queue item filelist ==
290
291@@ -243,26 +287,26 @@
292 >>> upload_manager_browser.open(
293 ... "http://localhost/ubuntu/breezy-autotest/+queue")
294 >>> print_queue(upload_manager_browser.contents)
295- Package Version Component Section Priority Pocket When
296- bar (source) 1.0-1 universe devel low Release ...
297- netapplet...ddtp... - Release 2006-...
298- netapplet...dist... - Release 2006-...
299- alsa-utils (source) 1.0.9a-4... main base low Release 2006-...
300- netapplet (source) 0.99.6-1 main web low Release 2006-...
301- pmount (i386) 0.1-1 Release 2006-...
302- moz...irefox (i386) 0.9 Release 2006-...
303+ Package Version Component Section Priority Sets Pocket When
304+ bar (source) 1.0-1 universe devel low Release ...
305+ netapplet...ddtp... - Release 2006-...
306+ netapplet...dist... - Release 2006-...
307+ alsa-utils (source) 1.0.9a-4... main base low Release 2006-...
308+ netapplet (source) 0.99.6-1 main web low Release 2006-...
309+ pmount (i386) 0.1-1 Release 2006-...
310+ moz...irefox (i386) 0.9 Release 2006-...
311
312 >>> upload_manager_browser.getControl(
313 ... name="QUEUE_ID").value = [str(bar_queue_id)]
314 >>> upload_manager_browser.getControl(name="Accept").click()
315 >>> print_queue(upload_manager_browser.contents)
316- Package Version Component Section Priority Pocket When
317- netapplet...ddtp... - Release 2006-...
318- netapplet...dist... - Release 2006-...
319- alsa-utils (source) 1.0.9a-4... main base low Release 2006-...
320- netapplet (source) 0.99.6-1 main web low Release 2006-...
321- pmount (i386) 0.1-1 Release 2006-...
322- moz...irefox (i386) 0.9 Release 2006-...
323+ Package Version Component Section Priority Sets Pocket When
324+ netapplet...ddtp... - Release 2006-...
325+ netapplet...dist... - Release 2006-...
326+ alsa-utils (source) 1.0.9a-4... main base low Release 2006-...
327+ netapplet (source) 0.99.6-1 main web low Release 2006-...
328+ pmount (i386) 0.1-1 Release 2006-...
329+ moz...irefox (i386) 0.9 Release 2006-...
330
331 Accepting queue items results in an email to the uploader (and the changer
332 if it is someone other than the uploader) and (usually) an email to the
333@@ -310,8 +354,8 @@
334 ... name="queue_state", index=0).displayValue = ['Accepted']
335 >>> upload_manager_browser.getControl("Update").click()
336 >>> print_queue(upload_manager_browser.contents)
337- Package Version Component Section Priority Pocket When
338- moz...irefox (i386) 0.9 Release 2006-...
339+ Package Version Component Section Priority Sets Pocket When
340+ moz...irefox (i386) 0.9 Release 2006-...
341
342 Going back to the "new" queue, we can see our item has gone:
343
344@@ -319,8 +363,8 @@
345 ... name="queue_state", index=0).displayValue = ['New']
346 >>> upload_manager_browser.getControl("Update").click()
347 >>> print_queue(upload_manager_browser.contents)
348- Package Version Component Section Priority Pocket When
349- netapplet...ddtp... - Release 2006-...
350+ Package Version Component Section Priority Sets Pocket When
351+ netapplet...ddtp... - Release 2006-...
352 netapplet...dist... - Release 2006-...
353 alsa-utils (source) 1.0.9a-4... main base low Release 2006-...
354 netapplet (source) 0.99.6-1 main web low Release 2006-...
355@@ -396,10 +440,10 @@
356 OK: pmount(restricted/admin/extra)
357
358 >>> print_queue(upload_manager_browser.contents)
359- Package Version Component Section Priority Pocket When
360- netapplet...ddtp... - Release 2006-...
361- netapplet...dist... - Release 2006-...
362- alsa-utils (source) 1.0.9a-4... main base low Release 2006-...
363+ Package Version Component Section Priority Sets Pocket When
364+ netapplet...ddtp... - Release 2006-...
365+ netapplet...dist... - Release 2006-...
366+ alsa-utils (source) 1.0.9a-4... main base low Release 2006-...
367
368 Any user can now see the 'accepted' queue contains pmount with its
369 overridden values.
370@@ -408,8 +452,8 @@
371 ... name="queue_state", index=0).displayValue=['Accepted']
372 >>> anon_browser.getControl("Update").click()
373 >>> print_queue(anon_browser.contents)
374- Package Version Component Section Priority Pocket When
375- pmount (i386) 0.1-1 Release 2006-...
376+ Package Version Component Section Priority Sets Pocket When
377+ pmount (i386) 0.1-1 Release 2006-...
378 ...
379
380 The user can drill down into the file list to see the overridden binary
381@@ -428,7 +472,7 @@
382 ... name="queue_state", index=0).displayValue=['Done']
383 >>> anon_browser.getControl("Update").click()
384 >>> print_queue(anon_browser.contents)
385- Package Version Component Section Priority Pocket When
386+ Package Version Component Section Priority Sets Pocket When
387 ...
388 netapplet (source) 0.99.6-1 restricted admin low ...
389
390@@ -446,9 +490,9 @@
391 OK: alsa-utils
392
393 >>> print_queue(upload_manager_browser.contents)
394- Package Version Component Section Priority Pocket When
395- netapplet...ddtp... - Release 2006-...
396- netapplet...dist... - Release 2006-...
397+ Package Version Component Section Priority Sets Pocket When
398+ netapplet...ddtp... - Release 2006-...
399+ netapplet...dist... - Release 2006-...
400
401 One rejection email is generated:
402
403
404=== modified file 'lib/lp/soyuz/templates/distroseries-queue.pt'
405--- lib/lp/soyuz/templates/distroseries-queue.pt 2009-09-04 10:19:08 +0000
406+++ lib/lp/soyuz/templates/distroseries-queue.pt 2010-03-17 02:52:22 +0000
407@@ -63,6 +63,7 @@
408 <th> Component </th>
409 <th> Section </th>
410 <th> Priority </th>
411+ <th> Sets </th>
412 <th> Pocket </th>
413 <th> When </th>
414 </tr>
415@@ -111,6 +112,11 @@
416 content="packageupload/sourcepackagerelease/urgency/name/lower">
417 </tal:priority>
418 </td>
419+ <td style="padding-top: 5px">
420+ <tal:packagesets condition="is_source"
421+ content="packageupload/package_sets">
422+ </tal:packagesets>
423+ </td>
424 </tal:is_source>
425 <td style="padding-top: 5px"
426 tal:content="packageupload/pocket/title">Updates