launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #27522
[Merge] ~cjwatson/launchpad:fix-snap-getBuildByStoreRevision-declaration into launchpad:master
Colin Watson has proposed merging ~cjwatson/launchpad:fix-snap-getBuildByStoreRevision-declaration into launchpad:master.
Commit message:
Fix webservice declaration of Snap.getBuildByStoreRevision
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/408799
It needs to be declared as returning an entry, otherwise lazr.restfulclient will just treat the response body as a dict.
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:fix-snap-getBuildByStoreRevision-declaration into launchpad:master.
diff --git a/lib/lp/snappy/interfaces/snap.py b/lib/lp/snappy/interfaces/snap.py
index 088af8c..c947d27 100644
--- a/lib/lp/snappy/interfaces/snap.py
+++ b/lib/lp/snappy/interfaces/snap.py
@@ -531,6 +531,8 @@ class ISnapView(Interface):
@operation_parameters(
store_upload_revision=Int(title="Store revision",
required=True))
+ # Really ISnapBuild, patched in lp.snappy.interfaces.webservice.
+ @operation_returns_entry(Interface)
@export_read_operation()
@operation_for_version("devel")
def getBuildByStoreRevision(store_upload_revision, user=None):
diff --git a/lib/lp/snappy/interfaces/webservice.py b/lib/lp/snappy/interfaces/webservice.py
index 30def61..d96695c 100644
--- a/lib/lp/snappy/interfaces/webservice.py
+++ b/lib/lp/snappy/interfaces/webservice.py
@@ -59,6 +59,7 @@ patch_entry_return_type(ISnapView, 'requestBuild', ISnapBuild)
patch_collection_property(ISnapView, 'builds', ISnapBuild)
patch_collection_property(ISnapView, 'completed_builds', ISnapBuild)
patch_collection_property(ISnapView, 'pending_builds', ISnapBuild)
+patch_entry_return_type(ISnapView, 'getBuildByStoreRevision', ISnapBuild)
# ISnapEdit
patch_collection_return_type(ISnapEdit, 'requestAutoBuilds', ISnapBuild)