Merge lp:~wgrant/launchpad/build-retry-superseded into lp:launchpad

Proposed by William Grant
Status: Merged
Merged at revision: 17734
Proposed branch: lp:~wgrant/launchpad/build-retry-superseded
Merge into: lp:launchpad
Diff against target: 32 lines (+11/-0)
2 files modified
lib/lp/soyuz/model/binarypackagebuild.py (+1/-0)
lib/lp/soyuz/tests/test_build.py (+10/-0)
To merge this branch: bzr merge lp:~wgrant/launchpad/build-retry-superseded
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+270808@code.launchpad.net

Commit message

Make SUPERSEDED builds retriable.

Description of the change

Make SUPERSEDED builds retriable.

We've used this on rare occasions in the past to allow builds to permakill builds, but that's much less of an issue nowadays.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/soyuz/model/binarypackagebuild.py'
2--- lib/lp/soyuz/model/binarypackagebuild.py 2015-08-27 10:01:41 +0000
3+++ lib/lp/soyuz/model/binarypackagebuild.py 2015-09-11 12:39:33 +0000
4@@ -448,6 +448,7 @@
5 BuildStatus.CHROOTWAIT,
6 BuildStatus.FAILEDTOUPLOAD,
7 BuildStatus.CANCELLED,
8+ BuildStatus.SUPERSEDED,
9 ]
10
11 # If the build is currently in any of the failed states,
12
13=== modified file 'lib/lp/soyuz/tests/test_build.py'
14--- lib/lp/soyuz/tests/test_build.py 2015-08-27 10:01:41 +0000
15+++ lib/lp/soyuz/tests/test_build.py 2015-09-11 12:39:33 +0000
16@@ -218,6 +218,16 @@
17 build.updateStatus(BuildStatus.CANCELLED)
18 self.assertTrue(build.can_be_retried)
19
20+ def test_retry_superseded(self):
21+ # A superseded build can be retried
22+ spph = self.publisher.getPubSource(
23+ sourcename=self.factory.getUniqueString(),
24+ version="%s.1" % self.factory.getUniqueInteger(),
25+ distroseries=self.distroseries)
26+ [build] = spph.createMissingBuilds()
27+ build.updateStatus(BuildStatus.SUPERSEDED)
28+ self.assertTrue(build.can_be_retried)
29+
30 def test_uploadlog(self):
31 # The upload log can be attached to a build
32 spph = self.publisher.getPubSource(