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
=== modified file 'lib/lp/soyuz/doc/buildd-mass-retry.txt'
--- lib/lp/soyuz/doc/buildd-mass-retry.txt 2010-04-14 17:34:35 +0000
+++ lib/lp/soyuz/doc/buildd-mass-retry.txt 2010-04-21 11:17:25 +0000
@@ -47,6 +47,45 @@
47 INFO Dry-run.47 INFO Dry-run.
48 <BLANKLINE>48 <BLANKLINE>
4949
50Superseded builds won't be retried; buildd-manager will just skip the build
51and set it to SUPERSEDED.
52
53 >>> from zope.security.proxy import removeSecurityProxy
54 >>> from lp.soyuz.interfaces.binarypackagebuild import (
55 ... IBinaryPackageBuildSet)
56 >>> from lp.soyuz.interfaces.publishing import PackagePublishingStatus
57 >>> build = getUtility(IBinaryPackageBuildSet).getByBuildID(12)
58 >>> pub = removeSecurityProxy(build.current_source_publication)
59
60Let's mark the build from the previous run superseded.
61
62 >>> pub.status = PackagePublishingStatus.SUPERSEDED
63 >>> print build.current_source_publication
64 None
65 >>> transaction.commit()
66
67A new run doesn't pick it up.
68
69 >>> process = subprocess.Popen([sys.executable, script, "-v", "-NFDC",
70 ... "-s", "hoary"],
71 ... stdout=subprocess.PIPE,
72 ... stderr=subprocess.PIPE,)
73 >>> stdout, stderr = process.communicate()
74 >>> process.returncode
75 0
76 >>> print stderr
77 DEBUG Intitialising connection.
78 INFO Initialising Build Mass-Retry for 'The Hoary Hedgehog Release/RELEASE'
79 INFO Processing builds in 'Failed to build'
80 INFO Processing builds in 'Dependency wait'
81 DEBUG Skipping superseded i386 build of libstdc++ b8p in ubuntu hoary RELEASE (12)
82 INFO Processing builds in 'Chroot problem'
83 INFO Success.
84 INFO Dry-run.
85 <BLANKLINE>
86
87 >>> pub.status = PackagePublishingStatus.PUBLISHED
88 >>> transaction.commit()
5089
51Passing an architecture, which contains no failed build records,90Passing an architecture, which contains no failed build records,
52nothing is done:91nothing is done:
5392
=== modified file 'scripts/ftpmaster-tools/buildd-mass-retry.py'
--- scripts/ftpmaster-tools/buildd-mass-retry.py 2010-03-19 21:26:13 +0000
+++ scripts/ftpmaster-tools/buildd-mass-retry.py 2010-04-21 11:17:25 +0000
@@ -121,6 +121,12 @@
121 build_state=target_state, pocket=pocket)121 build_state=target_state, pocket=pocket)
122122
123 for build in target_builds:123 for build in target_builds:
124 # Skip builds for superseded sources; they won't ever
125 # actually build.
126 if not build.current_source_publication:
127 log.debug(
128 'Skipping superseded %s (%s)' % (build.title, build.id))
129 continue
124130
125 if not build.can_be_retried:131 if not build.can_be_retried:
126 log.warn('Can not retry %s (%s)' % (build.title, build.id))132 log.warn('Can not retry %s (%s)' % (build.title, build.id))