← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~cjwatson/launchpad/fairer-build-scores into lp:launchpad

 

Colin Watson has proposed merging lp:~cjwatson/launchpad/fairer-build-scores into lp:launchpad.

Commit message:
Increase recipe, livefs, and snap build scores by five points now that most source uploads are urgency=medium.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/fairer-build-scores/+merge/302807

The default build scores for recipes, livefses, and snaps are set to be equal to urgency=low source package uploads.  This used to make sense.  However, nowadays, most source packages are urgency=medium due to a change in devscripts, and so the practical result is that recipes, livefses, and snaps are normally only built when the build queue is empty of source packages, which is not great prioritisation.  Bump these scores to be equal to urgency=medium source package uploads instead so that we get fairer ordering.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/fairer-build-scores into lp:launchpad.
=== modified file 'lib/lp/code/browser/tests/test_sourcepackagerecipe.py'
--- lib/lp/code/browser/tests/test_sourcepackagerecipe.py	2016-05-13 21:12:59 +0000
+++ lib/lp/code/browser/tests/test_sourcepackagerecipe.py	2016-08-12 13:42:04 +0000
@@ -1513,7 +1513,7 @@
         # Our recipe has a Warty distroseries
         self.assertEqual(['Warty'], build_distros)
         self.assertEqual(
-            set([2505]),
+            set([2510]),
             set(build.buildqueue_record.lastscore for build in builds))
 
     def test_request_daily_builds_disabled_archive(self):
@@ -1580,7 +1580,7 @@
         # Secret Squirrel is checked by default.
         self.assertEqual(['Secret Squirrel', 'Woody'], build_distros)
         build_scores = [build.buildqueue_record.lastscore for build in builds]
-        self.assertContentEqual([2605, 2605], build_scores)
+        self.assertContentEqual([2610, 2610], build_scores)
 
     def test_request_builds_action_not_logged_in(self):
         """Requesting a build creates pending builds."""
@@ -1793,7 +1793,7 @@
             created .*
             Build status
             Needs building
-            Start in .* \\(2505\\) What's this?.*
+            Start in .* \\(2510\\) What's this?.*
             Estimated finish in .*
             Build details
             Recipe:        Recipe my-recipe for Owner

=== modified file 'lib/lp/code/model/sourcepackagerecipebuild.py'
--- lib/lp/code/model/sourcepackagerecipebuild.py	2016-01-12 01:24:06 +0000
+++ lib/lp/code/model/sourcepackagerecipebuild.py	2016-08-12 13:42:04 +0000
@@ -302,7 +302,7 @@
         store.remove(self.build_farm_job)
 
     def calculateScore(self):
-        return 2505 + self.archive.relative_build_score
+        return 2510 + self.archive.relative_build_score
 
     @classmethod
     def getByID(cls, build_id):

=== modified file 'lib/lp/code/model/tests/test_sourcepackagerecipe.py'
--- lib/lp/code/model/tests/test_sourcepackagerecipe.py	2016-01-26 15:47:37 +0000
+++ lib/lp/code/model/tests/test_sourcepackagerecipe.py	2016-08-12 13:42:04 +0000
@@ -457,14 +457,14 @@
                     ppa.owner, distroseries, PackagePublishingPocket.RELEASE)
 
     def test_requestBuildScore(self):
-        """Normal build requests have a relatively low queue score (2505)."""
+        """Normal build requests have a relatively low queue score (2510)."""
         recipe = self.makeSourcePackageRecipe()
         build = recipe.requestBuild(recipe.daily_build_archive,
             recipe.owner, list(recipe.distroseries)[0],
             PackagePublishingPocket.RELEASE)
         queue_record = build.buildqueue_record
         queue_record.score()
-        self.assertEqual(2505, queue_record.lastscore)
+        self.assertEqual(2510, queue_record.lastscore)
 
     def test_requestBuildManualScore(self):
         """Manual build requests have a score equivalent to binary builds."""
@@ -474,7 +474,7 @@
             PackagePublishingPocket.RELEASE, manual=True)
         queue_record = build.buildqueue_record
         queue_record.score()
-        self.assertEqual(2605, queue_record.lastscore)
+        self.assertEqual(2610, queue_record.lastscore)
 
     def test_requestBuild_relative_build_score(self):
         """Offsets for archives are respected."""
