[buildbot] phase1: make GetNextBuild() branch aware

LEDE Commits lede-commits at lists.infradead.org
Mon May 15 08:39:19 PDT 2023


ynezz pushed a commit to buildbot.git, branch master:
https://git.openwrt.org/57b19a6a6e504d6c03579d1d1f9df26ba3d62b9f

commit 57b19a6a6e504d6c03579d1d1f9df26ba3d62b9f
Author: Thibaut VARÈNE <hacks at slashdirt.org>
AuthorDate: Mon Oct 24 16:03:38 2022 +0200

    phase1: make GetNextBuild() branch aware
    
    Signed-off-by: Thibaut VARÈNE <hacks at slashdirt.org>
---
 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))




More information about the lede-commits mailing list