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

Proposed by Colin Watson
Status: Merged
Merged at revision: 18175
Proposed branch: lp:~cjwatson/launchpad/fairer-build-scores
Merge into: lp:launchpad
Diff against target: 248 lines (+23/-23)
12 files modified
lib/lp/code/browser/tests/test_sourcepackagerecipe.py (+3/-3)
lib/lp/code/model/sourcepackagerecipebuild.py (+1/-1)
lib/lp/code/model/tests/test_sourcepackagerecipe.py (+4/-4)
lib/lp/snappy/browser/tests/test_snap.py (+1/-1)
lib/lp/snappy/model/snapbuild.py (+1/-1)
lib/lp/snappy/tests/test_snap.py (+3/-3)
lib/lp/snappy/tests/test_snapbuild.py (+1/-1)
lib/lp/soyuz/model/livefsbuild.py (+1/-1)
lib/lp/soyuz/tests/test_livefs.py (+3/-3)
lib/lp/soyuz/tests/test_livefsbuild.py (+1/-1)
lib/lp/translations/model/translationtemplatesbuild.py (+2/-2)
lib/lp/translations/tests/test_translationtemplatesbuild.py (+2/-2)
To merge this branch: bzr merge lp:~cjwatson/launchpad/fairer-build-scores
Reviewer Review Type Date Requested Status
Celso Providelo (community) Approve
Launchpad code reviewers Pending
Review via email: mp+302807@code.launchpad.net

Commit message

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

Description of the change

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.

Also bump translation templates builds by five to keep them higher than typical source uploads.

To post a comment you must log in.
Revision history for this message
Celso Providelo (cprov) wrote :

