phase1: make GetNextBuild() branch aware
authorThibaut VARÈNE <hacks@slashdirt.org>
Mon, 24 Oct 2022 14:03:38 +0000 (16:03 +0200)
committerPetr Štetiar <ynezz@true.cz>
Mon, 15 May 2023 15:36:01 +0000 (17:36 +0200)
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
phase1/master.cfg

index 9f4a343df6dd9c03f5b01a79e8eddcafee9cdf6e..1064efc2a119e96c616a1a424fc7e4f7b68351f3 100644 (file)
@@ -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))