git cl try: omit triggered bots from cq.cfg default list

BUG=522909,565952

Review URL: https://codereview.chromium.org/1587893003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@298261 0039d316-1c4b-4281-b951-d872f2087c98
parent 54b400c8
......@@ -105,7 +105,8 @@ def set_commit(obj, issue, flag):
_apply_on_issue(_set_commit, obj, issue)
def get_master_builder_map(config_path):
def get_master_builder_map(
config_path, include_experimental=True, include_triggered=True):
"""Returns a map of master -> [builders] from cq config."""
with open(config_path) as config_file:
cq_config = config_file.read()
......@@ -117,8 +118,13 @@ def get_master_builder_map(config_path):
for bucket in config.verifiers.try_job.buckets:
masters.setdefault(bucket.name, [])
for builder in bucket.builders:
if not builder.HasField('experiment_percentage'):
masters[bucket.name].append(builder.name)
if (not include_experimental and
builder.HasField('experiment_percentage')):
continue
if (not include_triggered and
builder.HasField('triggered_by')):
continue
masters[bucket.name].append(builder.name)
return masters
......
......@@ -3237,7 +3237,8 @@ def CMDtry(parser, args):
'infra', 'config', 'cq.cfg')
if os.path.exists(cq_cfg):
masters = {}
cq_masters = commit_queue.get_master_builder_map(cq_cfg)
cq_masters = commit_queue.get_master_builder_map(
cq_cfg, include_experimental=False, include_triggered=False)
for master, builders in cq_masters.iteritems():
for builder in builders:
# Skip presubmit builders, because these will fail without LGTM.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment