By default, buildbot will attempt to start builds on builders in order from the
builder with the oldest pending request to the newest. This behaviour can be
customized with the c['prioritizeBuilders'] configuration key.
This key specifies a function which is called with two arguments: a
BuildMaster and a list of Builder objects. It
should return a list of Builder objects in the desired order.
It may also remove items from the list if builds should not be started
on those builders.
def prioritizeBuilders(buildmaster, builders):
"""Prioritize builders. 'finalRelease' builds have the highest
priority, so they should be built before running tests, or
creating builds."""
builderPriorities = {
"finalRelease": 0,
"test": 1,
"build": 2,
}
builders.sort(key=lambda b: builderPriorities.get(b.name, 0))
return builders
c['prioritizeBuilders'] = prioritizeBuilders