← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~twom/launchpad/handle-manual-review-without-error into lp:launchpad

 

Tom Wardill has proposed merging lp:~twom/launchpad/handle-manual-review-without-error into lp:launchpad.

Commit message:
Manual Review should not fail the upload job

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~twom/launchpad/handle-manual-review-without-error/+merge/369106

Now the release intent is moved to the dashboard, a snap upload entering the manual review stage should not be considered a job failure.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~twom/launchpad/handle-manual-review-without-error into lp:launchpad.
=== modified file 'lib/lp/snappy/model/snapstoreclient.py'
--- lib/lp/snappy/model/snapstoreclient.py	2019-06-19 16:07:01 +0000
+++ lib/lp/snappy/model/snapstoreclient.py	2019-06-20 16:46:42 +0000
@@ -343,6 +343,11 @@
             if not response_data["processed"]:
                 raise UploadNotScannedYetResponse()
             elif "errors" in response_data:
+                # This is returned as error in the upload,
+                # but there is nothing we can do about it,
+                # our upload has been successful
+                if response_data['code'] == 'need_manual_review':
+                    return response_data["url"], response_data["revision"]
                 error_message = "\n".join(
                     error["message"] for error in response_data["errors"])
                 error_messages = []

=== modified file 'lib/lp/snappy/tests/test_snapstoreclient.py'
--- lib/lp/snappy/tests/test_snapstoreclient.py	2019-06-19 13:40:06 +0000
+++ lib/lp/snappy/tests/test_snapstoreclient.py	2019-06-20 16:46:42 +0000
@@ -621,6 +621,27 @@
             self.client.checkStatus, status_url)
 
     @responses.activate
+    def test_checkStatus_manual_review(self):
+        status_url = "http://sca.example/dev/api/snaps/1/builds/1/status";
+        responses.add(
+            "GET", status_url,
+            json={
+                "errors": [
+                    {"code": None,
+                     "link": None,
+                     "message": "found potentially sensitive files in package",
+                     }],
+                "url": "http://sca.example/dev/click-apps/1/rev/1/";,
+                "code": "need_manual_review",
+                "processed": True,
+                "can_release": False,
+                "revision": 1
+                })
+        self.assertEqual(
+            ("http://sca.example/dev/click-apps/1/rev/1/";, 1),
+            self.client.checkStatus(status_url))
+
+    @responses.activate
     def test_listChannels(self):
         self._addChannelsResponse()
         self.assertEqual(self.channels, self.client.listChannels())


Follow ups