--- a/mozilla-tests/tests_master.cfg
+++ b/mozilla-tests/tests_master.cfg
@@ -54,34 +54,11 @@ import passwords
reload(passwords)
from passwords import BBDB_URL
c['db_url'] = BBDB_URL
c['db_poll_interval'] = 60
c['multiMaster'] = True
c['mergeRequests'] = buildbotcustom.misc.mergeRequests
-# Give the release builders highest priority, then all branches priority over try
-def prioritizeBuilders(botmaster, builders):
- def sortkey(builder):
- builds = builder.getBuildable()
- if builds:
- req_priority = -builds[0].priority
- submitted_at = builds[0].submittedAt
- else:
- req_priority = 0
- submitted_at = None
-
- if builder.builder_status.category.endswith('-release'):
- priority = 0
- elif builder.builder_status.category == 'tryserver':
- priority = 2
- else:
- priority = 1
-
- return priority, req_priority, submitted_at
- builders.sort(key=sortkey)
- return builders
-c['prioritizeBuilders'] = prioritizeBuilders
-
# c is shorthand for BuildmasterConfig, so make sure they still refer to the
# same thing
assert c is BuildmasterConfig
--- a/mozilla-tests/universal_master_sqlite.cfg
+++ b/mozilla-tests/universal_master_sqlite.cfg
@@ -47,34 +47,11 @@ for branch in ACTIVE_BRANCHES:
# Required for sendchange
from buildbot.changes.pb import PBChangeSource
c['change_source'].append(PBChangeSource())
c['db_url'] = "sqlite:///state.sqlite"
c['mergeRequests'] = buildbotcustom.misc.mergeRequests
-# Give the release builders highest priority, then all branches priority over try
-def prioritizeBuilders(botmaster, builders):
- def sortkey(builder):
- builds = builder.getBuildable()
- if builds:
- req_priority = -builds[0].priority
- submitted_at = builds[0].submittedAt
- else:
- req_priority = 0
- submitted_at = None
-
- if builder.builder_status.category.endswith('-release'):
- priority = 0
- elif builder.builder_status.category == 'tryserver':
- priority = 2
- else:
- priority = 1
-
- return priority, req_priority, submitted_at
- builders.sort(key=sortkey)
- return builders
-c['prioritizeBuilders'] = prioritizeBuilders
-
# c is shorthand for BuildmasterConfig, so make sure they still refer to the
# same thing
assert c is BuildmasterConfig
--- a/mozilla/builder_master.cfg
+++ b/mozilla/builder_master.cfg
@@ -78,36 +78,11 @@ import passwords
reload(passwords)
from passwords import BBDB_URL
c['db_url'] = BBDB_URL
c['db_poll_interval'] = 60
c['multiMaster'] = True
c['mergeRequests'] = buildbotcustom.misc.mergeRequests
-# Give the release builders priority over other builders
-def prioritizeBuilders(botmaster, builders):
- def sortkey(builder):
- builds = builder.getBuildable()
- if builds:
- # The builder that gets sorted first, gets run first, but the build
- # request priorities are in ascending order (higher priority gets
- # run next), so flip the sign of the priority so that higher
- # priorities sort to the front
- req_priority = -builds[0].priority
- submitted_at = builds[0].submittedAt
- else:
- req_priority = 0
- submitted_at = None
-
- if builder.builder_status.category.startswith('release'):
- priority = 0
- else:
- priority = 1
-
- return priority, req_priority, submitted_at
- builders.sort(key=sortkey)
- return builders
-c['prioritizeBuilders'] = prioritizeBuilders
-
# c is shorthand for BuildmasterConfig, so make sure they still refer to the
# same thing
assert c is BuildmasterConfig
--- a/mozilla/master_common.py
+++ b/mozilla/master_common.py
@@ -8,8 +8,35 @@ c['eventHorizon'] = 20
c['buildCacheSize'] = 10
c['changeCacheSize'] = 10000
c['status'] = []
c['slaves'] = []
c['builders'] = []
c['schedulers'] = []
c['change_source'] = []
+
+# Give the release builders priority over other builders
+def prioritizeBuilders(botmaster, builders):
+ def sortkey(builder):
+ builds = builder.getBuildable(1)
+ if builds:
+ # The builder that gets sorted first, gets run first, but the build
+ # request priorities are in ascending order (higher priority gets
+ # run next), so flip the sign of the priority so that higher
+ # priorities sort to the front
+ req_priority = -builds[0].priority
+ submitted_at = builds[0].submittedAt
+ else:
+ req_priority = 0
+ submitted_at = None
+
+ if builder.builder_status.category.startswith('release'):
+ priority = 0
+ elif builder.builder_status.category.startswith('try'):
+ priority = 2
+ else:
+ priority = 1
+
+ return priority, req_priority, submitted_at
+ builders.sort(key=sortkey)
+ return builders
+c['prioritizeBuilders'] = prioritizeBuilders
--- a/mozilla/universal_master_sqlite.cfg
+++ b/mozilla/universal_master_sqlite.cfg
@@ -72,36 +72,11 @@ if ENABLE_RELEASES:
from buildbot.changes.pb import PBChangeSource
if len([cs for cs in c['change_source'] if isinstance(cs, PBChangeSource)]) < 1:
c['change_source'].append(PBChangeSource())
c['db_url'] = "sqlite:///state.sqlite"
c['mergeRequests'] = buildbotcustom.misc.mergeRequests
-# Give the release builders priority over other builders
-def prioritizeBuilders(botmaster, builders):
- def sortkey(builder):
- builds = builder.getBuildable()
- if builds:
- # The builder that gets sorted first, gets run first, but the build
- # request priorities are in ascending order (higher priority gets
- # run next), so flip the sign of the priority so that higher
- # priorities sort to the front
- req_priority = -builds[0].priority
- submitted_at = builds[0].submittedAt
- else:
- req_priority = 0
- submitted_at = None
-
- if builder.builder_status.category == 'release':
- priority = 0
- else:
- priority = 1
-
- return priority, req_priority, submitted_at
- builders.sort(key=sortkey)
- return builders
-c['prioritizeBuilders'] = prioritizeBuilders
-
# c is shorthand for BuildmasterConfig, so make sure they still refer to the
# same thing
assert c is BuildmasterConfig