Merge lp:~cjwatson/launchpad/queue-api-get-package-uploads into lp:launchpad

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: no longer in the source branch.
Merged at revision: 15537
Proposed branch: lp:~cjwatson/launchpad/queue-api-get-package-uploads
Merge into: lp:launchpad
Diff against target: 41 lines (+20/-0)
2 files modified
lib/lp/registry/interfaces/distroseries.py (+7/-0)
lib/lp/soyuz/stories/webservice/xx-packageupload.txt (+13/-0)
To merge this branch: bzr merge lp:~cjwatson/launchpad/queue-api-get-package-uploads
Reviewer Review Type Date Requested Status
Benji York (community) code Approve
Review via email: mp+113068@code.launchpad.net

Commit message

Export name, version, and exact_match parameters to DistroSeries.getPackageUploads.

Description of the change

== Summary ==

Next stage of an API-based upload queue client: allow limiting DS.getPackageUploads queries by name/version/exact_match in the usual way. This was already possible internally but was not exported.

== Pre-implementation notes ==

Broken out from https://code.launchpad.net/~cjwatson/launchpad/queue-api/+merge/108967 at Benji's suggestion.

== LOC Rationale ==

+20. As noted in https://code.launchpad.net/~cjwatson/launchpad/queue-api/+merge/108967, this arc will be LoC-negative.

== Tests ==

bin/test -vvct xx-packageupload.txt

== Demo and Q/A ==

I have a prototype client, currently http://paste.ubuntu.com/1071514/; 'queue info some-package-name-substring' and 'queue -e info some-package-name' should be enough to test this.

To post a comment you must log in.
Revision history for this message
Benji York (benji) wrote :

Looks good.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/registry/interfaces/distroseries.py'
2--- lib/lp/registry/interfaces/distroseries.py 2012-06-19 03:26:57 +0000
3+++ lib/lp/registry/interfaces/distroseries.py 2012-07-02 16:06:32 +0000
4@@ -527,6 +527,13 @@
5 description=_("Return only items with custom files of this "
6 "type."),
7 required=False),
8+ name=TextLine(title=_("Package or file name"), required=False),
9+ version=TextLine(title=_("Package version"), required=False),
10+ exact_match=Bool(
11+ title=_("Exact match"),
12+ description=_("Whether to filter name and version by exact "
13+ "matching."),
14+ required=False),
15 )
16 # Really IPackageUpload, patched in _schema_circular_imports.py
17 @operation_returns_collection_of(Interface)
18
19=== modified file 'lib/lp/soyuz/stories/webservice/xx-packageupload.txt'
20--- lib/lp/soyuz/stories/webservice/xx-packageupload.txt 2012-05-30 14:12:44 +0000
21+++ lib/lp/soyuz/stories/webservice/xx-packageupload.txt 2012-07-02 16:06:32 +0000
22@@ -31,6 +31,19 @@
23 self_link: u'http://.../ubuntu/warty/+upload/11'
24 status: u'Done'
25
26+getPackageUploads can filter on package names.
27+
28+ >>> uploads = webservice.named_get(
29+ ... warty['self_link'], 'getPackageUploads',
30+ ... name='mozilla').jsonBody()
31+ >>> len(uploads['entries'])
32+ 1
33+ >>> uploads = webservice.named_get(
34+ ... warty['self_link'], 'getPackageUploads',
35+ ... name='missing').jsonBody()
36+ >>> len(uploads['entries'])
37+ 0
38+
39
40 Retrieving Static Translation Files
41 ===================================