← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~stefanor/launchpad/retry-cancelled-build into lp:launchpad

 

Stefano Rivera has proposed merging lp:~stefanor/launchpad/retry-cancelled-build into lp:launchpad.

Commit message:
Enable retry of user-cancelled builds.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #1016337 in Launchpad itself: "Cancelled PPA builds cannot be retried"
  https://bugs.launchpad.net/launchpad/+bug/1016337

For more details, see:
https://code.launchpad.net/~stefanor/launchpad/retry-cancelled-build/+merge/128683

== Summary ==

Cancelled PPA builds (non-virtual builds aren't cancellable) should be retryable. The standard mechanisms for retrying builds will work just fine, so it's simply a matter of enabling it.

== Complexity rationale ==

I'm 309 LoC in the green.

== Tests ==

There is a test in lp.soyuz.tests.test_build to ensure that cancelled builds are retryable.

== QA ==

Testing this requires a virtualised PPA builder:
* Upload a source package.
* Cancel the build.
* Retry it.
* See that it builds & publishes correctly.

But as the change is so trivial, it's probably just simpler to just not QA it.
-- 
https://code.launchpad.net/~stefanor/launchpad/retry-cancelled-build/+merge/128683
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stefanor/launchpad/retry-cancelled-build into lp:launchpad.
=== modified file 'lib/lp/soyuz/model/binarypackagebuild.py'
--- lib/lp/soyuz/model/binarypackagebuild.py	2012-10-03 09:15:55 +0000
+++ lib/lp/soyuz/model/binarypackagebuild.py	2012-10-09 11:05:28 +0000
@@ -335,6 +335,7 @@
             BuildStatus.MANUALDEPWAIT,
             BuildStatus.CHROOTWAIT,
             BuildStatus.FAILEDTOUPLOAD,
+            BuildStatus.CANCELLED,
             ]
 
         # If the build is currently in any of the failed states,

=== modified file 'lib/lp/soyuz/tests/test_build.py'
--- lib/lp/soyuz/tests/test_build.py	2012-01-01 02:58:52 +0000
+++ lib/lp/soyuz/tests/test_build.py	2012-10-09 11:05:28 +0000
@@ -215,6 +215,17 @@
             build.status = BuildStatus.FAILEDTOBUILD
         self.assertTrue(build.can_be_retried)
 
+    def test_retry_cancelled(self):
+        # A cancelled build can be retried
+        spph = self.publisher.getPubSource(
+            sourcename=self.factory.getUniqueString(),
+            version="%s.1" % self.factory.getUniqueInteger(),
+            distroseries=self.distroseries)
+        [build] = spph.createMissingBuilds()
+        with person_logged_in(self.admin):
+            build.status = BuildStatus.CANCELLED
+        self.assertTrue(build.can_be_retried)
+
     def test_uploadlog(self):
         # The upload log can be attached to a build
         spph = self.publisher.getPubSource(


Follow ups