Skip to content

Commit

Permalink
phase2: support multiple branch in parse_feed_entry and SingleBranchS…
Browse files Browse the repository at this point in the history
…cheduler

Add support for multiple branch in parse_feed_entry and
SingleBranchScheduler.

- Moving to GitPoller branches
- Change feedbranches to define an array of branches
- Update the filter_fn to check multiple entry in feedbranches

Signed-off-by: Christian Marangi <[email protected]>
  • Loading branch information
Ansuel committed Nov 5, 2024
1 parent d014e42 commit 115c39f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions phase2/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ def parse_feed_entry(line):
if parts[0].startswith("src-git"):
feeds.append(parts)
url = parts[2].strip().split(';')
branch = url[1] if len(url) > 1 else 'main'
feedbranches[url[0]] = branch
c['change_source'].append(GitPoller(url[0], branch=branch, workdir='%s/%s.git' %(os.getcwd(), parts[1]), pollInterval=300))
branches = [url[1]] if len(url) > 1 else ['main', 'master']
feedbranches[url[0]] = branches
c['change_source'].append(GitPoller(url[0], branches=branches, workdir='%s/%s.git' %(os.getcwd(), parts[1]), pollInterval=300))

make = subprocess.Popen(['make', '--no-print-directory', '-C', work_dir+'/source.git/target/sdk/', 'val.BASE_FEED'],
env = dict(os.environ, TOPDIR=work_dir+'/source.git'), stdout = subprocess.PIPE)
Expand All @@ -205,7 +205,7 @@ c['schedulers'] = []
c['schedulers'].append(SingleBranchScheduler(
name = "all",
change_filter = filter.ChangeFilter(
filter_fn = lambda change: change.branch == feedbranches[change.repository]
filter_fn = lambda change: change.branch in feedbranches[change.repository]
),
treeStableTimer = 60,
builderNames = archnames))
Expand Down

0 comments on commit 115c39f

Please sign in to comment.