← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~stefanor/launchpad/packageset-destructor into lp:launchpad

 

Stefano Rivera has proposed merging lp:~stefanor/launchpad/packageset-destructor into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #891862 in Launchpad itself: "Changing the owner of a packageset requires SQL"
  https://bugs.launchpad.net/launchpad/+bug/891862

For more details, see:
https://code.launchpad.net/~stefanor/launchpad/packageset-destructor/+merge/127167

== Summary ==
Follow up to merge 124555.

The deletion API method should be exposed as a destructor operation, which avoids lplib clients getting 404s on deletion.

== Complexity rationale ==

The previous merge was dropped 309 LoC, this adds 1 :)

== Tests ==

Modified lib/lp/soyuz/stories/webservice/xx-packageset.txt to do a HTTP DELETE operation.

== QA ==

edit-acl in lp:~stefanor/ubuntu-archive-tools/edit-packagesets can exercise this.
-- 
https://code.launchpad.net/~stefanor/launchpad/packageset-destructor/+merge/127167
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stefanor/launchpad/packageset-destructor into lp:launchpad.
=== modified file 'lib/lp/soyuz/interfaces/packageset.py'
--- lib/lp/soyuz/interfaces/packageset.py	2012-09-11 12:43:45 +0000
+++ lib/lp/soyuz/interfaces/packageset.py	2012-09-30 16:59:21 +0000
@@ -21,6 +21,7 @@
     error_status,
     export_as_webservice_collection,
     export_as_webservice_entry,
+    export_destructor_operation,
     export_factory_operation,
     export_operation_as,
     export_read_operation,
@@ -348,7 +349,7 @@
         :param names: an iterable with string package set names
         """
 
-    @export_write_operation()
+    @export_destructor_operation()
     @export_operation_as('delete')
     @operation_for_version('devel')
     def destroySelf():

=== modified file 'lib/lp/soyuz/stories/webservice/xx-packageset.txt'
--- lib/lp/soyuz/stories/webservice/xx-packageset.txt	2012-09-28 14:48:20 +0000
+++ lib/lp/soyuz/stories/webservice/xx-packageset.txt	2012-09-30 16:59:21 +0000
@@ -108,8 +108,8 @@
 
 And then delete it.
 
-    >>> response = webservice.named_post(
-    ...     '/package-sets/hoary/renamed', 'delete', {}, api_version='devel')
+    >>> response = webservice.delete(
+    ...     '/package-sets/hoary/renamed', {}, api_version='devel')
     >>> print response
     HTTP/1.1 200 Ok
     ...


Follow ups