@@ -486,7 +486,7 @@
             PackagePublishingPocket.RELEASE, manual=True)
         queue_record = build.buildqueue_record
         queue_record.score()
-        self.assertEqual(2705, queue_record.lastscore)
+        self.assertEqual(2710, queue_record.lastscore)
 
     def test_requestBuildRejectRepeats(self):
         """Reject build requests that are identical to pending builds."""

=== modified file 'lib/lp/snappy/browser/tests/test_snap.py'
--- lib/lp/snappy/browser/tests/test_snap.py	2016-07-26 13:20:56 +0000
+++ lib/lp/snappy/browser/tests/test_snap.py	2016-08-12 13:42:04 +0000
@@ -1445,7 +1445,7 @@
             [PackagePublishingPocket.UPDATES],
             set(build.pocket for build in builds))
         self.assertContentEqual(
-            [2505], set(build.buildqueue_record.lastscore for build in builds))
+            [2510], set(build.buildqueue_record.lastscore for build in builds))
 
     def test_request_builds_ppa(self):
         # Selecting a different archive creates builds in that archive.

=== modified file 'lib/lp/snappy/model/snapbuild.py'
--- lib/lp/snappy/model/snapbuild.py	2016-07-27 01:43:45 +0000
+++ lib/lp/snappy/model/snapbuild.py	2016-08-12 13:42:04 +0000
@@ -249,7 +249,7 @@
         self.buildqueue_record.cancel()
 
     def calculateScore(self):
-        return 2505 + self.archive.relative_build_score
+        return 2510 + self.archive.relative_build_score
 
     def getMedianBuildDuration(self):
         """Return the median duration of our successful builds."""

=== modified file 'lib/lp/snappy/tests/test_snap.py'
--- lib/lp/snappy/tests/test_snap.py	2016-07-01 11:53:31 +0000
+++ lib/lp/snappy/tests/test_snap.py	2016-08-12 13:42:04 +0000
@@ -170,7 +170,7 @@
         self.assertEqual(BuildQueueStatus.WAITING, build_queue.status)
 
     def test_requestBuild_score(self):
-        # Build requests have a relatively low queue score (2505).
+        # Build requests have a relatively low queue score (2510).
         processor = self.factory.makeProcessor(supports_virtualized=True)
         distroarchseries = self.makeBuildableDistroArchSeries(
             processor=processor)
@@ -182,7 +182,7 @@
             PackagePublishingPocket.UPDATES)
         queue_record = build.buildqueue_record
         queue_record.score()
-        self.assertEqual(2505, queue_record.lastscore)
+        self.assertEqual(2510, queue_record.lastscore)
 
     def test_requestBuild_relative_build_score(self):
         # Offsets for archives are respected.
@@ -198,7 +198,7 @@
             PackagePublishingPocket.UPDATES)
         queue_record = build.buildqueue_record
         queue_record.score()
-        self.assertEqual(2605, queue_record.lastscore)
+        self.assertEqual(2610, queue_record.lastscore)
 
     def test_requestBuild_rejects_repeats(self):
         # requestBuild refuses if there is already a pending build.

=== modified file 'lib/lp/snappy/tests/test_snapbuild.py'
--- lib/lp/snappy/tests/test_snapbuild.py	2016-07-27 01:43:45 +0000
+++ lib/lp/snappy/tests/test_snapbuild.py	2016-08-12 13:42:04 +0000
@@ -562,7 +562,7 @@
         buildd_admin_webservice.default_api_version = "devel"
         logout()
         build = self.webservice.get(build_url).jsonBody()
-        self.assertEqual(2505, build["score"])
+        self.assertEqual(2510, build["score"])
         self.assertTrue(build["can_be_rescored"])
         response = self.webservice.named_post(
             build["self_link"], "rescore", score=5000)

=== modified file 'lib/lp/soyuz/model/livefsbuild.py'
--- lib/lp/soyuz/model/livefsbuild.py	2015-09-15 20:16:47 +0000
+++ lib/lp/soyuz/model/livefsbuild.py	2016-08-12 13:42:04 +0000
@@ -250,7 +250,7 @@
         self.buildqueue_record.cancel()
 
     def calculateScore(self):
