From fd10f3955e9296f6ffffa7b923548463cd225846 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 2 Dec 2016 22:44:18 +0100 Subject: [PATCH] phase2: adjust change filter Instead of hardcoding the master branch, filter incoming changes by the branch used for the corresponding feed. Signed-off-by: Jo-Philipp Wich --- phase2/master.cfg | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/phase2/master.cfg b/phase2/master.cfg index ddcca29..06e1b59 100644 --- a/phase2/master.cfg +++ b/phase2/master.cfg @@ -119,6 +119,7 @@ while True: # find feeds feeds = [] +feedbranches = dict() from buildbot.changes.gitpoller import GitPoller c['change_source'] = [] @@ -130,6 +131,7 @@ with open(home_dir+'/source.git/feeds.conf.default', 'r') as f: feeds.append(parts) url = parts[2].strip().split(';') branch = url[1] if len(url) > 1 else 'master' + feedbranches[url[0]] = branch c['change_source'].append(GitPoller(url[0], branch=branch, workdir='%s/%s.git' %(os.getcwd(), parts[1]), pollinterval=300)) @@ -138,13 +140,16 @@ with open(home_dir+'/source.git/feeds.conf.default', 'r') as f: # Configure the Schedulers, which decide how to react to incoming changes. In this # case, just kick off a 'basebuild' build +def branch_change_filter(change): + return change.branch == feedbranches[change.repository] + from buildbot.schedulers.basic import SingleBranchScheduler from buildbot.schedulers.forcesched import ForceScheduler from buildbot.changes import filter c['schedulers'] = [] c['schedulers'].append(SingleBranchScheduler( name="all", - change_filter=filter.ChangeFilter(branch='master'), + change_filter=filter.ChangeFilter(filter_fn=branch_change_filter), treeStableTimer=60, builderNames=archnames)) -- 2.30.2