0

Re-land: Use script in depot_tools to retrieve builders from new cq.cfg

This was already landed twice before:
 - https://codereview.chromium.org/1152823005/
 - https://codereview.chromium.org/1148303006/

This CL is idential to the previous one, but a fix was landed to depot_tools:
 - https://codereview.chromium.org/1162993005/

TBR=phajdan.jr@chromium.org, jochen@chromium.org
TEST=ran git-cl-try on this CL on Win, Mac and Linux and also tested with devs
     for which it failed last time

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

Cr-Commit-Position: refs/heads/master@{#332654}
This commit is contained in:
sergiyb
2015-06-03 11:44:00 -07:00
committed by Commit bot
parent 385a4faa97
commit 57a71e3b29
3 changed files with 23 additions and 131 deletions
PRESUBMIT.py
testing/commit_queue

@ -1788,29 +1788,30 @@ def CheckChangeOnCommit(input_api, output_api):
def GetPreferredTryMasters(project, change):
import re
files = change.LocalPaths()
import os
import json
with open(os.path.join(
change.RepositoryRoot(), 'testing', 'commit_queue', 'config.json')) as f:
cq_config = json.load(f)
cq_verifiers = cq_config.get('verifiers_no_patch', {})
cq_try_jobs = cq_verifiers.get('try_job_verifier', {})
builders = cq_try_jobs.get('launched', {})
import os.path
import platform
import subprocess
for master, master_config in cq_try_jobs.get('triggered', {}).iteritems():
for triggered_bot in master_config:
builders.get(master, {}).pop(triggered_bot, None)
cq_config_path = os.path.join(
change.RepositoryRoot(), 'infra', 'config', 'cq.cfg')
# commit_queue.py below is a script in depot_tools directory, which has a
# 'builders' command to retrieve a list of CQ builders from the CQ config.
is_win = platform.system() == 'Windows'
masters = json.loads(subprocess.check_output(
['commit_queue', 'builders', cq_config_path], shell=is_win))
# Explicitly iterate over copies of dicts since we mutate them.
for master in builders.keys():
for builder in builders[master].keys():
# Do not trigger presubmit builders, since they're likely to fail
# (e.g. OWNERS checks before finished code review), and we're
# running local presubmit anyway.
if 'presubmit' in builder:
builders[master].pop(builder)
# Explicitly iterate over copies of keys since we mutate them.
for master in masters.keys():
for builder in masters[master].keys():
# Do not trigger presubmit builders, since they're likely to fail
# (e.g. OWNERS checks before finished code review), and we're
# running local presubmit anyway.
if 'presubmit' in builder:
masters[master].pop(builder)
else:
# Convert testfilter format to the one expected by git-cl-try.
testfilter = masters[master][builder].get('testfilter', 'defaulttests')
masters[master][builder] = [testfilter]
return builders
return masters

@ -1,7 +0,0 @@
# This is needed because of * in testing/OWNERS .
set noparent
phajdan.jr@chromium.org
sergeyberezin@chromium.org
sergiyb@chromium.org
sheyang@chromium.org

@ -1,102 +0,0 @@
{
"_comment1": "This file is no longer used by CQ. Instead CQ reads",
"_comment2": "infra/config/cq.cfg. However, this file is still used by",
"_comment3": "git-cl-try and thus this list must be manually kept in sync",
"_comment4": "to the list of builders in infra/config/cq.cfg. We apologize",
"_comment5": "for the incovenience and are working on a fix that will make",
"_comment6": "git-cl-try also read infra/config/cq.cfg.",
"verifiers_no_patch": {
"try_job_verifier": {
"launched": {
"tryserver.chromium.linux": {
"android_arm64_dbg_recipe": [
"defaulttests"
],
"android_chromium_gn_compile_dbg": [
"defaulttests"
],
"android_chromium_gn_compile_rel": [
"defaulttests"
],
"android_clang_dbg_recipe": [
"defaulttests"
],
"android_compile_dbg": [
"defaulttests"
],
"cast_shell_android": [
"defaulttests"
],
"cast_shell_linux": [
"defaulttests"
],
"chromium_presubmit": [
"defaulttests"
],
"linux_android_rel_ng": [
"defaulttests"
],
"linux_chromium_asan_rel_ng": [
"defaulttests"
],
"linux_chromium_chromeos_compile_dbg_ng": [
"defaulttests"
],
"linux_chromium_chromeos_ozone_rel_ng": [
"defaulttests"
],
"linux_chromium_chromeos_rel_ng": [
"defaulttests"
],
"linux_chromium_clobber_rel_ng": [
"defaulttests"
],
"linux_chromium_compile_dbg_32_ng": [
"compile"
],
"linux_chromium_gn_chromeos_rel": [
"defaulttests"
],
"linux_chromium_gn_dbg": [
"defaulttests"
],
"linux_chromium_gn_rel": [
"defaulttests"
],
"linux_chromium_rel_ng": [
"defaulttests"
]
},
"tryserver.chromium.mac": {
"ios_dbg_simulator_ninja": [
"defaulttests"
],
"ios_rel_device_ninja": [
"defaulttests"
],
"mac_chromium_compile_dbg_ng": [
"defaulttests"
],
"mac_chromium_rel_ng": [
"defaulttests"
]
},
"tryserver.chromium.win": {
"win8_chromium_rel": [
"defaulttests"
],
"win_chromium_compile_dbg_ng": [
"defaulttests"
],
"win_chromium_rel_ng": [
"defaulttests"
],
"win_chromium_x64_rel_ng": [
"defaulttests"
]
}
}
}
}
}