-        return 2505 + self.archive.relative_build_score
+        return 2510 + self.archive.relative_build_score
 
     def getMedianBuildDuration(self):
         """Return the median duration of our successful builds."""

=== modified file 'lib/lp/soyuz/tests/test_livefs.py'
--- lib/lp/soyuz/tests/test_livefs.py	2016-02-05 16:51:12 +0000
+++ lib/lp/soyuz/tests/test_livefs.py	2016-08-12 13:42:04 +0000
@@ -138,7 +138,7 @@
         self.assertEqual(BuildQueueStatus.WAITING, build_queue.status)
 
     def test_requestBuild_score(self):
-        # Build requests have a relatively low queue score (2505).
+        # Build requests have a relatively low queue score (2510).
         livefs = self.factory.makeLiveFS()
         distroarchseries = self.factory.makeDistroArchSeries(
             distroseries=livefs.distro_series)
@@ -147,7 +147,7 @@
             PackagePublishingPocket.RELEASE)
         queue_record = build.buildqueue_record
         queue_record.score()
-        self.assertEqual(2505, queue_record.lastscore)
+        self.assertEqual(2510, queue_record.lastscore)
 
     def test_requestBuild_relative_build_score(self):
         # Offsets for archives are respected.
@@ -161,7 +161,7 @@
             PackagePublishingPocket.RELEASE)
         queue_record = build.buildqueue_record
         queue_record.score()
-        self.assertEqual(2605, queue_record.lastscore)
+        self.assertEqual(2610, queue_record.lastscore)
 
     def test_requestBuild_rejects_repeats(self):
         # requestBuild refuses if there is already a pending build.

=== modified file 'lib/lp/soyuz/tests/test_livefsbuild.py'
--- lib/lp/soyuz/tests/test_livefsbuild.py	2016-02-05 16:51:12 +0000
+++ lib/lp/soyuz/tests/test_livefsbuild.py	2016-08-12 13:42:04 +0000
@@ -432,7 +432,7 @@
         buildd_admin_webservice.default_api_version = "devel"
         logout()
         build = self.webservice.get(build_url).jsonBody()
-        self.assertEqual(2505, build["score"])
+        self.assertEqual(2510, build["score"])
         self.assertTrue(build["can_be_rescored"])
         response = self.webservice.named_post(
             build["self_link"], "rescore", score=5000)

=== modified file 'lib/lp/translations/model/translationtemplatesbuild.py'
--- lib/lp/translations/model/translationtemplatesbuild.py	2015-07-08 16:05:11 +0000
+++ lib/lp/translations/model/translationtemplatesbuild.py	2016-08-12 13:42:04 +0000
@@ -52,7 +52,7 @@
 from lp.translations.pottery.detect_intltool import is_intltool_structure
 
 
-HARDCODED_TRANSLATIONTEMPLATESBUILD_SCORE = 2510
+HARDCODED_TRANSLATIONTEMPLATESBUILD_SCORE = 2515
 
 
 @implementer(ITranslationTemplatesBuild)
@@ -247,7 +247,7 @@
 
     def calculateScore(self):
         """See `IBuildFarmJob`."""
-        # Hard-code score for now.  Most PPA jobs start out at 2505;
+        # Hard-code score for now.  Most PPA jobs start out at 2510;
         # TranslationTemplateBuild are fast so we want them at a higher
         # priority.
         return HARDCODED_TRANSLATIONTEMPLATESBUILD_SCORE

=== modified file 'lib/lp/translations/tests/test_translationtemplatesbuild.py'
--- lib/lp/translations/tests/test_translationtemplatesbuild.py	2015-09-29 16:59:33 +0000
+++ lib/lp/translations/tests/test_translationtemplatesbuild.py	2016-08-12 13:42:04 +0000
@@ -126,10 +126,10 @@
             ubuntu.currentseries.nominatedarchindep.processor, bq.processor)
 
     def test_score(self):
-        # For now, these jobs always score themselves at 2510.  In the
+        # For now, these jobs always score themselves at 2515.  In the
         # future however the scoring system is to be revisited.
         build = self.factory.makeTranslationTemplatesBuild()
-        self.assertEqual(2510, build.calculateScore())
+        self.assertEqual(2515, build.calculateScore())
 
     def test_build_cookie(self):
         build = self.factory.makeTranslationTemplatesBuild()


Follow ups