Merge lp:~wgrant/launchpad/bug-565739-dont-retry-superseded-builds into lp:launchpad

Proposed by William Grant
Status: Merged
Approved by: Gavin Panella
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~wgrant/launchpad/bug-565739-dont-retry-superseded-builds
Merge into: lp:launchpad
Diff against target: 66 lines (+45/-0)
2 files modified
lib/lp/soyuz/doc/buildd-mass-retry.txt (+39/-0)
scripts/ftpmaster-tools/buildd-mass-retry.py (+6/-0)
To merge this branch: bzr merge lp:~wgrant/launchpad/bug-565739-dont-retry-superseded-builds
Reviewer Review Type Date Requested Status
Gavin Panella (community) Approve
Review via email: mp+23622@code.launchpad.net

Commit message

buildd-mass-retry.py will no longer retry superseded builds.

Description of the change

See bug #565739 for the problem. This branch just skips builds if their current_source_publication is None, which indicates that their source is superseded or deleted (the same check as buildd-manager uses). I don't think there's much point in logging this condition, as it is very normal.

There is no lint.

To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) wrote :

On logging, I thinks worth logging, but at a quiet level not normally
output. Making it possible to debug things is good :)

Revision history for this message
Gavin Panella (allenap) wrote :

What Robert said :)

review: Needs Fixing
Revision history for this message
William Grant (wgrant) wrote :

Pfft, everyone knows that Soyuz isn't meant to be debuggable by mortal beings.

But fixed.

Revision history for this message
Gavin Panella (allenap) :
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/doc/buildd-mass-retry.txt'
2--- lib/lp/soyuz/doc/buildd-mass-retry.txt 2010-04-14 17:34:35 +0000
3+++ lib/lp/soyuz/doc/buildd-mass-retry.txt 2010-04-21 11:17:25 +0000
4@@ -47,6 +47,45 @@
5 INFO Dry-run.
6 <BLANKLINE>
7
8+Superseded builds won't be retried; buildd-manager will just skip the build
9+and set it to SUPERSEDED.
10+
11+ >>> from zope.security.proxy import removeSecurityProxy
12+ >>> from lp.soyuz.interfaces.binarypackagebuild import (
13+ ... IBinaryPackageBuildSet)
14+ >>> from lp.soyuz.interfaces.publishing import PackagePublishingStatus
15+ >>> build = getUtility(IBinaryPackageBuildSet).getByBuildID(12)
16+ >>> pub = removeSecurityProxy(build.current_source_publication)
17+
18+Let's mark the build from the previous run superseded.
19+
20+ >>> pub.status = PackagePublishingStatus.SUPERSEDED
21+ >>> print build.current_source_publication
22+ None
23+ >>> transaction.commit()
24+
25+A new run doesn't pick it up.
26+
27+ >>> process = subprocess.Popen([sys.executable, script, "-v", "-NFDC",
28+ ... "-s", "hoary"],
29+ ... stdout=subprocess.PIPE,
30+ ... stderr=subprocess.PIPE,)
31+ >>> stdout, stderr = process.communicate()
32+ >>> process.returncode
33+ 0
34+ >>> print stderr
35+ DEBUG Intitialising connection.
36+ INFO Initialising Build Mass-Retry for 'The Hoary Hedgehog Release/RELEASE'
37+ INFO Processing builds in 'Failed to build'
38+ INFO Processing builds in 'Dependency wait'
39+ DEBUG Skipping superseded i386 build of libstdc++ b8p in ubuntu hoary RELEASE (12)
40+ INFO Processing builds in 'Chroot problem'
41+ INFO Success.
42+ INFO Dry-run.
43+ <BLANKLINE>
44+
45+ >>> pub.status = PackagePublishingStatus.PUBLISHED
46+ >>> transaction.commit()
47
48 Passing an architecture, which contains no failed build records,
49 nothing is done:
50
51=== modified file 'scripts/ftpmaster-tools/buildd-mass-retry.py'
52--- scripts/ftpmaster-tools/buildd-mass-retry.py 2010-03-19 21:26:13 +0000
53+++ scripts/ftpmaster-tools/buildd-mass-retry.py 2010-04-21 11:17:25 +0000
54@@ -121,6 +121,12 @@
55 build_state=target_state, pocket=pocket)
56
57 for build in target_builds:
58+ # Skip builds for superseded sources; they won't ever
59+ # actually build.
60+ if not build.current_source_publication:
61+ log.debug(
62+ 'Skipping superseded %s (%s)' % (build.title, build.id))
63+ continue
64
65 if not build.can_be_retried:
66 log.warn('Can not retry %s (%s)' % (build.title, build.id))