Thanks Colin, LGTM.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/code/browser/tests/test_sourcepackagerecipe.py'
2--- lib/lp/code/browser/tests/test_sourcepackagerecipe.py 2016-05-13 21:12:59 +0000
3+++ lib/lp/code/browser/tests/test_sourcepackagerecipe.py 2016-08-12 13:42:04 +0000
4@@ -1513,7 +1513,7 @@
5 # Our recipe has a Warty distroseries
6 self.assertEqual(['Warty'], build_distros)
7 self.assertEqual(
8- set([2505]),
9+ set([2510]),
10 set(build.buildqueue_record.lastscore for build in builds))
11
12 def test_request_daily_builds_disabled_archive(self):
13@@ -1580,7 +1580,7 @@
14 # Secret Squirrel is checked by default.
15 self.assertEqual(['Secret Squirrel', 'Woody'], build_distros)
16 build_scores = [build.buildqueue_record.lastscore for build in builds]
17- self.assertContentEqual([2605, 2605], build_scores)
18+ self.assertContentEqual([2610, 2610], build_scores)
19
20 def test_request_builds_action_not_logged_in(self):
21 """Requesting a build creates pending builds."""
22@@ -1793,7 +1793,7 @@
23 created .*
24 Build status
25 Needs building
26- Start in .* \\(2505\\) What's this?.*
27+ Start in .* \\(2510\\) What's this?.*
28 Estimated finish in .*
29 Build details
30 Recipe: Recipe my-recipe for Owner
31
32=== modified file 'lib/lp/code/model/sourcepackagerecipebuild.py'
33--- lib/lp/code/model/sourcepackagerecipebuild.py 2016-01-12 01:24:06 +0000
34+++ lib/lp/code/model/sourcepackagerecipebuild.py 2016-08-12 13:42:04 +0000
35@@ -302,7 +302,7 @@
36 store.remove(self.build_farm_job)
37
38 def calculateScore(self):
39- return 2505 + self.archive.relative_build_score
40+ return 2510 + self.archive.relative_build_score
41
42 @classmethod
43 def getByID(cls, build_id):
44
45=== modified file 'lib/lp/code/model/tests/test_sourcepackagerecipe.py'
46--- lib/lp/code/model/tests/test_sourcepackagerecipe.py 2016-01-26 15:47:37 +0000
47+++ lib/lp/code/model/tests/test_sourcepackagerecipe.py 2016-08-12 13:42:04 +0000
48@@ -457,14 +457,14 @@
49 ppa.owner, distroseries, PackagePublishingPocket.RELEASE)
50
51 def test_requestBuildScore(self):
52- """Normal build requests have a relatively low queue score (2505)."""
53+ """Normal build requests have a relatively low queue score (2510)."""
54 recipe = self.makeSourcePackageRecipe()
55 build = recipe.requestBuild(recipe.daily_build_archive,
56 recipe.owner, list(recipe.distroseries)[0],
57 PackagePublishingPocket.RELEASE)
58 queue_record = build.buildqueue_record
59 queue_record.score()
60- self.assertEqual(2505, queue_record.lastscore)
61+ self.assertEqual(2510, queue_record.lastscore)
62
63 def test_requestBuildManualScore(self):
64 """Manual build requests have a score equivalent to binary builds."""
65@@ -474,7 +474,7 @@
66 PackagePublishingPocket.RELEASE, manual=True)
67 queue_record = build.buildqueue_record
68 queue_record.score()
69- self.assertEqual(2605, queue_record.lastscore)
70+ self.assertEqual(2610, queue_record.lastscore)
71
72 def test_requestBuild_relative_build_score(self):
73 """Offsets for archives are respected."""
74@@ -486,7 +486,7 @@
75 PackagePublishingPocket.RELEASE, manual=True)
76 queue_record = build.buildqueue_record
77 queue_record.score()
78- self.assertEqual(2705, queue_record.lastscore)
79+ self.assertEqual(2710, queue_record.lastscore)
80
81 def test_requestBuildRejectRepeats(self):
82 """Reject build requests that are identical to pending builds."""
83
84=== modified file 'lib/lp/snappy/browser/tests/test_snap.py'
85--- lib/lp/snappy/browser/tests/test_snap.py 2016-07-26 13:20:56 +0000
86+++ lib/lp/snappy/browser/tests/test_snap.py 2016-08-12 13:42:04 +0000
87@@ -1445,7 +1445,7 @@
88 [PackagePublishingPocket.UPDATES],
89 set(build.pocket for build in builds))
90 self.assertContentEqual(
91- [2505], set(build.buildqueue_record.lastscore for build in builds))
92+ [2510], set(build.buildqueue_record.lastscore for build in builds))
93
94 def test_request_builds_ppa(self):
95 # Selecting a different archive creates builds in that archive.
96
97=== modified file 'lib/lp/snappy/model/snapbuild.py'
98--- lib/lp/snappy/model/snapbuild.py 2016-07-27 01:43:45 +0000
99+++ lib/lp/snappy/model/snapbuild.py 2016-08-12 13:42:04 +0000
100@@ -249,7 +249,7 @@
101 self.buildqueue_record.cancel()
102
103 def calculateScore(self):
104- return 2505 + self.archive.relative_build_score
105+ return 2510 + self.archive.relative_build_score
106
107 def getMedianBuildDuration(self):
108 """Return the median duration of our successful builds."""
109
110=== modified file 'lib/lp/snappy/tests/test_snap.py'
111--- lib/lp/snappy/tests/test_snap.py 2016-07-01 11:53:31 +0000
112+++ lib/lp/snappy/tests/test_snap.py 2016-08-12 13:42:04 +0000
113@@ -170,7 +170,7 @@
114 self.assertEqual(BuildQueueStatus.WAITING, build_queue.status)
115
116 def test_requestBuild_score(self):
117- # Build requests have a relatively low queue score (2505).
118+ # Build requests have a relatively low queue score (2510).
119 processor = self.factory.makeProcessor(supports_virtualized=True)
120 distroarchseries = self.makeBuildableDistroArchSeries(
121 processor=processor)
122@@ -182,7 +182,7 @@
123 PackagePublishingPocket.UPDATES)
124 queue_record = build.buildqueue_record
125 queue_record.score()
126- self.assertEqual(2505, queue_record.lastscore)
127+ self.assertEqual(2510, queue_record.lastscore)
128
129 def test_requestBuild_relative_build_score(self):
130 # Offsets for archives are respected.
131@@ -198,7 +198,7 @@
132 PackagePublishingPocket.UPDATES)
133 queue_record = build.buildqueue_record
134 queue_record.score()
135- self.assertEqual(2605, queue_record.lastscore)
136+ self.assertEqual(2610, queue_record.lastscore)
137
138 def test_requestBuild_rejects_repeats(self):
139 # requestBuild refuses if there is already a pending build.
140
141=== modified file 'lib/lp/snappy/tests/test_snapbuild.py'
142--- lib/lp/snappy/tests/test_snapbuild.py 2016-07-27 01:43:45 +0000
143+++ lib/lp/snappy/tests/test_snapbuild.py 2016-08-12 13:42:04 +0000
144@@ -562,7 +562,7 @@
145 buildd_admin_webservice.default_api_version = "devel"
146 logout()
147 build = self.webservice.get(build_url).jsonBody()
148- self.assertEqual(2505, build["score"])
149+ self.assertEqual(2510, build["score"])
150 self.assertTrue(build["can_be_rescored"])
151 response = self.webservice.named_post(
152 build["self_link"], "rescore", score=5000)
153
154=== modified file 'lib/lp/soyuz/model/livefsbuild.py'
155--- lib/lp/soyuz/model/livefsbuild.py 2015-09-15 20:16:47 +0000
156+++ lib/lp/soyuz/model/livefsbuild.py 2016-08-12 13:42:04 +0000
157@@ -250,7 +250,7 @@
158 self.buildqueue_record.cancel()
159
160 def calculateScore(self):
161- return 2505 + self.archive.relative_build_score
162+ return 2510 + self.archive.relative_build_score
163
164 def getMedianBuildDuration(self):
165 """Return the median duration of our successful builds."""
166
167=== modified file 'lib/lp/soyuz/tests/test_livefs.py'
168--- lib/lp/soyuz/tests/test_livefs.py 2016-02-05 16:51:12 +0000
169+++ lib/lp/soyuz/tests/test_livefs.py 2016-08-12 13:42:04 +0000
170@@ -138,7 +138,7 @@
171 self.assertEqual(BuildQueueStatus.WAITING, build_queue.status)
172
173 def test_requestBuild_score(self):
174- # Build requests have a relatively low queue score (2505).
175+ # Build requests have a relatively low queue score (2510).
176 livefs = self.factory.makeLiveFS()
177 distroarchseries = self.factory.makeDistroArchSeries(
178 distroseries=livefs.distro_series)
179@@ -147,7 +147,7 @@
180 PackagePublishingPocket.RELEASE)
181 queue_record = build.buildqueue_record
182 queue_record.score()
183- self.assertEqual(2505, queue_record.lastscore)
184+ self.assertEqual(2510, queue_record.lastscore)
185
186 def test_requestBuild_relative_build_score(self):
187 # Offsets for archives are respected.
188@@ -161,7 +161,7 @@
189 PackagePublishingPocket.RELEASE)
190 queue_record = build.buildqueue_record
191 queue_record.score()
192- self.assertEqual(2605, queue_record.lastscore)
193+ self.assertEqual(2610, queue_record.lastscore)
194
195 def test_requestBuild_rejects_repeats(self):
196 # requestBuild refuses if there is already a pending build.
197
198=== modified file 'lib/lp/soyuz/tests/test_livefsbuild.py'
199--- lib/lp/soyuz/tests/test_livefsbuild.py 2016-02-05 16:51:12 +0000
200+++ lib/lp/soyuz/tests/test_livefsbuild.py 2016-08-12 13:42:04 +0000
201@@ -432,7 +432,7 @@
202 buildd_admin_webservice.default_api_version = "devel"
203 logout()
204 build = self.webservice.get(build_url).jsonBody()
205- self.assertEqual(2505, build["score"])
206+ self.assertEqual(2510, build["score"])
207 self.assertTrue(build["can_be_rescored"])
208 response = self.webservice.named_post(
209 build["self_link"], "rescore", score=5000)
210
211=== modified file 'lib/lp/translations/model/translationtemplatesbuild.py'
212--- lib/lp/translations/model/translationtemplatesbuild.py 2015-07-08 16:05:11 +0000
213+++ lib/lp/translations/model/translationtemplatesbuild.py 2016-08-12 13:42:04 +0000
214@@ -52,7 +52,7 @@
215 from lp.translations.pottery.detect_intltool import is_intltool_structure
216
217
218-HARDCODED_TRANSLATIONTEMPLATESBUILD_SCORE = 2510
219+HARDCODED_TRANSLATIONTEMPLATESBUILD_SCORE = 2515
220
221
222 @implementer(ITranslationTemplatesBuild)
223@@ -247,7 +247,7 @@
224
225 def calculateScore(self):
226 """See `IBuildFarmJob`."""
227- # Hard-code score for now. Most PPA jobs start out at 2505;
228+ # Hard-code score for now. Most PPA jobs start out at 2510;
229 # TranslationTemplateBuild are fast so we want them at a higher
230 # priority.
231 return HARDCODED_TRANSLATIONTEMPLATESBUILD_SCORE
232
233=== modified file 'lib/lp/translations/tests/test_translationtemplatesbuild.py'
234--- lib/lp/translations/tests/test_translationtemplatesbuild.py 2015-09-29 16:59:33 +0000
235+++ lib/lp/translations/tests/test_translationtemplatesbuild.py 2016-08-12 13:42:04 +0000
236@@ -126,10 +126,10 @@
237 ubuntu.currentseries.nominatedarchindep.processor, bq.processor)
238
239 def test_score(self):
240- # For now, these jobs always score themselves at 2510. In the
241+ # For now, these jobs always score themselves at 2515. In the
242 # future however the scoring system is to be revisited.
243 build = self.factory.makeTranslationTemplatesBuild()
244- self.assertEqual(2510, build.calculateScore())
245+ self.assertEqual(2515, build.calculateScore())
246
247 def test_build_cookie(self):
248 build = self.factory.makeTranslationTemplatesBuild()