From 6fa2ac2abfec22671f6d14e5dd6fc7e266596034 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thibaut=20VAR=C3=88NE?= Date: Mon, 24 Oct 2022 16:17:03 +0200 Subject: [PATCH] phase1: make populateTargets() 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 | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/phase1/master.cfg b/phase1/master.cfg index 1064efc..9453958 100644 --- a/phase1/master.cfg +++ b/phase1/master.cfg @@ -247,27 +247,29 @@ c['prioritizeBuilders'] = prioritizeBuilders branchNames = [branches[b]["name"] for b in branches] # find targets -targets = [ ] +targets = set() def populateTargets(): + log.msg("Populating targets, this will take time") sourcegit = work_dir + '/source.git' - if os.path.isdir(sourcegit): - subprocess.call(["rm", "-rf", sourcegit]) + for branch in branchNames: + if os.path.isdir(sourcegit): + subprocess.call(["rm", "-rf", sourcegit]) - subprocess.call(["git", "clone", "--depth=1", "--branch="+repo_branch, repo_url, sourcegit]) + subprocess.call(["git", "clone", "--depth=1", "--branch="+branch, repo_url, sourcegit]) - os.makedirs(sourcegit + '/tmp', exist_ok=True) - findtargets = subprocess.Popen(['./scripts/dump-target-info.pl', 'targets'], - stdout = subprocess.PIPE, stderr = subprocess.DEVNULL, cwd = sourcegit) + os.makedirs(sourcegit + '/tmp', exist_ok=True) + findtargets = subprocess.Popen(['./scripts/dump-target-info.pl', 'targets'], + stdout = subprocess.PIPE, stderr = subprocess.DEVNULL, cwd = sourcegit) - while True: - line = findtargets.stdout.readline() - if not line: - break - ta = line.decode().strip().split(' ') - targets.append(ta[0]) + while True: + line = findtargets.stdout.readline() + if not line: + break + ta = line.decode().strip().split(' ') + targets.add(ta[0]) - subprocess.call(["rm", "-rf", sourcegit]) + subprocess.call(["rm", "-rf", sourcegit]) populateTargets() @@ -332,7 +334,7 @@ c['schedulers'].append(SingleBranchScheduler( name = "all", change_filter = filter.ChangeFilter(branch=repo_branch), treeStableTimer = 60, - builderNames = targets)) + builderNames = list(targets))) c['schedulers'].append(ForceScheduler( name = "force", @@ -369,7 +371,7 @@ c['schedulers'].append(ForceScheduler( name = "target", label = "Build target", default = "all", - choices = [ "all" ] + targets + choices = set( "all" ) | targets ), TagChoiceParameter( name = "tag", -- 2.30.2