launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #04266
[Merge] lp:~stevenk/launchpad/daily-build-oops into lp:launchpad
Steve Kowalik has proposed merging lp:~stevenk/launchpad/daily-build-oops into lp:launchpad.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Related bugs:
Bug #798931 in Launchpad itself: "recipe daily build script raised a BuildNotAllowedForDistro"
https://bugs.launchpad.net/launchpad/+bug/798931
For more details, see:
https://code.launchpad.net/~stevenk/launchpad/daily-build-oops/+merge/67915
We shouldn't OOPS in makeDailyBuilds() if a user has a daily build requested for a series that is disallowed to be built against. A way to notify the user would be nice, but for now, log the error.
--
https://code.launchpad.net/~stevenk/launchpad/daily-build-oops/+merge/67915
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stevenk/launchpad/daily-build-oops into lp:launchpad.
=== modified file 'lib/lp/code/model/sourcepackagerecipebuild.py'
--- lib/lp/code/model/sourcepackagerecipebuild.py 2011-05-17 14:11:30 +0000
+++ lib/lp/code/model/sourcepackagerecipebuild.py 2011-07-14 03:54:27 +0000
@@ -51,7 +51,10 @@
PackageBuild,
PackageBuildDerived,
)
-from lp.code.errors import BuildAlreadyPending
+from lp.code.errors import (
+ BuildAlreadyPending,
+ BuildNotAllowedForDistro,
+ )
from lp.code.interfaces.sourcepackagerecipebuild import (
ISourcePackageRecipeBuild,
ISourcePackageRecipeBuildJob,
@@ -226,6 +229,9 @@
logger.debug(
' - daily build failed for %s: %s',
series_name, str(e))
+ except BuildNotAllowedForDistro:
+ logger.debug(
+ ' - Can not build against %s.' % series_name)
except ProgrammingError:
raise
except:
=== modified file 'lib/lp/code/model/tests/test_sourcepackagerecipebuild.py'
--- lib/lp/code/model/tests/test_sourcepackagerecipebuild.py 2011-05-20 10:28:53 +0000
+++ lib/lp/code/model/tests/test_sourcepackagerecipebuild.py 2011-07-14 03:54:27 +0000
@@ -45,6 +45,7 @@
SourcePackageRecipeBuildMailer,
)
from lp.code.model.sourcepackagerecipebuild import SourcePackageRecipeBuild
+from lp.registry.interfaces.series import SeriesStatus
from lp.registry.interfaces.pocket import PackagePublishingPocket
from lp.services.log.logger import BufferLogger
from lp.services.mail.sendmail import format_address
@@ -409,6 +410,21 @@
actual_title = [b.title for b in daily_builds]
self.assertEquals([build.title], actual_title)
+ def test_makeDailyBuilds_with_disallowed_series(self):
+ # If a recipe is set to build into a disallowed series,
+ # makeDailyBuilds won't OOPS.
+ recipe = self.factory.makeSourcePackageRecipe(
+ build_daily=True, is_stale=True)
+ self.factory.makeArchive(owner=recipe.owner)
+ logger = BufferLogger()
+ distroseries = list(recipe.distroseries)[0]
+ removeSecurityProxy(distroseries).status = SeriesStatus.OBSOLETE
+ SourcePackageRecipeBuild.makeDailyBuilds(logger)
+ self.assertEquals([], self.oopses)
+ self.assertIn(
+ "DEBUG - Can not build against Warty (4.10).",
+ logger.getLogBuffer())
+
def test_getRecentBuilds(self):
"""Recent builds match the same person, series and receipe.