Skip to content

Commit

Permalink
Revert of Use script in depot_tools to retrieve builders from new cq.…
Browse files Browse the repository at this point in the history
…cfg (patchset chromium#10 id:180001 of https://codereview.chromium.org/1152823005/)

Reason for revert:
Speculative, looks like this broke `git cl try` for me (crbug.com/495219)

Original issue's description:
> Use script in depot_tools to retrieve builders from new cq.cfg
>
> R=pgervais@chromium.org
> TEST=ran git-cl-try on this CL
>
> Committed: https://crrev.com/87e80c7a628381644013e3b96b437276d9b19bcd
> Cr-Commit-Position: refs/heads/master@{#332200}

TBR=jochen@chromium.org,brettw@chromium.org,cpu@chromium.org,jam@chromium.org,pgervais@chromium.org,sergiyb@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

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

Cr-Commit-Position: refs/heads/master@{#332232}
  • Loading branch information
nico authored and Commit bot committed Jun 1, 2015
1 parent dcdece3 commit 4090c5c
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 24 deletions.
49 changes: 25 additions & 24 deletions PRESUBMIT.py
Original file line number Diff line number Diff line change
Expand Up @@ -1784,28 +1784,29 @@ def CheckChangeOnCommit(input_api, output_api):


def GetPreferredTryMasters(project, change):
import json
import os.path
import subprocess

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.
masters = json.loads(subprocess.check_output(
['commit_queue', 'builders', cq_config_path], shell=True))

# 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]
import re
files = change.LocalPaths()

return masters
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', {})

for master, master_config in cq_try_jobs.get('triggered', {}).iteritems():
for triggered_bot in master_config:
builders.get(master, {}).pop(triggered_bot, None)

# 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)

return builders
7 changes: 7 additions & 0 deletions testing/commit_queue/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This is needed because of * in testing/OWNERS .
set noparent

phajdan.jr@chromium.org
sergeyberezin@chromium.org
sergiyb@chromium.org
sheyang@chromium.org
102 changes: 102 additions & 0 deletions testing/commit_queue/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
"_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"
]
}
}
}
}
}

0 comments on commit 4090c5c

Please sign in to comment.