From 57b19a6a6e504d6c03579d1d1f9df26ba3d62b9f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thibaut=20VAR=C3=88NE?= Date: Mon, 24 Oct 2022 16:03:38 +0200 Subject: [PATCH] phase1: make GetNextBuild() branch aware MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Thibaut VARÈNE --- phase1/master.cfg | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/phase1/master.cfg b/phase1/master.cfg index 9f4a343..1064efc 100644 --- a/phase1/master.cfg +++ b/phase1/master.cfg @@ -244,6 +244,7 @@ c['prioritizeBuilders'] = prioritizeBuilders ####### CHANGESOURCES +branchNames = [branches[b]["name"] for b in branches] # find targets targets = [ ] @@ -441,8 +442,15 @@ def GetUsignKey(props): def GetNextBuild(builder, requests): for r in requests: - if r.properties and r.properties.hasProperty("tag"): - return r + if r.properties: + # order tagged build first + if r.properties.hasProperty("tag"): + return r + # then order by branch order + pbranch = r.properties.getProperty("branch") + for name in branchNames: + if pbranch == name: + return r r = requests[0] log.msg("GetNextBuild: {:>20} id: {} bsid: {}".format(builder.name, r.id, r.bsid)) -- 2.30.2