Merge lp:~thumper/launchpad/bugjam-684515-recipe-builds into lp:launchpad

Proposed by Tim Penhey
Status: Rejected
Rejected by: Tim Penhey
Proposed branch: lp:~thumper/launchpad/bugjam-684515-recipe-builds
Merge into: lp:launchpad
Diff against target: 71 lines (+27/-1)
4 files modified
lib/lp/code/model/sourcepackagerecipe.py (+5/-0)
lib/lp/code/model/sourcepackagerecipebuild.py (+0/-1)
lib/lp/code/model/tests/test_sourcepackagerecipe.py (+19/-0)
lib/lp/code/model/tests/test_sourcepackagerecipebuild.py (+3/-0)
To merge this branch: bzr merge lp:~thumper/launchpad/bugjam-684515-recipe-builds
Reviewer Review Type Date Requested Status
Aaron Bentley (community) Disapprove
Review via email: mp+43730@code.launchpad.net

Description of the change

If a user requests a daily build for a recipe, don't try to automatically build it.

The caveat to that is that the recipe is built into the daily build PPA.

This change does mean that if a manual build is requested for a subset of the distro series into the daily build PPA, that an automatic build of the remaining distroseries will not be attempted. However, we may want to simplify the request build process and the distroseries to not have differences - this isn't however part of the change in this branch.

To post a comment you must log in.
Revision history for this message
Aaron Bentley (abentley) wrote :

This will prevent all daily builds, regardless of distroseries. In fact, the manual build could have been done deliberately for a particular distroseries, to see whether the recipe works for that distroseries.

I don't think this bug is suitable for the bug jam. It's not trivial. It probably means doing full manifest support so that we can abort early.

review: Disapprove
Revision history for this message
Tim Penhey (thumper) wrote :

Yes, I did mention that in the description. I think that we will be solving more problems than we create.

We are fixing the problem where users who are keen to get their new change built ASAP end up getting failed to upload problems. Given that there is a simple work-around for the situation where extra distroseries are needed to be built, I still think that this fix is worth landing.

Also, since the implementation was simple, I did think it was fine for the bug jam.

Revision history for this message
Aaron Bentley (abentley) wrote :

There hasn't been any apparent urgency until now. AFAIK, Robert and Jelmer are the only people talking about this.

I'd rather take a day or two and fix it properly than introduce technical debt with a quick-and-dirty fix. I recognise that a proper fix might not be appropriate during the bug jam.

Unmerged revisions

12071. By Tim Penhey

Manual builds into the daily PPA mean that we don't try the automatic daily build (unless new revisions turn up).

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/code/model/sourcepackagerecipe.py'
--- lib/lp/code/model/sourcepackagerecipe.py 2010-12-07 05:18:25 +0000
+++ lib/lp/code/model/sourcepackagerecipe.py 2010-12-15 02:58:55 +0000
@@ -246,6 +246,11 @@
246 queue_record = build.buildqueue_record246 queue_record = build.buildqueue_record
247 if manual:247 if manual:
248 queue_record.manualScore(queue_record.lastscore + 100)248 queue_record.manualScore(queue_record.lastscore + 100)
249 # If this build is going into the daily build archive, then we don't
250 # want to attempt to build it during the next automatic daily build
251 # run.
252 if archive == self.daily_build_archive:
253 self.is_stale = False
249 return build254 return build
250255
251 def getBuilds(self, pending=False):256 def getBuilds(self, pending=False):
252257
=== modified file 'lib/lp/code/model/sourcepackagerecipebuild.py'
--- lib/lp/code/model/sourcepackagerecipebuild.py 2010-11-30 12:23:01 +0000
+++ lib/lp/code/model/sourcepackagerecipebuild.py 2010-12-15 02:58:55 +0000
@@ -201,7 +201,6 @@
201 errorlog.globalErrorUtility.raising(info)201 errorlog.globalErrorUtility.raising(info)
202 else:202 else:
203 builds.append(build)203 builds.append(build)
204 recipe.is_stale = False
205 return builds204 return builds
206205
207 def _unqueueBuild(self):206 def _unqueueBuild(self):
208207
=== modified file 'lib/lp/code/model/tests/test_sourcepackagerecipe.py'
--- lib/lp/code/model/tests/test_sourcepackagerecipe.py 2010-12-01 11:26:57 +0000
+++ lib/lp/code/model/tests/test_sourcepackagerecipe.py 2010-12-15 02:58:55 +0000
@@ -366,6 +366,25 @@
366 queue_record.score()366 queue_record.score()
367 self.assertEqual(2605, queue_record.lastscore)367 self.assertEqual(2605, queue_record.lastscore)
368368
369 def test_requestBuild_into_daily_ppa_resets_stale(self):
370 # A stale recipe that is requested to build into the daily ppa is no
371 # longer stale.
372 recipe = self.factory.makeSourcePackageRecipe()
373 recipe.requestBuild(recipe.daily_build_archive,
374 recipe.owner, list(recipe.distroseries)[0],
375 PackagePublishingPocket.RELEASE)
376 self.assertFalse(recipe.is_stale)
377
378 def test_requestBuild_into_other_ppa_is_still_stale(self):
379 # A stale recipe that is requested to build into a PPA other than the
380 # daily PPA is still considered stale.
381 recipe = self.factory.makeSourcePackageRecipe()
382 ppa = self.factory.makeArchive()
383 recipe.requestBuild(
384 ppa, ppa.owner, list(recipe.distroseries)[0],
385 PackagePublishingPocket.RELEASE)
386 self.assertTrue(recipe.is_stale)
387
369 def test_requestBuild_relative_build_score(self):388 def test_requestBuild_relative_build_score(self):
370 """Offsets for archives are respected."""389 """Offsets for archives are respected."""
371 recipe = self.factory.makeSourcePackageRecipe()390 recipe = self.factory.makeSourcePackageRecipe()
372391
=== modified file 'lib/lp/code/model/tests/test_sourcepackagerecipebuild.py'
--- lib/lp/code/model/tests/test_sourcepackagerecipebuild.py 2010-11-19 12:22:15 +0000
+++ lib/lp/code/model/tests/test_sourcepackagerecipebuild.py 2010-12-15 02:58:55 +0000
@@ -252,6 +252,9 @@
252 second_distroseries = \252 second_distroseries = \
253 self.factory.makeSourcePackageRecipeDistroseries("hoary")253 self.factory.makeSourcePackageRecipeDistroseries("hoary")
254 recipe.distroseries.add(second_distroseries)254 recipe.distroseries.add(second_distroseries)
255 # The scanner normally marks recipes as stale when new revisions are
256 # pushed. For this test fake it.
257 removeSecurityProxy(recipe).is_stale = True
255 builds = SourcePackageRecipeBuild.makeDailyBuilds()258 builds = SourcePackageRecipeBuild.makeDailyBuilds()
256 self.assertEqual(259 self.assertEqual(
257 [second_distroseries], [build.distroseries for build in builds])260 [second_distroseries], [build.distroseries for build in builds])