aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGalina Kistanova <gkistanova@gmail.com>2019-10-18 05:51:12 +0000
committerGalina Kistanova <gkistanova@gmail.com>2019-10-18 05:51:12 +0000
commit4f59d7785d024c7b94aef51271cdea999b6a3cba (patch)
treec1cc58932efcca6459ad918d7f65e4a97cc10572
parentb28be6d784e44177a4959a3c85419a8bb0b1d74f (diff)
Separate automatic schedulers for builders depending on is_legacy_mode.
Changes from SVN should be scheduled for builders which checkout from SVN, changes from github should be scheduled for builders which checkout from github. For a transition period we need the both types of schedulers. Patch by Andrei Lebedev. Differential Revision: https://reviews.llvm.org/D69159 git-svn-id: https://llvm.org/svn/llvm-project/zorg/trunk@375204 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--buildbot/osuosl/master/config/schedulers.py41
1 files changed, 31 insertions, 10 deletions
diff --git a/buildbot/osuosl/master/config/schedulers.py b/buildbot/osuosl/master/config/schedulers.py
index 07b9b2eb..0bcae8b3 100644
--- a/buildbot/osuosl/master/config/schedulers.py
+++ b/buildbot/osuosl/master/config/schedulers.py
@@ -23,17 +23,40 @@ def getSingleBranchSchedulers(builders, schedulers, **kwargs):
}
builders_with_automatic_schedulers = []
+ legacy_builders_with_automatic_schedulers = []
for builder in builders:
# Only for the builders created with LLVMBuildFactory or similar.
if getattr(builder['factory'], 'depends_on_projects', None):
- # And only if this builder is in the legacy mode and
- # does not yet have an assigned scheduler.
- if getattr(builder['factory'], 'is_legacy_mode', True) and \
- builder['name'] not in builders_with_schedulers:
- # This builder is a candidate for an automatic scheduler.
+ if getattr(builder['factory'], 'is_legacy_mode', True):
+ # Only if this builder is in the legacy mode and
+ # does not yet have an assigned scheduler.
+ if builder['name'] not in builders_with_schedulers:
+ legacy_builders_with_automatic_schedulers.append(builder)
+ else:
+ # There are no manually assigned schedulers in this case.
builders_with_automatic_schedulers.append(builder)
automatic_schedulers = []
+ automatic_schedulers.extend(
+ _getSingleBranchAutomaticSchedulers(
+ builders_with_automatic_schedulers,
+ filter_branch='master', # git monorepo branch.
+ treeStableTimer=kwargs.get('treeStableTimer', 2*60)))
+ automatic_schedulers.extend(
+ _getSingleBranchAutomaticSchedulers(
+ legacy_builders_with_automatic_schedulers,
+ filter_branch='trunk', # svn repo branch.
+ treeStableTimer=kwargs.get('treeStableTimer', 2*60)))
+
+ return automatic_schedulers
+
+def _getSingleBranchAutomaticSchedulers(
+ builders_with_automatic_schedulers,
+ filter_branch,
+ treeStableTimer):
+
+ automatic_schedulers = []
+
# Do we have any to take care of?
if builders_with_automatic_schedulers:
# Let's reconsile first to get a unique set of dependencies.
@@ -43,8 +66,6 @@ def getSingleBranchSchedulers(builders, schedulers, **kwargs):
for b in builders_with_automatic_schedulers
])
- treeStableTimer = kwargs.get('treeStableTimer', 2*60)
- automatic_schedulers = []
for projects in set_of_dependencies:
sch_builders = [
b['name']
@@ -52,7 +73,7 @@ def getSingleBranchSchedulers(builders, schedulers, **kwargs):
if frozenset(getattr(b['factory'], 'depends_on_projects')) == projects
]
- automatic_scheduler_name = ",".join(sorted(projects))
+ automatic_scheduler_name = filter_branch + ":" + ",".join(sorted(projects))
projects_to_filter = getProjectsToFilter(projects)
automatic_schedulers.append(
@@ -60,13 +81,13 @@ def getSingleBranchSchedulers(builders, schedulers, **kwargs):
name=automatic_scheduler_name,
treeStableTimer=treeStableTimer,
builderNames=sch_builders,
- change_filter=ChangeFilter(project=projects_to_filter)
+ change_filter=ChangeFilter(project=projects_to_filter, branch=filter_branch)
)
)
log.msg(
"Generated SingleBranchScheduler: { name='%s'" % automatic_scheduler_name,
", builderNames=", sch_builders,
- ", change_filter=", projects_to_filter,
+ ", change_filter=", projects_to_filter, " (branch: %s)" % filter_branch,
"}")
return automatic_schedulers