[buildbot] phase2: adjust change filter

LEDE Commits lede-commits at lists.infradead.org
Fri Dec 2 14:08:16 PST 2016


jow pushed a commit to buildbot.git, branch master:
https://git.lede-project.org/fd10f3955e9296f6ffffa7b923548463cd225846

commit fd10f3955e9296f6ffffa7b923548463cd225846
Author: Jo-Philipp Wich <jo at mein.io>
AuthorDate: Fri Dec 2 22:44:18 2016 +0100

    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 <jo at mein.io>
---
 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))
 



More information about the lede-commits mailing list