Revert of depot_tools: import bot_update gclient git rietveld tryserver recipe modules (patchset #6 id:100001 of https://codereview.chromium.org/1642023002/ )

Reason for revert:
breakages: https://code.google.com/p/chromium/issues/detail?id=582229

Original issue's description:
> depot_tools: import bot_update gclient git rietveld tryserver recipe modules
> 
> BUG=582074
> 
> Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=298447

TBR=maruel@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=582074, 582229

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@298457 0039d316-1c4b-4281-b951-d872f2087c98
changes/01/332501/1
phajdan.jr@chromium.org 9 years ago
parent 1019fe79f3
commit f77c42a6a3

@ -1,12 +0,0 @@
DEPS = [
'gclient',
'recipe_engine/json',
'recipe_engine/path',
'recipe_engine/platform',
'recipe_engine/properties',
'recipe_engine/python',
'recipe_engine/raw_io',
'rietveld',
'recipe_engine/step',
'tryserver',
]

@ -1,276 +0,0 @@
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Recipe module to ensure a checkout is consistant on a bot."""
from recipe_engine import recipe_api
# This is just for testing, to indicate if a master is using a Git scheduler
# or not.
SVN_MASTERS = (
'experimental.svn',
)
def jsonish_to_python(spec, is_top=False):
"""Turn a json spec into a python parsable object.
This exists because Gclient specs, while resembling json, is actually
ingested using a python "eval()". Therefore a bit of plumming is required
to turn our newly constructed Gclient spec into a gclient-readable spec.
"""
ret = ''
if is_top: # We're the 'top' level, so treat this dict as a suite.
ret = '\n'.join(
'%s = %s' % (k, jsonish_to_python(spec[k])) for k in sorted(spec)
)
else:
if isinstance(spec, dict):
ret += '{'
ret += ', '.join(
"%s: %s" % (repr(str(k)), jsonish_to_python(spec[k]))
for k in sorted(spec)
)
ret += '}'
elif isinstance(spec, list):
ret += '['
ret += ', '.join(jsonish_to_python(x) for x in spec)
ret += ']'
elif isinstance(spec, basestring):
ret = repr(str(spec))
else:
ret = repr(spec)
return ret
class BotUpdateApi(recipe_api.RecipeApi):
def __init__(self, *args, **kwargs):
self._properties = {}
super(BotUpdateApi, self).__init__(*args, **kwargs)
def __call__(self, name, cmd, **kwargs):
"""Wrapper for easy calling of bot_update."""
assert isinstance(cmd, (list, tuple))
bot_update_path = self.resource('bot_update.py')
kwargs.setdefault('infra_step', True)
return self.m.python(name, bot_update_path, cmd, **kwargs)
@property
def properties(self):
return self._properties
def ensure_checkout(self, gclient_config=None, suffix=None,
patch=True, update_presentation=True,
force=False, patch_root=None, no_shallow=False,
with_branch_heads=False, refs=None,
patch_project_roots=None, patch_oauth2=False,
output_manifest=True, clobber=False,
root_solution_revision=None, **kwargs):
refs = refs or []
# We can re-use the gclient spec from the gclient module, since all the
# data bot_update needs is already configured into the gclient spec.
cfg = gclient_config or self.m.gclient.c
spec_string = jsonish_to_python(cfg.as_jsonish(), True)
# Used by bot_update to determine if we want to run or not.
master = self.m.properties['mastername']
builder = self.m.properties['buildername']
slave = self.m.properties['slavename']
# Construct our bot_update command. This basically be inclusive of
# everything required for bot_update to know:
root = patch_root
if root is None:
root = cfg.solutions[0].name
additional = self.m.rietveld.calculate_issue_root(patch_project_roots)
if additional:
root = self.m.path.join(root, additional)
if patch:
issue = self.m.properties.get('issue')
patchset = self.m.properties.get('patchset')
patch_url = self.m.properties.get('patch_url')
gerrit_repo = self.m.properties.get('repository')
gerrit_ref = self.m.properties.get('event.patchSet.ref')
else:
# The trybot recipe sometimes wants to de-apply the patch. In which case
# we pretend the issue/patchset/patch_url never existed.
issue = patchset = patch_url = email_file = key_file = None
gerrit_repo = gerrit_ref = None
# Issue and patchset must come together.
if issue:
assert patchset
if patchset:
assert issue
if patch_url:
# If patch_url is present, bot_update will actually ignore issue/ps.
issue = patchset = None
# The gerrit_ref and gerrit_repo must be together or not at all. If one is
# missing, clear both of them.
if not gerrit_ref or not gerrit_repo:
gerrit_repo = gerrit_ref = None
assert (gerrit_ref != None) == (gerrit_repo != None)
# Point to the oauth2 auth files if specified.
# These paths are where the bots put their credential files.
if patch_oauth2:
email_file = self.m.path['build'].join(
'site_config', '.rietveld_client_email')
key_file = self.m.path['build'].join(
'site_config', '.rietveld_secret_key')
else:
email_file = key_file = None
rev_map = {}
if self.m.gclient.c:
rev_map = self.m.gclient.c.got_revision_mapping.as_jsonish()
flags = [
# 1. Do we want to run? (master/builder/slave).
['--master', master],
['--builder', builder],
['--slave', slave],
# 2. What do we want to check out (spec/root/rev/rev_map).
['--spec', spec_string],
['--root', root],
['--revision_mapping_file', self.m.json.input(rev_map)],
# 3. How to find the patch, if any (issue/patchset/patch_url).
['--issue', issue],
['--patchset', patchset],
['--patch_url', patch_url],
['--rietveld_server', self.m.properties.get('rietveld')],
['--gerrit_repo', gerrit_repo],
['--gerrit_ref', gerrit_ref],
['--apply_issue_email_file', email_file],
['--apply_issue_key_file', key_file],
# 4. Hookups to JSON output back into recipes.
['--output_json', self.m.json.output()],]
# Collect all fixed revisions to simulate them in the json output.
# Fixed revision are the explicit input revisions of bot_update.py, i.e.
# every command line parameter "--revision name@value".
fixed_revisions = {}
revisions = {}
for solution in cfg.solutions:
if solution.revision:
revisions[solution.name] = solution.revision
elif solution == cfg.solutions[0]:
revisions[solution.name] = (
self.m.properties.get('parent_got_revision') or
self.m.properties.get('revision') or
'HEAD')
if self.m.gclient.c and self.m.gclient.c.revisions:
revisions.update(self.m.gclient.c.revisions)
if cfg.solutions and root_solution_revision:
revisions[cfg.solutions[0].name] = root_solution_revision
# Allow for overrides required to bisect into rolls.
revisions.update(self.m.properties.get('deps_revision_overrides', {}))
for name, revision in sorted(revisions.items()):
fixed_revision = self.m.gclient.resolve_revision(revision)
if fixed_revision:
fixed_revisions[name] = fixed_revision
flags.append(['--revision', '%s@%s' % (name, fixed_revision)])
# Add extra fetch refspecs.
for ref in refs:
flags.append(['--refs', ref])
# Filter out flags that are None.
cmd = [item for flag_set in flags
for item in flag_set if flag_set[1] is not None]
if clobber:
cmd.append('--clobber')
if force:
cmd.append('--force')
if no_shallow:
cmd.append('--no_shallow')
if output_manifest:
cmd.append('--output_manifest')
if with_branch_heads or cfg.with_branch_heads:
cmd.append('--with_branch_heads')
# Inject Json output for testing.
git_mode = self.m.properties.get('mastername') not in SVN_MASTERS
first_sln = cfg.solutions[0].name
step_test_data = lambda: self.test_api.output_json(
master, builder, slave, root, first_sln, rev_map, git_mode, force,
self.m.properties.get('fail_patch', False),
output_manifest=output_manifest, fixed_revisions=fixed_revisions)
# Add suffixes to the step name, if specified.
name = 'bot_update'
if not patch:
name += ' (without patch)'
if suffix:
name += ' - %s' % suffix
# Ah hah! Now that everything is in place, lets run bot_update!
try:
# 87 and 88 are the 'patch failure' codes for patch download and patch
# apply, respectively. We don't actually use the error codes, and instead
# rely on emitted json to determine cause of failure.
self(name, cmd, step_test_data=step_test_data,
ok_ret=(0, 87, 88), **kwargs)
finally:
step_result = self.m.step.active_result
self._properties = step_result.json.output.get('properties', {})
if update_presentation:
# Set properties such as got_revision.
for prop_name, prop_value in self.properties.iteritems():
step_result.presentation.properties[prop_name] = prop_value
# Add helpful step description in the step UI.
if 'step_text' in step_result.json.output:
step_text = step_result.json.output['step_text']
step_result.presentation.step_text = step_text
# Add log line output.
if 'log_lines' in step_result.json.output:
for log_name, log_lines in step_result.json.output['log_lines']:
step_result.presentation.logs[log_name] = log_lines.splitlines()
# Set the "checkout" path for the main solution.
# This is used by the Chromium module to figure out where to look for
# the checkout.
# If there is a patch failure, emit another step that said things failed.
if step_result.json.output.get('patch_failure'):
return_code = step_result.json.output.get('patch_apply_return_code')
if return_code == 3:
# This is download failure, hence an infra failure.
# Sadly, python.failing_step doesn't support kwargs.
self.m.python.inline(
'Patch failure',
('import sys;'
'print "Patch download failed. See bot_update step for details";'
'sys.exit(1)'),
infra_step=True,
step_test_data=lambda: self.m.raw_io.test_api.output(
'Patch download failed. See bot_update step for details',
retcode=1)
)
else:
# This is actual patch failure.
self.m.tryserver.set_patch_failure_tryjob_result()
self.m.python.failing_step(
'Patch failure', 'Check the bot_update step for details')
# bot_update actually just sets root to be the folder name of the
# first solution.
if step_result.json.output['did_run']:
co_root = step_result.json.output['root']
cwd = kwargs.get('cwd', self.m.path['slave_build'])
if 'checkout' not in self.m.path:
self.m.path['checkout'] = cwd.join(*co_root.split(self.m.path.sep))
return step_result

@ -1,52 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[bot_update]/resources/bot_update.py",
"--master",
"chromium.linux",
"--builder",
"Linux Builder",
"--slave",
"totallyaslave-m1",
"--spec",
"cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]",
"--root",
"src",
"--revision_mapping_file",
"{\"src\": \"got_cr_revision\"}",
"--output_json",
"/path/to/tmp/json",
"--revision",
"src@abc"
],
"cwd": "[SLAVE_BUILD]",
"name": "bot_update (without patch)",
"~followup_annotations": [
"@@@STEP_TEXT@Some step text@@@",
"@@@STEP_LOG_LINE@json.output@{@@@",
"@@@STEP_LOG_LINE@json.output@ \"did_run\": true, @@@",
"@@@STEP_LOG_LINE@json.output@ \"fixed_revisions\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"src\": \"abc\"@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_failure\": false, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_root\": \"src\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"properties\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"got_cr_revision\": \"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"got_cr_revision_cp\": \"refs/heads/master@{#170242}\"@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"root\": \"src\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"step_text\": \"Some step text\"@@@",
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@SET_BUILD_PROPERTY@got_cr_revision@\"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\"@@@",
"@@@SET_BUILD_PROPERTY@got_cr_revision_cp@\"refs/heads/master@{#170242}\"@@@"
]
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

@ -1,59 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[bot_update]/resources/bot_update.py",
"--master",
"chromium.linux",
"--builder",
"Linux Builder",
"--slave",
"totallyaslave-m1",
"--spec",
"cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]",
"--root",
"src",
"--revision_mapping_file",
"{\"src\": \"got_cr_revision\"}",
"--output_json",
"/path/to/tmp/json",
"--revision",
"src@HEAD",
"--output_manifest"
],
"cwd": "[SLAVE_BUILD]",
"name": "bot_update",
"~followup_annotations": [
"@@@STEP_TEXT@Some step text@@@",
"@@@STEP_LOG_LINE@json.output@{@@@",
"@@@STEP_LOG_LINE@json.output@ \"did_run\": true, @@@",
"@@@STEP_LOG_LINE@json.output@ \"fixed_revisions\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"src\": \"HEAD\"@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"manifest\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"src\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"repository\": \"https://fake.org/src.git\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"revision\": \"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\"@@@",
"@@@STEP_LOG_LINE@json.output@ }@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_failure\": false, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_root\": \"src\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"properties\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"got_cr_revision\": \"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"got_cr_revision_cp\": \"refs/heads/master@{#170242}\"@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"root\": \"src\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"step_text\": \"Some step text\"@@@",
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@SET_BUILD_PROPERTY@got_cr_revision@\"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\"@@@",
"@@@SET_BUILD_PROPERTY@got_cr_revision_cp@\"refs/heads/master@{#170242}\"@@@"
]
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

@ -1,53 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[bot_update]/resources/bot_update.py",
"--master",
"chromium.linux",
"--builder",
"Linux Builder",
"--slave",
"totallyaslave-m1",
"--spec",
"cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]",
"--root",
"src",
"--revision_mapping_file",
"{\"src\": \"got_cr_revision\"}",
"--output_json",
"/path/to/tmp/json",
"--revision",
"src@HEAD",
"--with_branch_heads"
],
"cwd": "[SLAVE_BUILD]",
"name": "bot_update - with branch heads",
"~followup_annotations": [
"@@@STEP_TEXT@Some step text@@@",
"@@@STEP_LOG_LINE@json.output@{@@@",
"@@@STEP_LOG_LINE@json.output@ \"did_run\": true, @@@",
"@@@STEP_LOG_LINE@json.output@ \"fixed_revisions\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"src\": \"HEAD\"@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_failure\": false, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_root\": \"src\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"properties\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"got_cr_revision\": \"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"got_cr_revision_cp\": \"refs/heads/master@{#170242}\"@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"root\": \"src\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"step_text\": \"Some step text\"@@@",
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@SET_BUILD_PROPERTY@got_cr_revision@\"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\"@@@",
"@@@SET_BUILD_PROPERTY@got_cr_revision_cp@\"refs/heads/master@{#170242}\"@@@"
]
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

@ -1,40 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[bot_update]/resources/bot_update.py",
"--master",
"experimental",
"--builder",
"Experimental Builder",
"--slave",
"somehost",
"--spec",
"cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]",
"--root",
"src",
"--revision_mapping_file",
"{\"src\": \"got_cr_revision\"}",
"--output_json",
"/path/to/tmp/json",
"--revision",
"src@HEAD",
"--clobber"
],
"cwd": "[SLAVE_BUILD]",
"name": "bot_update",
"~followup_annotations": [
"@@@STEP_LOG_LINE@json.output@{@@@",
"@@@STEP_LOG_LINE@json.output@ \"did_run\": false, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_failure\": false@@@",
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@"
]
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

@ -1,53 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[bot_update]/resources/bot_update.py",
"--master",
"experimental",
"--builder",
"Experimental Builder",
"--slave",
"somehost",
"--spec",
"cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]",
"--root",
"src",
"--revision_mapping_file",
"{\"src\": \"got_cr_revision\"}",
"--output_json",
"/path/to/tmp/json",
"--revision",
"src@HEAD",
"--force"
],
"cwd": "[SLAVE_BUILD]",
"name": "bot_update",
"~followup_annotations": [
"@@@STEP_TEXT@Some step text@@@",
"@@@STEP_LOG_LINE@json.output@{@@@",
"@@@STEP_LOG_LINE@json.output@ \"did_run\": true, @@@",
"@@@STEP_LOG_LINE@json.output@ \"fixed_revisions\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"src\": \"HEAD\"@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_failure\": false, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_root\": \"src\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"properties\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"got_cr_revision\": \"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"got_cr_revision_cp\": \"refs/heads/master@{#170242}\"@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"root\": \"src\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"step_text\": \"Some step text\"@@@",
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@SET_BUILD_PROPERTY@got_cr_revision@\"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\"@@@",
"@@@SET_BUILD_PROPERTY@got_cr_revision_cp@\"refs/heads/master@{#170242}\"@@@"
]
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

@ -1,40 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[bot_update]/resources/bot_update.py",
"--master",
"experimental",
"--builder",
"Experimental Builder",
"--slave",
"somehost",
"--spec",
"cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]",
"--root",
"src",
"--revision_mapping_file",
"{\"src\": \"got_cr_revision\"}",
"--output_json",
"/path/to/tmp/json",
"--revision",
"src@HEAD",
"--no_shallow"
],
"cwd": "[SLAVE_BUILD]",
"name": "bot_update",
"~followup_annotations": [
"@@@STEP_LOG_LINE@json.output@{@@@",
"@@@STEP_LOG_LINE@json.output@ \"did_run\": false, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_failure\": false@@@",
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@"
]
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

@ -1,39 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[bot_update]/resources/bot_update.py",
"--master",
"experimental",
"--builder",
"Experimental Builder",
"--slave",
"somehost",
"--spec",
"cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]",
"--root",
"src",
"--revision_mapping_file",
"{\"src\": \"got_cr_revision\"}",
"--output_json",
"/path/to/tmp/json",
"--revision",
"src@HEAD"
],
"cwd": "[SLAVE_BUILD]",
"name": "bot_update",
"~followup_annotations": [
"@@@STEP_LOG_LINE@json.output@{@@@",
"@@@STEP_LOG_LINE@json.output@ \"did_run\": false, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_failure\": false@@@",
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@"
]
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

@ -1,39 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[bot_update]/resources/bot_update.py",
"--master",
"experimental",
"--builder",
"Experimental Builder",
"--slave",
"somehost",
"--spec",
"cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]",
"--root",
"src",
"--revision_mapping_file",
"{\"src\": \"got_cr_revision\"}",
"--output_json",
"/path/to/tmp/json",
"--revision",
"src@revision"
],
"cwd": "[SLAVE_BUILD]",
"name": "bot_update",
"~followup_annotations": [
"@@@STEP_LOG_LINE@json.output@{@@@",
"@@@STEP_LOG_LINE@json.output@ \"did_run\": false, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_failure\": false@@@",
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@"
]
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

@ -1,55 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[bot_update]/resources/bot_update.py",
"--master",
"experimental.svn",
"--builder",
"Experimental SVN Builder",
"--slave",
"somehost",
"--spec",
"cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]",
"--root",
"src",
"--revision_mapping_file",
"{\"src\": \"got_cr_revision\"}",
"--output_json",
"/path/to/tmp/json",
"--revision",
"src@HEAD",
"--force"
],
"cwd": "[SLAVE_BUILD]",
"name": "bot_update",
"~followup_annotations": [
"@@@STEP_TEXT@Some step text@@@",
"@@@STEP_LOG_LINE@json.output@{@@@",
"@@@STEP_LOG_LINE@json.output@ \"did_run\": true, @@@",
"@@@STEP_LOG_LINE@json.output@ \"fixed_revisions\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"src\": \"HEAD\"@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_failure\": false, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_root\": \"src\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"properties\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"got_cr_revision\": 170242, @@@",
"@@@STEP_LOG_LINE@json.output@ \"got_cr_revision_cp\": \"refs/heads/master@{#170242}\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"got_cr_revision_git\": \"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\"@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"root\": \"src\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"step_text\": \"Some step text\"@@@",
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@SET_BUILD_PROPERTY@got_cr_revision@170242@@@",
"@@@SET_BUILD_PROPERTY@got_cr_revision_git@\"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\"@@@",
"@@@SET_BUILD_PROPERTY@got_cr_revision_cp@\"refs/heads/master@{#170242}\"@@@"
]
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

@ -1,54 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[bot_update]/resources/bot_update.py",
"--master",
"tryserver.chromium.linux",
"--builder",
"linux_rel",
"--slave",
"totallyaslave-c4",
"--spec",
"cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]",
"--root",
"src",
"--revision_mapping_file",
"{\"src\": \"got_cr_revision\"}",
"--output_json",
"/path/to/tmp/json",
"--revision",
"src@HEAD",
"--refs",
"+refs/change/1/2/333"
],
"cwd": "[SLAVE_BUILD]",
"name": "bot_update",
"~followup_annotations": [
"@@@STEP_TEXT@Some step text@@@",
"@@@STEP_LOG_LINE@json.output@{@@@",
"@@@STEP_LOG_LINE@json.output@ \"did_run\": true, @@@",
"@@@STEP_LOG_LINE@json.output@ \"fixed_revisions\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"src\": \"HEAD\"@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_failure\": false, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_root\": \"src\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"properties\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"got_cr_revision\": \"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"got_cr_revision_cp\": \"refs/heads/master@{#170242}\"@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"root\": \"src\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"step_text\": \"Some step text\"@@@",
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@SET_BUILD_PROPERTY@got_cr_revision@\"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\"@@@",
"@@@SET_BUILD_PROPERTY@got_cr_revision_cp@\"refs/heads/master@{#170242}\"@@@"
]
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

@ -1,56 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[bot_update]/resources/bot_update.py",
"--master",
"tryserver.chromium.linux",
"--builder",
"linux_rel",
"--slave",
"totallyaslave-c4",
"--spec",
"cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]",
"--root",
"src",
"--revision_mapping_file",
"{\"src\": \"got_cr_revision\"}",
"--apply_issue_email_file",
"[BUILD]/site_config/.rietveld_client_email",
"--apply_issue_key_file",
"[BUILD]/site_config/.rietveld_secret_key",
"--output_json",
"/path/to/tmp/json",
"--revision",
"src@HEAD"
],
"cwd": "[SLAVE_BUILD]",
"name": "bot_update",
"~followup_annotations": [
"@@@STEP_TEXT@Some step text@@@",
"@@@STEP_LOG_LINE@json.output@{@@@",
"@@@STEP_LOG_LINE@json.output@ \"did_run\": true, @@@",
"@@@STEP_LOG_LINE@json.output@ \"fixed_revisions\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"src\": \"HEAD\"@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_failure\": false, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_root\": \"src\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"properties\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"got_cr_revision\": \"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"got_cr_revision_cp\": \"refs/heads/master@{#170242}\"@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"root\": \"src\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"step_text\": \"Some step text\"@@@",
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@SET_BUILD_PROPERTY@got_cr_revision@\"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\"@@@",
"@@@SET_BUILD_PROPERTY@got_cr_revision_cp@\"refs/heads/master@{#170242}\"@@@"
]
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

@ -1,54 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[bot_update]/resources/bot_update.py",
"--master",
"tryserver.chromium.linux",
"--builder",
"linux_rel",
"--slave",
"totallyaslave-c4",
"--spec",
"cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]",
"--root",
"src",
"--revision_mapping_file",
"{\"src\": \"got_cr_revision\"}",
"--patch_url",
"http://src.chromium.org/foo/bar",
"--output_json",
"/path/to/tmp/json",
"--revision",
"src@HEAD"
],
"cwd": "[SLAVE_BUILD]",
"name": "bot_update",
"~followup_annotations": [
"@@@STEP_TEXT@Some step text@@@",
"@@@STEP_LOG_LINE@json.output@{@@@",
"@@@STEP_LOG_LINE@json.output@ \"did_run\": true, @@@",
"@@@STEP_LOG_LINE@json.output@ \"fixed_revisions\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"src\": \"HEAD\"@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_failure\": false, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_root\": \"src\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"properties\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"got_cr_revision\": \"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"got_cr_revision_cp\": \"refs/heads/master@{#170242}\"@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"root\": \"src\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"step_text\": \"Some step text\"@@@",
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@SET_BUILD_PROPERTY@got_cr_revision@\"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\"@@@",
"@@@SET_BUILD_PROPERTY@got_cr_revision_cp@\"refs/heads/master@{#170242}\"@@@"
]
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

@ -1,56 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[bot_update]/resources/bot_update.py",
"--master",
"tryserver.chromium.linux",
"--builder",
"linux_rel",
"--slave",
"totallyaslave-c4",
"--spec",
"cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]",
"--root",
"src",
"--revision_mapping_file",
"{\"src\": \"got_cr_revision\"}",
"--patch_url",
"http://src.chromium.org/foo/bar",
"--output_json",
"/path/to/tmp/json",
"--revision",
"src@HEAD"
],
"cwd": "[SLAVE_BUILD]",
"name": "bot_update",
"~followup_annotations": [
"step returned non-zero exit code: 1",
"@@@STEP_TEXT@Some step text@@@",
"@@@STEP_LOG_LINE@json.output@{@@@",
"@@@STEP_LOG_LINE@json.output@ \"did_run\": true, @@@",
"@@@STEP_LOG_LINE@json.output@ \"fixed_revisions\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"src\": \"HEAD\"@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_failure\": false, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_root\": \"src\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"properties\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"got_cr_revision\": \"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"got_cr_revision_cp\": \"refs/heads/master@{#170242}\"@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"root\": \"src\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"step_text\": \"Some step text\"@@@",
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@STEP_EXCEPTION@@@",
"@@@SET_BUILD_PROPERTY@got_cr_revision@\"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\"@@@",
"@@@SET_BUILD_PROPERTY@got_cr_revision_cp@\"refs/heads/master@{#170242}\"@@@"
]
},
{
"name": "$result",
"reason": "Infra Failure: Step('bot_update') returned 1",
"status_code": 1
}
]

@ -1,78 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[bot_update]/resources/bot_update.py",
"--master",
"tryserver.chromium.linux",
"--builder",
"linux_rel",
"--slave",
"totallyaslave-c4",
"--spec",
"cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]",
"--root",
"src",
"--revision_mapping_file",
"{\"src\": \"got_cr_revision\"}",
"--patch_url",
"http://src.chromium.org/foo/bar",
"--output_json",
"/path/to/tmp/json",
"--revision",
"src@HEAD"
],
"cwd": "[SLAVE_BUILD]",
"name": "bot_update",
"~followup_annotations": [
"@@@STEP_TEXT@Some step text@@@",
"@@@STEP_LOG_LINE@json.output@{@@@",
"@@@STEP_LOG_LINE@json.output@ \"did_run\": true, @@@",
"@@@STEP_LOG_LINE@json.output@ \"fixed_revisions\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"src\": \"HEAD\"@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"log_lines\": [@@@",
"@@@STEP_LOG_LINE@json.output@ [@@@",
"@@@STEP_LOG_LINE@json.output@ \"patch error\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"Patch failed to apply\"@@@",
"@@@STEP_LOG_LINE@json.output@ ]@@@",
"@@@STEP_LOG_LINE@json.output@ ], @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_apply_return_code\": 1, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_failure\": true, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_root\": \"src\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"properties\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"got_cr_revision\": \"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"got_cr_revision_cp\": \"refs/heads/master@{#170242}\"@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"root\": \"src\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"step_text\": \"Some step text\"@@@",
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@STEP_LOG_LINE@patch error@Patch failed to apply@@@",
"@@@STEP_LOG_END@patch error@@@",
"@@@SET_BUILD_PROPERTY@got_cr_revision@\"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\"@@@",
"@@@SET_BUILD_PROPERTY@got_cr_revision_cp@\"refs/heads/master@{#170242}\"@@@",
"@@@SET_BUILD_PROPERTY@failure_type@\"PATCH_FAILURE\"@@@"
]
},
{
"cmd": [
"python",
"-u",
"import sys; sys.exit(1)"
],
"cwd": "[SLAVE_BUILD]",
"name": "Patch failure",
"~followup_annotations": [
"step returned non-zero exit code: 1",
"@@@STEP_TEXT@Check the bot_update step for details@@@",
"@@@STEP_FAILURE@@@"
]
},
{
"name": "$result",
"reason": "Step('Patch failure') failed with return_code 1",
"status_code": 1
}
]

@ -1,78 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[bot_update]/resources/bot_update.py",
"--master",
"tryserver.chromium.linux",
"--builder",
"linux_rel",
"--slave",
"totallyaslave-c4",
"--spec",
"cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]",
"--root",
"src",
"--revision_mapping_file",
"{\"src\": \"got_cr_revision\"}",
"--patch_url",
"http://src.chromium.org/foo/bar",
"--output_json",
"/path/to/tmp/json",
"--revision",
"src@HEAD"
],
"cwd": "[SLAVE_BUILD]",
"name": "bot_update",
"~followup_annotations": [
"@@@STEP_TEXT@Some step text@@@",
"@@@STEP_LOG_LINE@json.output@{@@@",
"@@@STEP_LOG_LINE@json.output@ \"did_run\": true, @@@",
"@@@STEP_LOG_LINE@json.output@ \"fixed_revisions\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"src\": \"HEAD\"@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"log_lines\": [@@@",
"@@@STEP_LOG_LINE@json.output@ [@@@",
"@@@STEP_LOG_LINE@json.output@ \"patch error\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"Patch failed to apply\"@@@",
"@@@STEP_LOG_LINE@json.output@ ]@@@",
"@@@STEP_LOG_LINE@json.output@ ], @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_apply_return_code\": 3, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_failure\": true, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_root\": \"src\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"properties\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"got_cr_revision\": \"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"got_cr_revision_cp\": \"refs/heads/master@{#170242}\"@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"root\": \"src\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"step_text\": \"Some step text\"@@@",
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@STEP_LOG_LINE@patch error@Patch failed to apply@@@",
"@@@STEP_LOG_END@patch error@@@",
"@@@SET_BUILD_PROPERTY@got_cr_revision@\"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\"@@@",
"@@@SET_BUILD_PROPERTY@got_cr_revision_cp@\"refs/heads/master@{#170242}\"@@@"
]
},
{
"cmd": [
"python",
"-u",
"import sys;print \"Patch download failed. See bot_update step for details\";sys.exit(1)"
],
"cwd": "[SLAVE_BUILD]",
"name": "Patch failure",
"~followup_annotations": [
"step returned non-zero exit code: 1",
"@@@STEP_LOG_LINE@python.inline@import sys;print \"Patch download failed. See bot_update step for details\";sys.exit(1)@@@",
"@@@STEP_LOG_END@python.inline@@@",
"@@@STEP_EXCEPTION@@@"
]
},
{
"name": "$result",
"reason": "Infra Failure: Step('Patch failure') returned 1",
"status_code": 1
}
]

@ -1,57 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[bot_update]/resources/bot_update.py",
"--master",
"tryserver.chromium.linux",
"--builder",
"linux_rel",
"--slave",
"totallyaslave-c4",
"--spec",
"cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'src', 'url': 'svn://svn.chromium.org/chrome/trunk/src'}]",
"--root",
"src/v8",
"--revision_mapping_file",
"{\"src\": \"got_cr_revision\"}",
"--patch_url",
"http://src.chromium.org/foo/bar",
"--output_json",
"/path/to/tmp/json",
"--revision",
"src@HEAD",
"--revision",
"src/v8@abc"
],
"cwd": "[SLAVE_BUILD]",
"name": "bot_update",
"~followup_annotations": [
"@@@STEP_TEXT@Some step text@@@",
"@@@STEP_LOG_LINE@json.output@{@@@",
"@@@STEP_LOG_LINE@json.output@ \"did_run\": true, @@@",
"@@@STEP_LOG_LINE@json.output@ \"fixed_revisions\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"src\": \"HEAD\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"src/v8\": \"abc\"@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_failure\": false, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_root\": \"src/v8\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"properties\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"got_cr_revision\": \"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"got_cr_revision_cp\": \"refs/heads/master@{#170242}\"@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"root\": \"src\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"step_text\": \"Some step text\"@@@",
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@SET_BUILD_PROPERTY@got_cr_revision@\"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\"@@@",
"@@@SET_BUILD_PROPERTY@got_cr_revision_cp@\"refs/heads/master@{#170242}\"@@@"
]
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

@ -1,155 +0,0 @@
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
DEPS = [
'bot_update',
'gclient',
'recipe_engine/path',
'recipe_engine/properties',
]
def RunSteps(api):
api.gclient.use_mirror = True
src_cfg = api.gclient.make_config()
soln = src_cfg.solutions.add()
soln.name = 'src'
soln.url = 'svn://svn.chromium.org/chrome/trunk/src'
soln.revision = api.properties.get('revision')
api.gclient.c = src_cfg
api.gclient.c.revisions = api.properties.get('revisions', {})
api.gclient.c.got_revision_mapping['src'] = 'got_cr_revision'
patch = api.properties.get('patch', True)
clobber = True if api.properties.get('clobber') else False
force = True if api.properties.get('force') else False
no_shallow = True if api.properties.get('no_shallow') else False
output_manifest = api.properties.get('output_manifest', False)
with_branch_heads = api.properties.get('with_branch_heads', False)
refs = api.properties.get('refs', [])
oauth2 = api.properties.get('oauth2', False)
root_solution_revision = api.properties.get('root_solution_revision')
suffix = api.properties.get('suffix')
api.bot_update.ensure_checkout(force=force,
no_shallow=no_shallow,
patch=patch,
with_branch_heads=with_branch_heads,
output_manifest=output_manifest,
refs=refs, patch_oauth2=oauth2,
clobber=clobber,
root_solution_revision=root_solution_revision,
suffix=suffix)
def GenTests(api):
yield api.test('basic') + api.properties(
mastername='chromium.linux',
buildername='Linux Builder',
slavename='totallyaslave-m1',
patch=False,
revision='abc'
)
yield api.test('basic_with_branch_heads') + api.properties(
mastername='chromium.linux',
buildername='Linux Builder',
slavename='totallyaslave-m1',
with_branch_heads=True,
suffix='with branch heads'
)
yield api.test('basic_output_manifest') + api.properties(
mastername='chromium.linux',
buildername='Linux Builder',
slavename='totallyaslave-m1',
output_manifest=True,
)
yield api.test('tryjob') + api.properties(
mastername='tryserver.chromium.linux',
buildername='linux_rel',
slavename='totallyaslave-c4',
issue=12345,
patchset=654321,
patch_url='http://src.chromium.org/foo/bar'
)
yield api.test('trychange') + api.properties(
mastername='tryserver.chromium.linux',
buildername='linux_rel',
slavename='totallyaslave-c4',
refs=['+refs/change/1/2/333'],
)
yield api.test('trychange_oauth2') + api.properties(
mastername='tryserver.chromium.linux',
buildername='linux_rel',
slavename='totallyaslave-c4',
oauth2=True,
)
yield api.test('tryjob_fail') + api.properties(
mastername='tryserver.chromium.linux',
buildername='linux_rel',
slavename='totallyaslave-c4',
issue=12345,
patchset=654321,
patch_url='http://src.chromium.org/foo/bar',
) + api.step_data('bot_update', retcode=1)
yield api.test('tryjob_fail_patch') + api.properties(
mastername='tryserver.chromium.linux',
buildername='linux_rel',
slavename='totallyaslave-c4',
issue=12345,
patchset=654321,
patch_url='http://src.chromium.org/foo/bar',
fail_patch='apply',
) + api.step_data('bot_update', retcode=88)
yield api.test('tryjob_fail_patch_download') + api.properties(
mastername='tryserver.chromium.linux',
buildername='linux_rel',
slavename='totallyaslave-c4',
issue=12345,
patchset=654321,
patch_url='http://src.chromium.org/foo/bar',
fail_patch='download'
) + api.step_data('bot_update', retcode=87)
yield api.test('forced') + api.properties(
mastername='experimental',
buildername='Experimental Builder',
slavename='somehost',
force=1
)
yield api.test('no_shallow') + api.properties(
mastername='experimental',
buildername='Experimental Builder',
slavename='somehost',
no_shallow=1
)
yield api.test('off') + api.properties(
mastername='experimental',
buildername='Experimental Builder',
slavename='somehost',
)
yield api.test('svn_mode') + api.properties(
mastername='experimental.svn',
buildername='Experimental SVN Builder',
slavename='somehost',
force=1
)
yield api.test('clobber') + api.properties(
mastername='experimental',
buildername='Experimental Builder',
slavename='somehost',
clobber=1
)
yield api.test('reset_root_solution_revision') + api.properties(
mastername='experimental',
buildername='Experimental Builder',
slavename='somehost',
root_solution_revision='revision',
)
yield api.test('tryjob_v8') + api.properties(
mastername='tryserver.chromium.linux',
buildername='linux_rel',
slavename='totallyaslave-c4',
issue=12345,
patchset=654321,
patch_url='http://src.chromium.org/foo/bar',
patch_project='v8',
revisions={'src/v8': 'abc'}
)

File diff suppressed because it is too large Load Diff

@ -1,86 +0,0 @@
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import hashlib
import os
import struct
import sys
from recipe_engine import recipe_test_api
# TODO(phajdan.jr): Clean up this somewhat ugly import.
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'resources'))
import bot_update
class BotUpdateTestApi(recipe_test_api.RecipeTestApi):
def output_json(self, master, builder, slave, root, first_sln,
revision_mapping, git_mode, force=False, fail_patch=False,
output_manifest=False, fixed_revisions=None):
"""Deterministically synthesize json.output test data for gclient's
--output-json option.
"""
active = bot_update.check_valid_host(master, builder, slave) or force
output = {
'did_run': active,
'patch_failure': False
}
# Add in extra json output if active.
if active:
properties = {
property_name: self.gen_revision(project_name, git_mode)
for project_name, property_name in revision_mapping.iteritems()
}
properties.update({
'%s_cp' % property_name: ('refs/heads/master@{#%s}' %
self.gen_revision(project_name, False))
for project_name, property_name in revision_mapping.iteritems()
})
# We also want to simulate outputting "got_revision_git": ...
# when git mode is off to match what bot_update.py does.
if not git_mode:
properties.update({
'%s_git' % property_name: self.gen_revision(project_name, True)
for project_name, property_name in revision_mapping.iteritems()
})
output.update({
'patch_root': root or first_sln,
'root': first_sln,
'properties': properties,
'step_text': 'Some step text'
})
if output_manifest:
output.update({
'manifest': {
project_name: {
'repository': 'https://fake.org/%s.git' % project_name,
'revision': self.gen_revision(project_name, git_mode),
}
for project_name in revision_mapping
}
})
if fixed_revisions:
output['fixed_revisions'] = fixed_revisions
if fail_patch:
output['log_lines'] = [('patch error', 'Patch failed to apply'),]
output['patch_failure'] = True
output['patch_apply_return_code'] = 1
if fail_patch == 'download':
output['patch_apply_return_code'] = 3
return self.m.json.output(output)
@staticmethod
def gen_revision(project, GIT_MODE):
"""Hash project to bogus deterministic revision values."""
h = hashlib.sha1(project)
if GIT_MODE:
return h.hexdigest()
else:
return struct.unpack('!I', h.digest()[:4])[0] % 300000

@ -1,9 +0,0 @@
DEPS = [
'recipe_engine/json',
'recipe_engine/path',
'recipe_engine/platform',
'recipe_engine/properties',
'recipe_engine/python',
'recipe_engine/step',
'tryserver',
]

@ -1,309 +0,0 @@
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from recipe_engine import recipe_api
class RevisionResolver(object):
"""Resolves the revision based on build properties."""
def resolve(self, properties): # pragma: no cover
raise NotImplementedError()
class RevisionFallbackChain(RevisionResolver):
"""Specify that a given project's sync revision follows the fallback chain."""
def __init__(self, default=None):
self._default = default
def resolve(self, properties):
"""Resolve the revision via the revision fallback chain.
If the given revision was set using the revision_fallback_chain() function,
this function will follow the chain, looking at relevant build properties
until it finds one set or reaches the end of the chain and returns the
default. If the given revision was not set using revision_fallback_chain(),
this function just returns it as-is.
"""
return (properties.get('parent_got_revision') or
properties.get('orig_revision') or
properties.get('revision') or
self._default)
def jsonish_to_python(spec, is_top=False):
ret = ''
if is_top: # We're the 'top' level, so treat this dict as a suite.
ret = '\n'.join(
'%s = %s' % (k, jsonish_to_python(spec[k])) for k in sorted(spec)
)
else:
if isinstance(spec, dict):
ret += '{'
ret += ', '.join(
"%s: %s" % (repr(str(k)), jsonish_to_python(spec[k]))
for k in sorted(spec)
)
ret += '}'
elif isinstance(spec, list):
ret += '['
ret += ', '.join(jsonish_to_python(x) for x in spec)
ret += ']'
elif isinstance(spec, basestring):
ret = repr(str(spec))
else:
ret = repr(spec)
return ret
class GclientApi(recipe_api.RecipeApi):
# Singleton object to indicate to checkout() that we should run a revert if
# we detect that we're on the tryserver.
RevertOnTryserver = object()
def __init__(self, **kwargs):
super(GclientApi, self).__init__(**kwargs)
self.USE_MIRROR = None
self._spec_alias = None
def __call__(self, name, cmd, infra_step=True, **kwargs):
"""Wrapper for easy calling of gclient steps."""
assert isinstance(cmd, (list, tuple))
prefix = 'gclient '
if self.spec_alias:
prefix = ('[spec: %s] ' % self.spec_alias) + prefix
return self.m.python(prefix + name,
self.m.path['depot_tools'].join('gclient.py'),
cmd,
infra_step=infra_step,
**kwargs)
@property
def use_mirror(self):
"""Indicates if gclient will use mirrors in its configuration."""
if self.USE_MIRROR is None:
self.USE_MIRROR = self.m.properties.get('use_mirror', True)
return self.USE_MIRROR
@use_mirror.setter
def use_mirror(self, val): # pragma: no cover
self.USE_MIRROR = val
@property
def spec_alias(self):
"""Optional name for the current spec for step naming."""
return self._spec_alias
@spec_alias.setter
def spec_alias(self, name):
self._spec_alias = name
@spec_alias.deleter
def spec_alias(self):
self._spec_alias = None
def get_config_defaults(self):
ret = {
'USE_MIRROR': self.use_mirror
}
ret['CACHE_DIR'] = self.m.path['root'].join('git_cache')
return ret
def resolve_revision(self, revision):
if hasattr(revision, 'resolve'):
return revision.resolve(self.m.properties)
return revision
def sync(self, cfg, with_branch_heads=False, **kwargs):
revisions = []
for i, s in enumerate(cfg.solutions):
if s.safesync_url: # prefer safesync_url in gclient mode
continue
if i == 0 and s.revision is None:
s.revision = RevisionFallbackChain()
if s.revision is not None and s.revision != '':
fixed_revision = self.resolve_revision(s.revision)
if fixed_revision:
revisions.extend(['--revision', '%s@%s' % (s.name, fixed_revision)])
for name, revision in sorted(cfg.revisions.items()):
fixed_revision = self.resolve_revision(revision)
if fixed_revision:
revisions.extend(['--revision', '%s@%s' % (name, fixed_revision)])
test_data_paths = set(cfg.got_revision_mapping.keys() +
[s.name for s in cfg.solutions])
step_test_data = lambda: (
self.test_api.output_json(test_data_paths, cfg.GIT_MODE))
try:
if not cfg.GIT_MODE:
args = ['sync', '--nohooks', '--force', '--verbose']
if cfg.delete_unversioned_trees:
args.append('--delete_unversioned_trees')
if with_branch_heads:
args.append('--with_branch_heads')
self('sync', args + revisions + ['--output-json', self.m.json.output()],
step_test_data=step_test_data,
**kwargs)
else:
# clean() isn't used because the gclient sync flags passed in checkout()
# do much the same thing, and they're more correct than doing a separate
# 'gclient revert' because it makes sure the other args are correct when
# a repo was deleted and needs to be re-cloned (notably
# --with_branch_heads), whereas 'revert' uses default args for clone
# operations.
#
# TODO(mmoss): To be like current official builders, this step could
# just delete the whole <slave_name>/build/ directory and start each
# build from scratch. That might be the least bad solution, at least
# until we have a reliable gclient method to produce a pristine working
# dir for git-based builds (e.g. maybe some combination of 'git
# reset/clean -fx' and removing the 'out' directory).
j = '-j2' if self.m.platform.is_win else '-j8'
args = ['sync', '--verbose', '--with_branch_heads', '--nohooks', j,
'--reset', '--force', '--upstream', '--no-nag-max']
if cfg.delete_unversioned_trees:
args.append('--delete_unversioned_trees')
self('sync', args + revisions +
['--output-json', self.m.json.output()],
step_test_data=step_test_data,
**kwargs)
finally:
result = self.m.step.active_result
data = result.json.output
for path, info in data['solutions'].iteritems():
# gclient json paths always end with a slash
path = path.rstrip('/')
if path in cfg.got_revision_mapping:
propname = cfg.got_revision_mapping[path]
result.presentation.properties[propname] = info['revision']
return result
def inject_parent_got_revision(self, gclient_config=None, override=False):
"""Match gclient config to build revisions obtained from build_properties.
Args:
gclient_config (gclient config object) - The config to manipulate. A value
of None manipulates the module's built-in config (self.c).
override (bool) - If True, will forcibly set revision and custom_vars
even if the config already contains values for them.
"""
cfg = gclient_config or self.c
for prop, custom_var in cfg.parent_got_revision_mapping.iteritems():
val = str(self.m.properties.get(prop, ''))
# TODO(infra): Fix coverage.
if val: # pragma: no cover
# Special case for 'src', inject into solutions[0]
if custom_var is None:
# This is not covered because we are deprecating this feature and
# it is no longer used by the public recipes.
if cfg.solutions[0].revision is None or override: # pragma: no cover
cfg.solutions[0].revision = val
else:
if custom_var not in cfg.solutions[0].custom_vars or override:
cfg.solutions[0].custom_vars[custom_var] = val
def checkout(self, gclient_config=None, revert=RevertOnTryserver,
inject_parent_got_revision=True, with_branch_heads=False,
**kwargs):
"""Return a step generator function for gclient checkouts."""
cfg = gclient_config or self.c
assert cfg.complete()
if revert is self.RevertOnTryserver:
revert = self.m.tryserver.is_tryserver
if inject_parent_got_revision:
self.inject_parent_got_revision(cfg, override=True)
spec_string = jsonish_to_python(cfg.as_jsonish(), True)
self('setup', ['config', '--spec', spec_string], **kwargs)
sync_step = None
try:
if not cfg.GIT_MODE:
try:
if revert:
self.revert(**kwargs)
finally:
sync_step = self.sync(cfg, with_branch_heads=with_branch_heads,
**kwargs)
else:
sync_step = self.sync(cfg, with_branch_heads=with_branch_heads,
**kwargs)
cfg_cmds = [
('user.name', 'local_bot'),
('user.email', 'local_bot@example.com'),
]
for var, val in cfg_cmds:
name = 'recurse (git config %s)' % var
self(name, ['recurse', 'git', 'config', var, val], **kwargs)
finally:
cwd = kwargs.get('cwd', self.m.path['slave_build'])
if 'checkout' not in self.m.path:
self.m.path['checkout'] = cwd.join(
*cfg.solutions[0].name.split(self.m.path.sep))
return sync_step
def revert(self, **kwargs):
"""Return a gclient_safe_revert step."""
# Not directly calling gclient, so don't use self().
alias = self.spec_alias
prefix = '%sgclient ' % (('[spec: %s] ' % alias) if alias else '')
return self.m.python(prefix + 'revert',
self.m.path['build'].join('scripts', 'slave', 'gclient_safe_revert.py'),
['.', self.m.path['depot_tools'].join('gclient',
platform_ext={'win': '.bat'})],
infra_step=True,
**kwargs
)
def runhooks(self, args=None, name='runhooks', **kwargs):
args = args or []
assert isinstance(args, (list, tuple))
return self(
name, ['runhooks'] + list(args), infra_step=False, **kwargs)
@property
def is_blink_mode(self):
""" Indicates wether the caller is to use the Blink config rather than the
Chromium config. This may happen for one of two reasons:
1. The builder is configured to always use TOT Blink. (factory property
top_of_tree_blink=True)
2. A try job comes in that applies to the Blink tree. (patch_project is
blink)
"""
return (
self.m.properties.get('top_of_tree_blink') or
self.m.properties.get('patch_project') == 'blink')
def break_locks(self):
"""Remove all index.lock files. If a previous run of git crashed, bot was
reset, etc... we might end up with leftover index.lock files.
"""
self.m.python.inline(
'cleanup index.lock',
"""
import os, sys
build_path = sys.argv[1]
if os.path.exists(build_path):
for (path, dir, files) in os.walk(build_path):
for cur_file in files:
if cur_file.endswith('index.lock'):
path_to_file = os.path.join(path, cur_file)
print 'deleting %s' % path_to_file
os.remove(path_to_file)
""",
args=[self.m.path['slave_build']],
infra_step=True,
)

@ -1,88 +0,0 @@
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import types
from recipe_engine.config import config_item_context, ConfigGroup, BadConf
from recipe_engine.config import ConfigList, Dict, Single, Static, Set, List
from . import api as gclient_api
def BaseConfig(USE_MIRROR=True, GIT_MODE=False, CACHE_DIR=None,
PATCH_PROJECT=None, BUILDSPEC_VERSION=None,
**_kwargs):
deps = '.DEPS.git' if GIT_MODE else 'DEPS'
cache_dir = str(CACHE_DIR) if GIT_MODE and CACHE_DIR else None
return ConfigGroup(
solutions = ConfigList(
lambda: ConfigGroup(
name = Single(basestring),
url = Single(basestring),
deps_file = Single(basestring, empty_val=deps, required=False,
hidden=False),
managed = Single(bool, empty_val=True, required=False, hidden=False),
custom_deps = Dict(value_type=(basestring, types.NoneType)),
custom_vars = Dict(value_type=basestring),
safesync_url = Single(basestring, required=False),
revision = Single(
(basestring, gclient_api.RevisionResolver),
required=False, hidden=True),
)
),
deps_os = Dict(value_type=basestring),
hooks = List(basestring),
target_os = Set(basestring),
target_os_only = Single(bool, empty_val=False, required=False),
cache_dir = Static(cache_dir, hidden=False),
# If supplied, use this as the source root (instead of the first solution's
# checkout).
src_root = Single(basestring, required=False, hidden=True),
# Maps 'solution' -> build_property
got_revision_mapping = Dict(hidden=True),
# Addition revisions we want to pass in. For now theres a duplication
# of code here of setting custom vars AND passing in --revision. We hope
# to remove custom vars later.
revisions = Dict(
value_type=(basestring, gclient_api.RevisionResolver),
hidden=True),
# TODO(iannucci): HACK! The use of None here to indicate that we apply this
# to the solution.revision field is really terrible. I mostly blame
# gclient.
# Maps 'parent_build_property' -> 'custom_var_name'
# Maps 'parent_build_property' -> None
# If value is None, the property value will be applied to
# solutions[0].revision. Otherwise, it will be applied to
# solutions[0].custom_vars['custom_var_name']
parent_got_revision_mapping = Dict(hidden=True),
delete_unversioned_trees = Single(bool, empty_val=True, required=False),
# Check out refs/branch-heads.
# TODO (machenbach): Only implemented for bot_update atm.
with_branch_heads = Single(
bool,
empty_val=False,
required=False,
hidden=True),
GIT_MODE = Static(bool(GIT_MODE)),
USE_MIRROR = Static(bool(USE_MIRROR)),
PATCH_PROJECT = Static(str(PATCH_PROJECT), hidden=True),
BUILDSPEC_VERSION= Static(BUILDSPEC_VERSION, hidden=True),
)
config_ctx = config_item_context(BaseConfig)
# TODO(phajdan.jr): Remove chromium-specific helper.
def ChromiumGitURL(_c, *pieces): # pragma: no cover
return '/'.join(('https://chromium.googlesource.com',) + pieces)
# TODO(phajdan.jr): Remove chromium-specific helper.
def ChromeInternalGitURL(_c, *pieces): # pragma: no cover
return '/'.join(('https://chrome-internal.googlesource.com',) + pieces)

@ -1,157 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"[DEPOT_TOOLS]/gclient.py",
"config",
"--spec",
"cache_dir = '[ROOT]/git_cache'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'https://chromium.googlesource.com/chromium/src.git'}]"
],
"cwd": "[SLAVE_BUILD]",
"name": "gclient setup"
},
{
"cmd": [
"python",
"-u",
"[DEPOT_TOOLS]/gclient.py",
"sync",
"--verbose",
"--with_branch_heads",
"--nohooks",
"-j8",
"--reset",
"--force",
"--upstream",
"--no-nag-max",
"--delete_unversioned_trees",
"--output-json",
"/path/to/tmp/json"
],
"cwd": "[SLAVE_BUILD]",
"name": "gclient sync",
"~followup_annotations": [
"@@@STEP_LOG_LINE@json.output@{@@@",
"@@@STEP_LOG_LINE@json.output@ \"solutions\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"src/\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"revision\": \"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\"@@@",
"@@@STEP_LOG_LINE@json.output@ }@@@",
"@@@STEP_LOG_LINE@json.output@ }@@@",
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@"
]
},
{
"cmd": [
"python",
"-u",
"[DEPOT_TOOLS]/gclient.py",
"recurse",
"git",
"config",
"user.name",
"local_bot"
],
"cwd": "[SLAVE_BUILD]",
"name": "gclient recurse (git config user.name)"
},
{
"cmd": [
"python",
"-u",
"[DEPOT_TOOLS]/gclient.py",
"recurse",
"git",
"config",
"user.email",
"local_bot@example.com"
],
"cwd": "[SLAVE_BUILD]",
"name": "gclient recurse (git config user.email)"
},
{
"cmd": [
"python",
"-u",
"[DEPOT_TOOLS]/gclient.py",
"config",
"--spec",
"cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'WebKit', 'safesync_url': 'https://blink-status.appspot.com/lkgr', 'url': 'svn://svn.chromium.org/blink/trunk'}]"
],
"cwd": "[SLAVE_BUILD]/src/third_party",
"name": "[spec: WebKit] gclient setup"
},
{
"cmd": [
"python",
"-u",
"[DEPOT_TOOLS]/gclient.py",
"sync",
"--nohooks",
"--force",
"--verbose",
"--delete_unversioned_trees",
"--with_branch_heads",
"--revision",
"third_party/WebKit@123",
"--output-json",
"/path/to/tmp/json"
],
"cwd": "[SLAVE_BUILD]/src/third_party",
"name": "[spec: WebKit] gclient sync",
"~followup_annotations": [
"@@@STEP_LOG_LINE@json.output@{@@@",
"@@@STEP_LOG_LINE@json.output@ \"solutions\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"WebKit/\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"revision\": 241198@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"src/blatley/\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"revision\": 248087@@@",
"@@@STEP_LOG_LINE@json.output@ }@@@",
"@@@STEP_LOG_LINE@json.output@ }@@@",
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@SET_BUILD_PROPERTY@got_blatley_revision@248087@@@"
]
},
{
"cmd": [
"python",
"-u",
"\nimport os, sys\n\nbuild_path = sys.argv[1]\nif os.path.exists(build_path):\n for (path, dir, files) in os.walk(build_path):\n for cur_file in files:\n if cur_file.endswith('index.lock'):\n path_to_file = os.path.join(path, cur_file)\n print 'deleting %s' % path_to_file\n os.remove(path_to_file)\n",
"[SLAVE_BUILD]"
],
"cwd": "[SLAVE_BUILD]",
"name": "cleanup index.lock",
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@import os, sys@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@build_path = sys.argv[1]@@@",
"@@@STEP_LOG_LINE@python.inline@if os.path.exists(build_path):@@@",
"@@@STEP_LOG_LINE@python.inline@ for (path, dir, files) in os.walk(build_path):@@@",
"@@@STEP_LOG_LINE@python.inline@ for cur_file in files:@@@",
"@@@STEP_LOG_LINE@python.inline@ if cur_file.endswith('index.lock'):@@@",
"@@@STEP_LOG_LINE@python.inline@ path_to_file = os.path.join(path, cur_file)@@@",
"@@@STEP_LOG_LINE@python.inline@ print 'deleting %s' % path_to_file@@@",
"@@@STEP_LOG_LINE@python.inline@ os.remove(path_to_file)@@@",
"@@@STEP_LOG_END@python.inline@@@"
]
},
{
"cmd": [
"python",
"-u",
"[DEPOT_TOOLS]/gclient.py",
"runhooks"
],
"cwd": "[SLAVE_BUILD]",
"name": "gclient runhooks"
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

@ -1,159 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"[DEPOT_TOOLS]/gclient.py",
"config",
"--spec",
"cache_dir = '[ROOT]/git_cache'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'https://chromium.googlesource.com/chromium/src.git'}]"
],
"cwd": "[SLAVE_BUILD]",
"name": "gclient setup"
},
{
"cmd": [
"python",
"-u",
"[DEPOT_TOOLS]/gclient.py",
"sync",
"--verbose",
"--with_branch_heads",
"--nohooks",
"-j8",
"--reset",
"--force",
"--upstream",
"--no-nag-max",
"--delete_unversioned_trees",
"--revision",
"src@abc",
"--output-json",
"/path/to/tmp/json"
],
"cwd": "[SLAVE_BUILD]",
"name": "gclient sync",
"~followup_annotations": [
"@@@STEP_LOG_LINE@json.output@{@@@",
"@@@STEP_LOG_LINE@json.output@ \"solutions\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"src/\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"revision\": \"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\"@@@",
"@@@STEP_LOG_LINE@json.output@ }@@@",
"@@@STEP_LOG_LINE@json.output@ }@@@",
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@"
]
},
{
"cmd": [
"python",
"-u",
"[DEPOT_TOOLS]/gclient.py",
"recurse",
"git",
"config",
"user.name",
"local_bot"
],
"cwd": "[SLAVE_BUILD]",
"name": "gclient recurse (git config user.name)"
},
{
"cmd": [
"python",
"-u",
"[DEPOT_TOOLS]/gclient.py",
"recurse",
"git",
"config",
"user.email",
"local_bot@example.com"
],
"cwd": "[SLAVE_BUILD]",
"name": "gclient recurse (git config user.email)"
},
{
"cmd": [
"python",
"-u",
"[DEPOT_TOOLS]/gclient.py",
"config",
"--spec",
"cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'WebKit', 'safesync_url': 'https://blink-status.appspot.com/lkgr', 'url': 'svn://svn.chromium.org/blink/trunk'}]"
],
"cwd": "[SLAVE_BUILD]/src/third_party",
"name": "[spec: WebKit] gclient setup"
},
{
"cmd": [
"python",
"-u",
"[DEPOT_TOOLS]/gclient.py",
"sync",
"--nohooks",
"--force",
"--verbose",
"--delete_unversioned_trees",
"--with_branch_heads",
"--revision",
"third_party/WebKit@123",
"--output-json",
"/path/to/tmp/json"
],
"cwd": "[SLAVE_BUILD]/src/third_party",
"name": "[spec: WebKit] gclient sync",
"~followup_annotations": [
"@@@STEP_LOG_LINE@json.output@{@@@",
"@@@STEP_LOG_LINE@json.output@ \"solutions\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"WebKit/\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"revision\": 241198@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"src/blatley/\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"revision\": 248087@@@",
"@@@STEP_LOG_LINE@json.output@ }@@@",
"@@@STEP_LOG_LINE@json.output@ }@@@",
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@SET_BUILD_PROPERTY@got_blatley_revision@248087@@@"
]
},
{
"cmd": [
"python",
"-u",
"\nimport os, sys\n\nbuild_path = sys.argv[1]\nif os.path.exists(build_path):\n for (path, dir, files) in os.walk(build_path):\n for cur_file in files:\n if cur_file.endswith('index.lock'):\n path_to_file = os.path.join(path, cur_file)\n print 'deleting %s' % path_to_file\n os.remove(path_to_file)\n",
"[SLAVE_BUILD]"
],
"cwd": "[SLAVE_BUILD]",
"name": "cleanup index.lock",
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@import os, sys@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@build_path = sys.argv[1]@@@",
"@@@STEP_LOG_LINE@python.inline@if os.path.exists(build_path):@@@",
"@@@STEP_LOG_LINE@python.inline@ for (path, dir, files) in os.walk(build_path):@@@",
"@@@STEP_LOG_LINE@python.inline@ for cur_file in files:@@@",
"@@@STEP_LOG_LINE@python.inline@ if cur_file.endswith('index.lock'):@@@",
"@@@STEP_LOG_LINE@python.inline@ path_to_file = os.path.join(path, cur_file)@@@",
"@@@STEP_LOG_LINE@python.inline@ print 'deleting %s' % path_to_file@@@",
"@@@STEP_LOG_LINE@python.inline@ os.remove(path_to_file)@@@",
"@@@STEP_LOG_END@python.inline@@@"
]
},
{
"cmd": [
"python",
"-u",
"[DEPOT_TOOLS]/gclient.py",
"runhooks"
],
"cwd": "[SLAVE_BUILD]",
"name": "gclient runhooks"
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

@ -1,170 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"[DEPOT_TOOLS]/gclient.py",
"config",
"--spec",
"cache_dir = '[ROOT]/git_cache'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'https://chromium.googlesource.com/chromium/src.git'}]"
],
"cwd": "[SLAVE_BUILD]",
"name": "gclient setup"
},
{
"cmd": [
"python",
"-u",
"[DEPOT_TOOLS]/gclient.py",
"sync",
"--verbose",
"--with_branch_heads",
"--nohooks",
"-j8",
"--reset",
"--force",
"--upstream",
"--no-nag-max",
"--delete_unversioned_trees",
"--revision",
"src@HEAD",
"--output-json",
"/path/to/tmp/json"
],
"cwd": "[SLAVE_BUILD]",
"name": "gclient sync",
"~followup_annotations": [
"@@@STEP_LOG_LINE@json.output@{@@@",
"@@@STEP_LOG_LINE@json.output@ \"solutions\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"src/\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"revision\": \"f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9\"@@@",
"@@@STEP_LOG_LINE@json.output@ }@@@",
"@@@STEP_LOG_LINE@json.output@ }@@@",
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@"
]
},
{
"cmd": [
"python",
"-u",
"[DEPOT_TOOLS]/gclient.py",
"recurse",
"git",
"config",
"user.name",
"local_bot"
],
"cwd": "[SLAVE_BUILD]",
"name": "gclient recurse (git config user.name)"
},
{
"cmd": [
"python",
"-u",
"[DEPOT_TOOLS]/gclient.py",
"recurse",
"git",
"config",
"user.email",
"local_bot@example.com"
],
"cwd": "[SLAVE_BUILD]",
"name": "gclient recurse (git config user.email)"
},
{
"cmd": [
"python",
"-u",
"[DEPOT_TOOLS]/gclient.py",
"config",
"--spec",
"cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'WebKit', 'safesync_url': 'https://blink-status.appspot.com/lkgr', 'url': 'svn://svn.chromium.org/blink/trunk'}]"
],
"cwd": "[SLAVE_BUILD]/src/third_party",
"name": "[spec: WebKit] gclient setup"
},
{
"cmd": [
"python",
"-u",
"[BUILD]/scripts/slave/gclient_safe_revert.py",
".",
"[DEPOT_TOOLS]/gclient"
],
"cwd": "[SLAVE_BUILD]/src/third_party",
"name": "[spec: WebKit] gclient revert"
},
{
"cmd": [
"python",
"-u",
"[DEPOT_TOOLS]/gclient.py",
"sync",
"--nohooks",
"--force",
"--verbose",
"--delete_unversioned_trees",
"--with_branch_heads",
"--revision",
"third_party/WebKit@123",
"--output-json",
"/path/to/tmp/json"
],
"cwd": "[SLAVE_BUILD]/src/third_party",
"name": "[spec: WebKit] gclient sync",
"~followup_annotations": [
"@@@STEP_LOG_LINE@json.output@{@@@",
"@@@STEP_LOG_LINE@json.output@ \"solutions\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"WebKit/\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"revision\": 241198@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"src/blatley/\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"revision\": 248087@@@",
"@@@STEP_LOG_LINE@json.output@ }@@@",
"@@@STEP_LOG_LINE@json.output@ }@@@",
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@SET_BUILD_PROPERTY@got_blatley_revision@248087@@@"
]
},
{
"cmd": [
"python",
"-u",
"\nimport os, sys\n\nbuild_path = sys.argv[1]\nif os.path.exists(build_path):\n for (path, dir, files) in os.walk(build_path):\n for cur_file in files:\n if cur_file.endswith('index.lock'):\n path_to_file = os.path.join(path, cur_file)\n print 'deleting %s' % path_to_file\n os.remove(path_to_file)\n",
"[SLAVE_BUILD]"
],
"cwd": "[SLAVE_BUILD]",
"name": "cleanup index.lock",
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@import os, sys@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@build_path = sys.argv[1]@@@",
"@@@STEP_LOG_LINE@python.inline@if os.path.exists(build_path):@@@",
"@@@STEP_LOG_LINE@python.inline@ for (path, dir, files) in os.walk(build_path):@@@",
"@@@STEP_LOG_LINE@python.inline@ for cur_file in files:@@@",
"@@@STEP_LOG_LINE@python.inline@ if cur_file.endswith('index.lock'):@@@",
"@@@STEP_LOG_LINE@python.inline@ path_to_file = os.path.join(path, cur_file)@@@",
"@@@STEP_LOG_LINE@python.inline@ print 'deleting %s' % path_to_file@@@",
"@@@STEP_LOG_LINE@python.inline@ os.remove(path_to_file)@@@",
"@@@STEP_LOG_END@python.inline@@@"
]
},
{
"cmd": [
"python",
"-u",
"[DEPOT_TOOLS]/gclient.py",
"runhooks"
],
"cwd": "[SLAVE_BUILD]",
"name": "gclient runhooks"
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

@ -1,51 +0,0 @@
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
DEPS = [
'gclient',
'recipe_engine/path',
'recipe_engine/properties',
]
def RunSteps(api):
src_cfg = api.gclient.make_config(GIT_MODE=True)
soln = src_cfg.solutions.add()
soln.name = 'src'
soln.url = 'https://chromium.googlesource.com/chromium/src.git'
soln.revision = api.properties.get('revision')
src_cfg.parent_got_revision_mapping['parent_got_revision'] = 'got_revision'
api.gclient.c = src_cfg
api.gclient.checkout()
api.gclient.spec_alias = 'WebKit'
bl_cfg = api.gclient.make_config()
soln = bl_cfg.solutions.add()
soln.name = 'WebKit'
soln.url = 'svn://svn.chromium.org/blink/trunk'
bl_cfg.revisions['third_party/WebKit'] = '123'
# Use safesync url for lkgr.
soln.safesync_url = 'https://blink-status.appspot.com/lkgr'
bl_cfg.got_revision_mapping['src/blatley'] = 'got_blatley_revision'
api.gclient.checkout(
gclient_config=bl_cfg,
with_branch_heads=True,
cwd=api.path['slave_build'].join('src', 'third_party'))
api.gclient.break_locks()
del api.gclient.spec_alias
api.gclient.runhooks()
assert not api.gclient.is_blink_mode
def GenTests(api):
yield api.test('basic')
yield api.test('revision') + api.properties(revision='abc')
yield api.test('tryserver') + api.properties.tryserver()

@ -1,37 +0,0 @@
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import hashlib
from recipe_engine import recipe_test_api
class GclientTestApi(recipe_test_api.RecipeTestApi):
def output_json(self, projects, git_mode=False):
"""Deterministically synthesize json.output test data for gclient's
--output-json option.
Args:
projects - a list of project paths (e.g. ['src', 'src/dependency'])
git_mode - Return git hashes instead of svn revs.
"""
# TODO(iannucci): Account for parent_got_revision_mapping. Right now the
# synthesized json output from this method will always use
# gen_revision(project), but if parent_got_revision and its ilk are
# specified, we should use those values instead.
return self.m.json.output({
'solutions': dict(
(p+'/', {'revision': self.gen_revision(p, git_mode)})
for p in projects
)
})
@staticmethod
def gen_revision(project, GIT_MODE):
"""Hash project to bogus deterministic revision values."""
h = hashlib.sha1(project)
if GIT_MODE:
return h.hexdigest()
else:
import struct
return struct.unpack('!I', h.digest()[:4])[0] % 300000

@ -1,8 +0,0 @@
DEPS = [
'recipe_engine/path',
'recipe_engine/platform',
'recipe_engine/properties',
'recipe_engine/python',
'recipe_engine/raw_io',
'recipe_engine/step',
]

@ -1,349 +0,0 @@
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import itertools
import re
from recipe_engine import recipe_api
class GitApi(recipe_api.RecipeApi):
_GIT_HASH_RE = re.compile('[0-9a-f]{40}', re.IGNORECASE)
def __call__(self, *args, **kwargs):
"""Return a git command step."""
name = kwargs.pop('name', 'git '+args[0])
infra_step = kwargs.pop('infra_step', True)
if 'cwd' not in kwargs:
kwargs.setdefault('cwd', self.m.path['checkout'])
git_cmd = ['git']
if self.m.platform.is_win:
git_cmd = [self.m.path['depot_tools'].join('git.bat')]
options = kwargs.pop('git_config_options', {})
for k, v in sorted(options.iteritems()):
git_cmd.extend(['-c', '%s=%s' % (k, v)])
can_fail_build = kwargs.pop('can_fail_build', True)
try:
return self.m.step(name, git_cmd + list(args), infra_step=infra_step,
**kwargs)
except self.m.step.StepFailure as f:
if can_fail_build:
raise
else:
return f.result
def fetch_tags(self, remote_name=None, **kwargs):
"""Fetches all tags from the remote."""
kwargs.setdefault('name', 'git fetch tags')
remote_name = remote_name or 'origin'
return self('fetch', remote_name, '--tags', **kwargs)
def cat_file_at_commit(self, file_path, commit_hash, remote_name=None,
**kwargs):
"""Outputs the contents of a file at a given revision."""
self.fetch_tags(remote_name=remote_name, **kwargs)
kwargs.setdefault('name', 'git cat-file %s:%s' % (commit_hash, file_path))
return self('cat-file', 'blob', '%s:%s' % (commit_hash, file_path),
**kwargs)
def count_objects(self, previous_result=None, can_fail_build=False, **kwargs):
"""Returns `git count-objects` result as a dict.
Args:
previous_result (dict): the result of previous count_objects call.
If passed, delta is reported in the log and step text.
can_fail_build (bool): if True, may fail the build and/or raise an
exception. Defaults to False.
Returns:
A dict of count-object values, or None if count-object run failed.
"""
if previous_result:
assert isinstance(previous_result, dict)
assert all(isinstance(v, long) for v in previous_result.itervalues())
assert 'size' in previous_result
assert 'size-pack' in previous_result
step_result = None
try:
step_result = self(
'count-objects', '-v', stdout=self.m.raw_io.output(),
can_fail_build=can_fail_build, **kwargs)
if not step_result.stdout:
return None
result = {}
for line in step_result.stdout.splitlines():
name, value = line.split(':', 1)
result[name] = long(value.strip())
def results_to_text(results):
return [' %s: %s' % (k, v) for k, v in results.iteritems()]
step_result.presentation.logs['result'] = results_to_text(result)
if previous_result:
delta = {
key: value - previous_result[key]
for key, value in result.iteritems()
if key in previous_result}
step_result.presentation.logs['delta'] = (
['before:'] + results_to_text(previous_result) +
['', 'after:'] + results_to_text(result) +
['', 'delta:'] + results_to_text(delta)
)
size_delta = (
result['size'] + result['size-pack']
- previous_result['size'] - previous_result['size-pack'])
# size_delta is in KiB.
step_result.presentation.step_text = (
'size delta: %+.2f MiB' % (size_delta / 1024.0))
return result
except Exception as ex:
if step_result:
step_result.presentation.logs['exception'] = ['%r' % ex]
step_result.presentation.status = self.m.step.WARNING
if can_fail_build:
raise recipe_api.InfraFailure('count-objects failed: %s' % ex)
return None
def checkout(self, url, ref=None, dir_path=None, recursive=False,
submodules=True, submodule_update_force=False,
keep_paths=None, step_suffix=None,
curl_trace_file=None, can_fail_build=True,
set_got_revision=False, remote_name=None,
display_fetch_size=None, file_name=None,
submodule_update_recursive=True):
"""Returns an iterable of steps to perform a full git checkout.
Args:
url (str): url of remote repo to use as upstream
ref (str): ref to fetch and check out
dir_path (Path): optional directory to clone into
recursive (bool): whether to recursively fetch submodules or not
submodules (bool): whether to sync and update submodules or not
submodule_update_force (bool): whether to update submodules with --force
keep_paths (iterable of strings): paths to ignore during git-clean;
paths are gitignore-style patterns relative to checkout_path.
step_suffix (str): suffix to add to a each step name
curl_trace_file (Path): if not None, dump GIT_CURL_VERBOSE=1 trace to that
file. Useful for debugging git issue reproducible only on bots. It has
a side effect of all stderr output of 'git fetch' going to that file.
can_fail_build (bool): if False, ignore errors during fetch or checkout.
set_got_revision (bool): if True, resolves HEAD and sets got_revision
property.
remote_name (str): name of the git remote to use
display_fetch_size (bool): if True, run `git count-objects` before and
after fetch and display delta. Adds two more steps. Defaults to False.
file_name (str): optional path to a single file to checkout.
submodule_update_recursive (bool): if True, updates submodules
recursively.
"""
# TODO(robertocn): Break this function and refactor calls to it.
# The problem is that there are way too many unrealated use cases for
# it, and the function's signature is getting unwieldy and its body
# unreadable.
display_fetch_size = display_fetch_size or False
if not dir_path:
dir_path = url.rsplit('/', 1)[-1]
if dir_path.endswith('.git'): # ex: https://host/foobar.git
dir_path = dir_path[:-len('.git')]
# ex: ssh://host:repo/foobar/.git
dir_path = dir_path or dir_path.rsplit('/', 1)[-1]
dir_path = self.m.path['slave_build'].join(dir_path)
if 'checkout' not in self.m.path:
self.m.path['checkout'] = dir_path
git_setup_args = ['--path', dir_path, '--url', url]
if remote_name:
git_setup_args += ['--remote', remote_name]
else:
remote_name = 'origin'
if self.m.platform.is_win:
git_setup_args += ['--git_cmd_path',
self.m.path['depot_tools'].join('git.bat')]
step_suffix = '' if step_suffix is None else ' (%s)' % step_suffix
self.m.python(
'git setup%s' % step_suffix,
self.resource('git_setup.py'),
git_setup_args)
# There are five kinds of refs we can be handed:
# 0) None. In this case, we default to properties['branch'].
# 1) A 40-character SHA1 hash.
# 2) A fully-qualifed arbitrary ref, e.g. 'refs/foo/bar/baz'.
# 3) A fully qualified branch name, e.g. 'refs/heads/master'.
# Chop off 'refs/heads' and now it matches case (4).
# 4) A branch name, e.g. 'master'.
# Note that 'FETCH_HEAD' can be many things (and therefore not a valid
# checkout target) if many refs are fetched, but we only explicitly fetch
# one ref here, so this is safe.
fetch_args = []
if not ref: # Case 0
fetch_remote = remote_name
fetch_ref = self.m.properties.get('branch') or 'master'
checkout_ref = 'FETCH_HEAD'
elif self._GIT_HASH_RE.match(ref): # Case 1.
fetch_remote = remote_name
fetch_ref = ''
checkout_ref = ref
elif ref.startswith('refs/heads/'): # Case 3.
fetch_remote = remote_name
fetch_ref = ref[len('refs/heads/'):]
checkout_ref = 'FETCH_HEAD'
else: # Cases 2 and 4.
fetch_remote = remote_name
fetch_ref = ref
checkout_ref = 'FETCH_HEAD'
fetch_args = [x for x in (fetch_remote, fetch_ref) if x]
if recursive:
fetch_args.append('--recurse-submodules')
fetch_env = {}
fetch_stderr = None
if curl_trace_file:
fetch_env['GIT_CURL_VERBOSE'] = '1'
fetch_stderr = self.m.raw_io.output(leak_to=curl_trace_file)
fetch_step_name = 'git fetch%s' % step_suffix
if display_fetch_size:
count_objects_before_fetch = self.count_objects(
name='count-objects before %s' % fetch_step_name,
cwd=dir_path,
step_test_data=lambda: self.m.raw_io.test_api.stream_output(
self.test_api.count_objects_output(1000)))
self('retry', 'fetch', *fetch_args,
cwd=dir_path,
name=fetch_step_name,
env=fetch_env,
stderr=fetch_stderr,
can_fail_build=can_fail_build)
if display_fetch_size:
self.count_objects(
name='count-objects after %s' % fetch_step_name,
cwd=dir_path,
previous_result=count_objects_before_fetch,
step_test_data=lambda: self.m.raw_io.test_api.stream_output(
self.test_api.count_objects_output(2000)))
if file_name:
self('checkout', '-f', checkout_ref, '--', file_name,
cwd=dir_path,
name='git checkout%s' % step_suffix,
can_fail_build=can_fail_build)
else:
self('checkout', '-f', checkout_ref,
cwd=dir_path,
name='git checkout%s' % step_suffix,
can_fail_build=can_fail_build)
if set_got_revision:
rev_parse_step = self('rev-parse', 'HEAD',
cwd=dir_path,
name='set got_revision',
stdout=self.m.raw_io.output(),
can_fail_build=False)
if rev_parse_step.presentation.status == 'SUCCESS':
sha = rev_parse_step.stdout.strip()
rev_parse_step.presentation.properties['got_revision'] = sha
clean_args = list(itertools.chain(
*[('-e', path) for path in keep_paths or []]))
self('clean', '-f', '-d', '-x', *clean_args,
name='git clean%s' % step_suffix,
cwd=dir_path,
can_fail_build=can_fail_build)
if submodules:
self('submodule', 'sync',
name='submodule sync%s' % step_suffix,
cwd=dir_path,
can_fail_build=can_fail_build)
submodule_update = ['submodule', 'update', '--init']
if submodule_update_recursive:
submodule_update.append('--recursive')
if submodule_update_force:
submodule_update.append('--force')
self(*submodule_update,
name='submodule update%s' % step_suffix,
cwd=dir_path,
can_fail_build=can_fail_build)
def get_timestamp(self, commit='HEAD', test_data=None, **kwargs):
"""Find and return the timestamp of the given commit."""
step_test_data = None
if test_data is not None:
step_test_data = lambda: self.m.raw_io.test_api.stream_output(test_data)
return self('show', commit, '--format=%at', '-s',
stdout=self.m.raw_io.output(),
step_test_data=step_test_data).stdout.rstrip()
def rebase(self, name_prefix, branch, dir_path, remote_name=None,
**kwargs):
"""Run rebase HEAD onto branch
Args:
name_prefix (str): a prefix used for the step names
branch (str): a branch name or a hash to rebase onto
dir_path (Path): directory to clone into
remote_name (str): the remote name to rebase from if not origin
"""
remote_name = remote_name or 'origin'
try:
self('rebase', '%s/master' % remote_name,
name="%s rebase" % name_prefix, cwd=dir_path, **kwargs)
except self.m.step.StepFailure:
self('rebase', '--abort', name='%s rebase abort' % name_prefix,
cwd=dir_path, **kwargs)
raise
def config_get(self, prop_name, **kwargs):
"""Returns: (str) The Git config output, or None if no output was generated.
Args:
prop_name: (str) The name of the config property to query.
kwargs: Forwarded to '__call__'.
"""
kwargs['name'] = kwargs.get('name', 'git config %s' % (prop_name,))
result = self('config', '--get', prop_name, stdout=self.m.raw_io.output(),
**kwargs)
value = result.stdout
if value:
value = value.strip()
result.presentation.step_text = value
return value
def get_remote_url(self, remote_name=None, **kwargs):
"""Returns: (str) The URL of the remote Git repository, or None.
Args:
remote_name: (str) The name of the remote to query, defaults to 'origin'.
kwargs: Forwarded to '__call__'.
"""
remote_name = remote_name or 'origin'
return self.config_get('remote.%s.url' % (remote_name,), **kwargs)
def bundle_create(self, bundle_path, rev_list_args=None, **kwargs):
"""Run 'git bundle create' on a Git repository.
Args:
bundle_path (Path): The path of the output bundle.
refs (list): The list of refs to include in the bundle. If None, all
refs in the Git checkout will be bundled.
kwargs: Forwarded to '__call__'.
"""
if not rev_list_args:
rev_list_args = ['--all']
self('bundle', 'create', bundle_path, *rev_list_args, **kwargs)

@ -1,165 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[git]/resources/git_setup.py",
"--path",
"[SLAVE_BUILD]/src",
"--url",
"https://chromium.googlesource.com/chromium/src.git"
],
"cwd": "[SLAVE_BUILD]",
"name": "git setup"
},
{
"cmd": [
"git",
"retry",
"fetch",
"origin",
"master",
"--recurse-submodules"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git fetch"
},
{
"cmd": [
"git",
"checkout",
"-f",
"FETCH_HEAD"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git checkout"
},
{
"cmd": [
"git",
"clean",
"-f",
"-d",
"-x"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git clean"
},
{
"cmd": [
"git",
"submodule",
"sync"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "submodule sync"
},
{
"cmd": [
"git",
"submodule",
"update",
"--init",
"--recursive"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "submodule update"
},
{
"cmd": [
"git",
"-c",
"foo=bar",
"count-objects",
"-v"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "count-objects",
"stdout": "/path/to/tmp/"
},
{
"cmd": [
"git",
"config",
"--get",
"remote.origin.url"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git config remote.origin.url",
"stdout": "/path/to/tmp/",
"~followup_annotations": [
"@@@STEP_TEXT@foo@@@"
]
},
{
"cmd": [
"git",
"show",
"HEAD",
"--format=%at",
"-s"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git show",
"stdout": "/path/to/tmp/"
},
{
"cmd": [
"git",
"fetch",
"origin",
"--tags"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git fetch tags"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status can_fail_build"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status cannot_fail_build"
},
{
"cmd": [
"git",
"rebase",
"origin/master"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "my repo rebase"
},
{
"cmd": [
"git",
"bundle",
"create",
"[SLAVE_BUILD]/all.bundle",
"--all"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git bundle"
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

@ -1,165 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[git]/resources/git_setup.py",
"--path",
"[SLAVE_BUILD]/src",
"--url",
"https://chromium.googlesource.com/chromium/src.git"
],
"cwd": "[SLAVE_BUILD]",
"name": "git setup"
},
{
"cmd": [
"git",
"retry",
"fetch",
"origin",
"testing",
"--recurse-submodules"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git fetch"
},
{
"cmd": [
"git",
"checkout",
"-f",
"FETCH_HEAD"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git checkout"
},
{
"cmd": [
"git",
"clean",
"-f",
"-d",
"-x"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git clean"
},
{
"cmd": [
"git",
"submodule",
"sync"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "submodule sync"
},
{
"cmd": [
"git",
"submodule",
"update",
"--init",
"--recursive"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "submodule update"
},
{
"cmd": [
"git",
"-c",
"foo=bar",
"count-objects",
"-v"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "count-objects",
"stdout": "/path/to/tmp/"
},
{
"cmd": [
"git",
"config",
"--get",
"remote.origin.url"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git config remote.origin.url",
"stdout": "/path/to/tmp/",
"~followup_annotations": [
"@@@STEP_TEXT@foo@@@"
]
},
{
"cmd": [
"git",
"show",
"HEAD",
"--format=%at",
"-s"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git show",
"stdout": "/path/to/tmp/"
},
{
"cmd": [
"git",
"fetch",
"origin",
"--tags"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git fetch tags"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status can_fail_build"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status cannot_fail_build"
},
{
"cmd": [
"git",
"rebase",
"origin/master"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "my repo rebase"
},
{
"cmd": [
"git",
"bundle",
"create",
"[SLAVE_BUILD]/all.bundle",
"--all"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git bundle"
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

@ -1,167 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[git]/resources/git_setup.py",
"--path",
"[SLAVE_BUILD]/src",
"--url",
"https://chromium.googlesource.com/chromium/src.git"
],
"cwd": "[SLAVE_BUILD]",
"name": "git setup"
},
{
"cmd": [
"git",
"retry",
"fetch",
"origin",
"master",
"--recurse-submodules"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git fetch"
},
{
"cmd": [
"git",
"checkout",
"-f",
"FETCH_HEAD",
"--",
"DEPS"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git checkout"
},
{
"cmd": [
"git",
"clean",
"-f",
"-d",
"-x"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git clean"
},
{
"cmd": [
"git",
"submodule",
"sync"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "submodule sync"
},
{
"cmd": [
"git",
"submodule",
"update",
"--init",
"--recursive"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "submodule update"
},
{
"cmd": [
"git",
"-c",
"foo=bar",
"count-objects",
"-v"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "count-objects",
"stdout": "/path/to/tmp/"
},
{
"cmd": [
"git",
"config",
"--get",
"remote.origin.url"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git config remote.origin.url",
"stdout": "/path/to/tmp/",
"~followup_annotations": [
"@@@STEP_TEXT@foo@@@"
]
},
{
"cmd": [
"git",
"show",
"HEAD",
"--format=%at",
"-s"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git show",
"stdout": "/path/to/tmp/"
},
{
"cmd": [
"git",
"fetch",
"origin",
"--tags"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git fetch tags"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status can_fail_build"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status cannot_fail_build"
},
{
"cmd": [
"git",
"rebase",
"origin/master"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "my repo rebase"
},
{
"cmd": [
"git",
"bundle",
"create",
"[SLAVE_BUILD]/all.bundle",
"--all"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git bundle"
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

@ -1,164 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[git]/resources/git_setup.py",
"--path",
"[SLAVE_BUILD]/src",
"--url",
"https://chromium.googlesource.com/chromium/src.git"
],
"cwd": "[SLAVE_BUILD]",
"name": "git setup"
},
{
"cmd": [
"git",
"retry",
"fetch",
"origin",
"--recurse-submodules"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git fetch"
},
{
"cmd": [
"git",
"checkout",
"-f",
"abcdef0123456789abcdef0123456789abcdef01"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git checkout"
},
{
"cmd": [
"git",
"clean",
"-f",
"-d",
"-x"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git clean"
},
{
"cmd": [
"git",
"submodule",
"sync"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "submodule sync"
},
{
"cmd": [
"git",
"submodule",
"update",
"--init",
"--recursive"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "submodule update"
},
{
"cmd": [
"git",
"-c",
"foo=bar",
"count-objects",
"-v"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "count-objects",
"stdout": "/path/to/tmp/"
},
{
"cmd": [
"git",
"config",
"--get",
"remote.origin.url"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git config remote.origin.url",
"stdout": "/path/to/tmp/",
"~followup_annotations": [
"@@@STEP_TEXT@foo@@@"
]
},
{
"cmd": [
"git",
"show",
"HEAD",
"--format=%at",
"-s"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git show",
"stdout": "/path/to/tmp/"
},
{
"cmd": [
"git",
"fetch",
"origin",
"--tags"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git fetch tags"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status can_fail_build"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status cannot_fail_build"
},
{
"cmd": [
"git",
"rebase",
"origin/master"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "my repo rebase"
},
{
"cmd": [
"git",
"bundle",
"create",
"[SLAVE_BUILD]/all.bundle",
"--all"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git bundle"
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

@ -1,165 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[git]/resources/git_setup.py",
"--path",
"[SLAVE_BUILD]/src",
"--url",
"https://chromium.googlesource.com/chromium/src.git"
],
"cwd": "[SLAVE_BUILD]",
"name": "git setup"
},
{
"cmd": [
"git",
"retry",
"fetch",
"origin",
"refs/foo/bar",
"--recurse-submodules"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git fetch"
},
{
"cmd": [
"git",
"checkout",
"-f",
"FETCH_HEAD"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git checkout"
},
{
"cmd": [
"git",
"clean",
"-f",
"-d",
"-x"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git clean"
},
{
"cmd": [
"git",
"submodule",
"sync"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "submodule sync"
},
{
"cmd": [
"git",
"submodule",
"update",
"--init",
"--recursive"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "submodule update"
},
{
"cmd": [
"git",
"-c",
"foo=bar",
"count-objects",
"-v"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "count-objects",
"stdout": "/path/to/tmp/"
},
{
"cmd": [
"git",
"config",
"--get",
"remote.origin.url"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git config remote.origin.url",
"stdout": "/path/to/tmp/",
"~followup_annotations": [
"@@@STEP_TEXT@foo@@@"
]
},
{
"cmd": [
"git",
"show",
"HEAD",
"--format=%at",
"-s"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git show",
"stdout": "/path/to/tmp/"
},
{
"cmd": [
"git",
"fetch",
"origin",
"--tags"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git fetch tags"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status can_fail_build"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status cannot_fail_build"
},
{
"cmd": [
"git",
"rebase",
"origin/master"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "my repo rebase"
},
{
"cmd": [
"git",
"bundle",
"create",
"[SLAVE_BUILD]/all.bundle",
"--all"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git bundle"
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

@ -1,166 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[git]/resources/git_setup.py",
"--path",
"[SLAVE_BUILD]/src",
"--url",
"https://chromium.googlesource.com/chromium/src.git"
],
"cwd": "[SLAVE_BUILD]",
"name": "git setup"
},
{
"cmd": [
"git",
"retry",
"fetch",
"origin",
"master",
"--recurse-submodules"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git fetch"
},
{
"cmd": [
"git",
"checkout",
"-f",
"FETCH_HEAD"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git checkout"
},
{
"cmd": [
"git",
"clean",
"-f",
"-d",
"-x"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git clean"
},
{
"cmd": [
"git",
"submodule",
"sync"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "submodule sync"
},
{
"cmd": [
"git",
"submodule",
"update",
"--init",
"--recursive",
"--force"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "submodule update"
},
{
"cmd": [
"git",
"-c",
"foo=bar",
"count-objects",
"-v"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "count-objects",
"stdout": "/path/to/tmp/"
},
{
"cmd": [
"git",
"config",
"--get",
"remote.origin.url"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git config remote.origin.url",
"stdout": "/path/to/tmp/",
"~followup_annotations": [
"@@@STEP_TEXT@foo@@@"
]
},
{
"cmd": [
"git",
"show",
"HEAD",
"--format=%at",
"-s"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git show",
"stdout": "/path/to/tmp/"
},
{
"cmd": [
"git",
"fetch",
"origin",
"--tags"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git fetch tags"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status can_fail_build"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status cannot_fail_build"
},
{
"cmd": [
"git",
"rebase",
"origin/master"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "my repo rebase"
},
{
"cmd": [
"git",
"bundle",
"create",
"[SLAVE_BUILD]/all.bundle",
"--all"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git bundle"
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

@ -1,141 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[git]/resources/git_setup.py",
"--path",
"[SLAVE_BUILD]/src",
"--url",
"https://chromium.googlesource.com/chromium/src.git"
],
"cwd": "[SLAVE_BUILD]",
"name": "git setup"
},
{
"cmd": [
"git",
"retry",
"fetch",
"origin",
"master",
"--recurse-submodules"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git fetch"
},
{
"cmd": [
"git",
"checkout",
"-f",
"FETCH_HEAD"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git checkout"
},
{
"cmd": [
"git",
"clean",
"-f",
"-d",
"-x"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git clean"
},
{
"cmd": [
"git",
"submodule",
"sync"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "submodule sync"
},
{
"cmd": [
"git",
"submodule",
"update",
"--init",
"--recursive"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "submodule update"
},
{
"cmd": [
"git",
"-c",
"foo=bar",
"count-objects",
"-v"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "count-objects",
"stdout": "/path/to/tmp/"
},
{
"cmd": [
"git",
"config",
"--get",
"remote.origin.url"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git config remote.origin.url",
"stdout": "/path/to/tmp/",
"~followup_annotations": [
"@@@STEP_TEXT@foo@@@"
]
},
{
"cmd": [
"git",
"show",
"HEAD",
"--format=%at",
"-s"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git show",
"stdout": "/path/to/tmp/"
},
{
"cmd": [
"git",
"fetch",
"origin",
"--tags"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git fetch tags"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status can_fail_build",
"~followup_annotations": [
"step returned non-zero exit code: 1",
"@@@STEP_EXCEPTION@@@"
]
},
{
"name": "$result",
"reason": "Infra Failure: Step('git status can_fail_build') returned 1",
"status_code": 1
}
]

@ -1,169 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[git]/resources/git_setup.py",
"--path",
"[SLAVE_BUILD]/src",
"--url",
"https://chromium.googlesource.com/chromium/src.git"
],
"cwd": "[SLAVE_BUILD]",
"name": "git setup"
},
{
"cmd": [
"git",
"retry",
"fetch",
"origin",
"master",
"--recurse-submodules"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git fetch"
},
{
"cmd": [
"git",
"checkout",
"-f",
"FETCH_HEAD"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git checkout"
},
{
"cmd": [
"git",
"clean",
"-f",
"-d",
"-x"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git clean"
},
{
"cmd": [
"git",
"submodule",
"sync"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "submodule sync"
},
{
"cmd": [
"git",
"submodule",
"update",
"--init",
"--recursive"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "submodule update"
},
{
"cmd": [
"git",
"-c",
"foo=bar",
"count-objects",
"-v"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "count-objects",
"stdout": "/path/to/tmp/"
},
{
"cmd": [
"git",
"config",
"--get",
"remote.origin.url"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git config remote.origin.url",
"stdout": "/path/to/tmp/",
"~followup_annotations": [
"@@@STEP_TEXT@foo@@@"
]
},
{
"cmd": [
"git",
"show",
"HEAD",
"--format=%at",
"-s"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git show",
"stdout": "/path/to/tmp/"
},
{
"cmd": [
"git",
"fetch",
"origin",
"--tags"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git fetch tags"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status can_fail_build"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status cannot_fail_build",
"~followup_annotations": [
"step returned non-zero exit code: 1",
"@@@STEP_EXCEPTION@@@"
]
},
{
"cmd": [
"git",
"rebase",
"origin/master"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "my repo rebase"
},
{
"cmd": [
"git",
"bundle",
"create",
"[SLAVE_BUILD]/all.bundle",
"--all"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git bundle"
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

@ -1,187 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[git]/resources/git_setup.py",
"--path",
"[SLAVE_BUILD]/src",
"--url",
"https://chromium.googlesource.com/chromium/src.git"
],
"cwd": "[SLAVE_BUILD]",
"name": "git setup"
},
{
"cmd": [
"git",
"retry",
"fetch",
"origin",
"abcdef12345",
"--recurse-submodules"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git fetch"
},
{
"cmd": [
"git",
"checkout",
"-f",
"FETCH_HEAD"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git checkout"
},
{
"cmd": [
"git",
"clean",
"-f",
"-d",
"-x"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git clean"
},
{
"cmd": [
"git",
"submodule",
"sync"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "submodule sync"
},
{
"cmd": [
"git",
"submodule",
"update",
"--init",
"--recursive"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "submodule update"
},
{
"cmd": [
"git",
"-c",
"foo=bar",
"count-objects",
"-v"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "count-objects",
"stdout": "/path/to/tmp/"
},
{
"cmd": [
"git",
"config",
"--get",
"remote.origin.url"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git config remote.origin.url",
"stdout": "/path/to/tmp/",
"~followup_annotations": [
"@@@STEP_TEXT@foo@@@"
]
},
{
"cmd": [
"git",
"show",
"HEAD",
"--format=%at",
"-s"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git show",
"stdout": "/path/to/tmp/"
},
{
"cmd": [
"git",
"fetch",
"origin",
"--tags"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git fetch tags"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status can_fail_build"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status cannot_fail_build"
},
{
"cmd": [
"git",
"rebase",
"origin/master"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "my repo rebase"
},
{
"cmd": [
"git",
"fetch",
"origin",
"--tags"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git fetch tags (2)",
"stdout": "/path/to/tmp/"
},
{
"cmd": [
"git",
"cat-file",
"blob",
"abcdef12345:TestFile"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git cat-file abcdef12345:TestFile",
"stdout": "/path/to/tmp/"
},
{
"cmd": [
"git",
"bundle",
"create",
"[SLAVE_BUILD]/all.bundle",
"--all"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git bundle"
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

@ -1,238 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[git]/resources/git_setup.py",
"--path",
"[SLAVE_BUILD]/src",
"--url",
"https://chromium.googlesource.com/chromium/src.git"
],
"cwd": "[SLAVE_BUILD]",
"name": "git setup"
},
{
"cmd": [
"git",
"count-objects",
"-v"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "count-objects before git fetch",
"stdout": "/path/to/tmp/",
"~followup_annotations": [
"@@@STEP_LOG_LINE@result@ count: 1000@@@",
"@@@STEP_LOG_LINE@result@ garbage: 1000@@@",
"@@@STEP_LOG_LINE@result@ packs: 1000@@@",
"@@@STEP_LOG_LINE@result@ in_pack: 1000@@@",
"@@@STEP_LOG_LINE@result@ size-pack: 1000@@@",
"@@@STEP_LOG_LINE@result@ size-garbage: 1000@@@",
"@@@STEP_LOG_LINE@result@ prune-packable: 1000@@@",
"@@@STEP_LOG_LINE@result@ size: 1000@@@",
"@@@STEP_LOG_END@result@@@"
]
},
{
"cmd": [
"git",
"retry",
"fetch",
"origin",
"master",
"--recurse-submodules"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git fetch"
},
{
"cmd": [
"git",
"count-objects",
"-v"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "count-objects after git fetch",
"stdout": "/path/to/tmp/",
"~followup_annotations": [
"@@@STEP_TEXT@size delta: +1.95 MiB@@@",
"@@@STEP_LOG_LINE@result@ count: 2000@@@",
"@@@STEP_LOG_LINE@result@ garbage: 2000@@@",
"@@@STEP_LOG_LINE@result@ packs: 2000@@@",
"@@@STEP_LOG_LINE@result@ in_pack: 2000@@@",
"@@@STEP_LOG_LINE@result@ size-pack: 2000@@@",
"@@@STEP_LOG_LINE@result@ size-garbage: 2000@@@",
"@@@STEP_LOG_LINE@result@ prune-packable: 2000@@@",
"@@@STEP_LOG_LINE@result@ size: 2000@@@",
"@@@STEP_LOG_END@result@@@",
"@@@STEP_LOG_LINE@delta@before:@@@",
"@@@STEP_LOG_LINE@delta@ count: 1000@@@",
"@@@STEP_LOG_LINE@delta@ garbage: 1000@@@",
"@@@STEP_LOG_LINE@delta@ packs: 1000@@@",
"@@@STEP_LOG_LINE@delta@ in_pack: 1000@@@",
"@@@STEP_LOG_LINE@delta@ size-pack: 1000@@@",
"@@@STEP_LOG_LINE@delta@ size-garbage: 1000@@@",
"@@@STEP_LOG_LINE@delta@ prune-packable: 1000@@@",
"@@@STEP_LOG_LINE@delta@ size: 1000@@@",
"@@@STEP_LOG_LINE@delta@@@@",
"@@@STEP_LOG_LINE@delta@after:@@@",
"@@@STEP_LOG_LINE@delta@ count: 2000@@@",
"@@@STEP_LOG_LINE@delta@ garbage: 2000@@@",
"@@@STEP_LOG_LINE@delta@ packs: 2000@@@",
"@@@STEP_LOG_LINE@delta@ in_pack: 2000@@@",
"@@@STEP_LOG_LINE@delta@ size-pack: 2000@@@",
"@@@STEP_LOG_LINE@delta@ size-garbage: 2000@@@",
"@@@STEP_LOG_LINE@delta@ prune-packable: 2000@@@",
"@@@STEP_LOG_LINE@delta@ size: 2000@@@",
"@@@STEP_LOG_LINE@delta@@@@",
"@@@STEP_LOG_LINE@delta@delta:@@@",
"@@@STEP_LOG_LINE@delta@ count: 1000@@@",
"@@@STEP_LOG_LINE@delta@ garbage: 1000@@@",
"@@@STEP_LOG_LINE@delta@ packs: 1000@@@",
"@@@STEP_LOG_LINE@delta@ prune-packable: 1000@@@",
"@@@STEP_LOG_LINE@delta@ size-pack: 1000@@@",
"@@@STEP_LOG_LINE@delta@ size-garbage: 1000@@@",
"@@@STEP_LOG_LINE@delta@ in_pack: 1000@@@",
"@@@STEP_LOG_LINE@delta@ size: 1000@@@",
"@@@STEP_LOG_END@delta@@@"
]
},
{
"cmd": [
"git",
"checkout",
"-f",
"FETCH_HEAD"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git checkout"
},
{
"cmd": [
"git",
"clean",
"-f",
"-d",
"-x"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git clean"
},
{
"cmd": [
"git",
"submodule",
"sync"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "submodule sync"
},
{
"cmd": [
"git",
"submodule",
"update",
"--init",
"--recursive"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "submodule update"
},
{
"cmd": [
"git",
"-c",
"foo=bar",
"count-objects",
"-v"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "count-objects",
"stdout": "/path/to/tmp/"
},
{
"cmd": [
"git",
"config",
"--get",
"remote.origin.url"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git config remote.origin.url",
"stdout": "/path/to/tmp/",
"~followup_annotations": [
"@@@STEP_TEXT@foo@@@"
]
},
{
"cmd": [
"git",
"show",
"HEAD",
"--format=%at",
"-s"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git show",
"stdout": "/path/to/tmp/"
},
{
"cmd": [
"git",
"fetch",
"origin",
"--tags"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git fetch tags"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status can_fail_build"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status cannot_fail_build"
},
{
"cmd": [
"git",
"rebase",
"origin/master"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "my repo rebase"
},
{
"cmd": [
"git",
"bundle",
"create",
"[SLAVE_BUILD]/all.bundle",
"--all"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git bundle"
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

@ -1,169 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[git]/resources/git_setup.py",
"--path",
"[SLAVE_BUILD]/src",
"--url",
"https://chromium.googlesource.com/chromium/src.git"
],
"cwd": "[SLAVE_BUILD]",
"name": "git setup"
},
{
"cmd": [
"git",
"retry",
"fetch",
"origin",
"master",
"--recurse-submodules"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git fetch"
},
{
"cmd": [
"git",
"checkout",
"-f",
"FETCH_HEAD"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git checkout"
},
{
"cmd": [
"git",
"clean",
"-f",
"-d",
"-x"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git clean"
},
{
"cmd": [
"git",
"submodule",
"sync"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "submodule sync"
},
{
"cmd": [
"git",
"submodule",
"update",
"--init",
"--recursive"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "submodule update"
},
{
"cmd": [
"git",
"-c",
"foo=bar",
"count-objects",
"-v"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "count-objects",
"stdout": "/path/to/tmp/",
"~followup_annotations": [
"step returned non-zero exit code: 1",
"@@@STEP_EXCEPTION@@@"
]
},
{
"cmd": [
"git",
"config",
"--get",
"remote.origin.url"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git config remote.origin.url",
"stdout": "/path/to/tmp/",
"~followup_annotations": [
"@@@STEP_TEXT@foo@@@"
]
},
{
"cmd": [
"git",
"show",
"HEAD",
"--format=%at",
"-s"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git show",
"stdout": "/path/to/tmp/"
},
{
"cmd": [
"git",
"fetch",
"origin",
"--tags"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git fetch tags"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status can_fail_build"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status cannot_fail_build"
},
{
"cmd": [
"git",
"rebase",
"origin/master"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "my repo rebase"
},
{
"cmd": [
"git",
"bundle",
"create",
"[SLAVE_BUILD]/all.bundle",
"--all"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git bundle"
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

@ -1,170 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[git]/resources/git_setup.py",
"--path",
"[SLAVE_BUILD]/src",
"--url",
"https://chromium.googlesource.com/chromium/src.git"
],
"cwd": "[SLAVE_BUILD]",
"name": "git setup"
},
{
"cmd": [
"git",
"retry",
"fetch",
"origin",
"master",
"--recurse-submodules"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git fetch"
},
{
"cmd": [
"git",
"checkout",
"-f",
"FETCH_HEAD"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git checkout"
},
{
"cmd": [
"git",
"clean",
"-f",
"-d",
"-x"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git clean"
},
{
"cmd": [
"git",
"submodule",
"sync"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "submodule sync"
},
{
"cmd": [
"git",
"submodule",
"update",
"--init",
"--recursive"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "submodule update"
},
{
"cmd": [
"git",
"-c",
"foo=bar",
"count-objects",
"-v"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "count-objects",
"stdout": "/path/to/tmp/",
"~followup_annotations": [
"@@@STEP_LOG_LINE@exception@ValueError(\"invalid literal for long() with base 10: 'xxx'\",)@@@",
"@@@STEP_LOG_END@exception@@@",
"@@@STEP_WARNINGS@@@"
]
},
{
"cmd": [
"git",
"config",
"--get",
"remote.origin.url"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git config remote.origin.url",
"stdout": "/path/to/tmp/",
"~followup_annotations": [
"@@@STEP_TEXT@foo@@@"
]
},
{
"cmd": [
"git",
"show",
"HEAD",
"--format=%at",
"-s"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git show",
"stdout": "/path/to/tmp/"
},
{
"cmd": [
"git",
"fetch",
"origin",
"--tags"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git fetch tags"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status can_fail_build"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status cannot_fail_build"
},
{
"cmd": [
"git",
"rebase",
"origin/master"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "my repo rebase"
},
{
"cmd": [
"git",
"bundle",
"create",
"[SLAVE_BUILD]/all.bundle",
"--all"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git bundle"
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

@ -1,90 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[git]/resources/git_setup.py",
"--path",
"[SLAVE_BUILD]/src",
"--url",
"https://chromium.googlesource.com/chromium/src.git"
],
"cwd": "[SLAVE_BUILD]",
"name": "git setup"
},
{
"cmd": [
"git",
"retry",
"fetch",
"origin",
"master",
"--recurse-submodules"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git fetch"
},
{
"cmd": [
"git",
"checkout",
"-f",
"FETCH_HEAD"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git checkout"
},
{
"cmd": [
"git",
"clean",
"-f",
"-d",
"-x"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git clean"
},
{
"cmd": [
"git",
"submodule",
"sync"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "submodule sync"
},
{
"cmd": [
"git",
"submodule",
"update",
"--init",
"--recursive"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "submodule update"
},
{
"cmd": [
"git",
"-c",
"foo=bar",
"count-objects",
"-v"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "count-objects",
"stdout": "/path/to/tmp/",
"~followup_annotations": [
"@@@STEP_LOG_LINE@exception@ValueError(\"invalid literal for long() with base 10: 'xxx'\",)@@@",
"@@@STEP_LOG_END@exception@@@",
"@@@STEP_WARNINGS@@@"
]
},
{
"name": "$result",
"reason": "count-objects failed: invalid literal for long() with base 10: 'xxx'",
"status_code": 1
}
]

@ -1,169 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[git]/resources/git_setup.py",
"--path",
"[SLAVE_BUILD]/src",
"--url",
"https://chromium.googlesource.com/chromium/src.git"
],
"cwd": "[SLAVE_BUILD]",
"name": "git setup"
},
{
"cmd": [
"git",
"retry",
"fetch",
"origin",
"refs/foo/bar",
"--recurse-submodules"
],
"cwd": "[SLAVE_BUILD]/src",
"env": {
"GIT_CURL_VERBOSE": "1"
},
"name": "git fetch",
"stderr": "[SLAVE_BUILD]/curl_trace.log"
},
{
"cmd": [
"git",
"checkout",
"-f",
"FETCH_HEAD"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git checkout"
},
{
"cmd": [
"git",
"clean",
"-f",
"-d",
"-x"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git clean"
},
{
"cmd": [
"git",
"submodule",
"sync"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "submodule sync"
},
{
"cmd": [
"git",
"submodule",
"update",
"--init",
"--recursive"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "submodule update"
},
{
"cmd": [
"git",
"-c",
"foo=bar",
"count-objects",
"-v"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "count-objects",
"stdout": "/path/to/tmp/"
},
{
"cmd": [
"git",
"config",
"--get",
"remote.origin.url"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git config remote.origin.url",
"stdout": "/path/to/tmp/",
"~followup_annotations": [
"@@@STEP_TEXT@foo@@@"
]
},
{
"cmd": [
"git",
"show",
"HEAD",
"--format=%at",
"-s"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git show",
"stdout": "/path/to/tmp/"
},
{
"cmd": [
"git",
"fetch",
"origin",
"--tags"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git fetch tags"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status can_fail_build"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status cannot_fail_build"
},
{
"cmd": [
"git",
"rebase",
"origin/master"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "my repo rebase"
},
{
"cmd": [
"git",
"bundle",
"create",
"[SLAVE_BUILD]/all.bundle",
"--all"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git bundle"
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

@ -1,167 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[git]\\resources\\git_setup.py",
"--path",
"[SLAVE_BUILD]\\src",
"--url",
"https://chromium.googlesource.com/chromium/src.git",
"--git_cmd_path",
"[DEPOT_TOOLS]\\git.bat"
],
"cwd": "[SLAVE_BUILD]",
"name": "git setup"
},
{
"cmd": [
"[DEPOT_TOOLS]\\git.bat",
"retry",
"fetch",
"origin",
"master",
"--recurse-submodules"
],
"cwd": "[SLAVE_BUILD]\\src",
"name": "git fetch"
},
{
"cmd": [
"[DEPOT_TOOLS]\\git.bat",
"checkout",
"-f",
"FETCH_HEAD"
],
"cwd": "[SLAVE_BUILD]\\src",
"name": "git checkout"
},
{
"cmd": [
"[DEPOT_TOOLS]\\git.bat",
"clean",
"-f",
"-d",
"-x"
],
"cwd": "[SLAVE_BUILD]\\src",
"name": "git clean"
},
{
"cmd": [
"[DEPOT_TOOLS]\\git.bat",
"submodule",
"sync"
],
"cwd": "[SLAVE_BUILD]\\src",
"name": "submodule sync"
},
{
"cmd": [
"[DEPOT_TOOLS]\\git.bat",
"submodule",
"update",
"--init",
"--recursive"
],
"cwd": "[SLAVE_BUILD]\\src",
"name": "submodule update"
},
{
"cmd": [
"[DEPOT_TOOLS]\\git.bat",
"-c",
"foo=bar",
"count-objects",
"-v"
],
"cwd": "[SLAVE_BUILD]\\src",
"name": "count-objects",
"stdout": "/path/to/tmp/"
},
{
"cmd": [
"[DEPOT_TOOLS]\\git.bat",
"config",
"--get",
"remote.origin.url"
],
"cwd": "[SLAVE_BUILD]\\src",
"name": "git config remote.origin.url",
"stdout": "/path/to/tmp/",
"~followup_annotations": [
"@@@STEP_TEXT@foo@@@"
]
},
{
"cmd": [
"[DEPOT_TOOLS]\\git.bat",
"show",
"HEAD",
"--format=%at",
"-s"
],
"cwd": "[SLAVE_BUILD]\\src",
"name": "git show",
"stdout": "/path/to/tmp/"
},
{
"cmd": [
"[DEPOT_TOOLS]\\git.bat",
"fetch",
"origin",
"--tags"
],
"cwd": "[SLAVE_BUILD]\\src",
"name": "git fetch tags"
},
{
"cmd": [
"[DEPOT_TOOLS]\\git.bat",
"status"
],
"cwd": "[SLAVE_BUILD]\\src",
"name": "git status"
},
{
"cmd": [
"[DEPOT_TOOLS]\\git.bat",
"status"
],
"cwd": "[SLAVE_BUILD]\\src",
"name": "git status can_fail_build"
},
{
"cmd": [
"[DEPOT_TOOLS]\\git.bat",
"status"
],
"cwd": "[SLAVE_BUILD]\\src",
"name": "git status cannot_fail_build"
},
{
"cmd": [
"[DEPOT_TOOLS]\\git.bat",
"rebase",
"origin/master"
],
"cwd": "[SLAVE_BUILD]\\src",
"name": "my repo rebase"
},
{
"cmd": [
"[DEPOT_TOOLS]\\git.bat",
"bundle",
"create",
"[SLAVE_BUILD]\\all.bundle",
"--all"
],
"cwd": "[SLAVE_BUILD]\\src",
"name": "git bundle"
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

@ -1,167 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[git]/resources/git_setup.py",
"--path",
"[SLAVE_BUILD]/src",
"--url",
"https://chromium.googlesource.com/chromium/src.git"
],
"cwd": "[SLAVE_BUILD]",
"name": "git setup"
},
{
"cmd": [
"git",
"retry",
"fetch",
"origin",
"master",
"--recurse-submodules"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git fetch"
},
{
"cmd": [
"git",
"checkout",
"-f",
"FETCH_HEAD"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git checkout"
},
{
"cmd": [
"git",
"clean",
"-f",
"-d",
"-x"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git clean"
},
{
"cmd": [
"git",
"submodule",
"sync"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "submodule sync"
},
{
"cmd": [
"git",
"submodule",
"update",
"--init",
"--recursive"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "submodule update"
},
{
"cmd": [
"git",
"-c",
"foo=bar",
"count-objects",
"-v"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "count-objects",
"stdout": "/path/to/tmp/"
},
{
"cmd": [
"git",
"config",
"--get",
"remote.origin.url"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git config remote.origin.url",
"stdout": "/path/to/tmp/",
"~followup_annotations": [
"@@@STEP_TEXT@foo@@@"
]
},
{
"cmd": [
"git",
"show",
"HEAD",
"--format=%at",
"-s"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git show",
"stdout": "/path/to/tmp/"
},
{
"cmd": [
"git",
"fetch",
"origin",
"--tags"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git fetch tags"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status can_fail_build"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status cannot_fail_build"
},
{
"cmd": [
"git",
"rebase",
"origin/master"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "my repo rebase",
"~followup_annotations": [
"step returned non-zero exit code: 1",
"@@@STEP_EXCEPTION@@@"
]
},
{
"cmd": [
"git",
"rebase",
"--abort"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "my repo rebase abort"
},
{
"name": "$result",
"reason": "Infra Failure: Step('my repo rebase') returned 1",
"status_code": 1
}
]

@ -1,167 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[git]/resources/git_setup.py",
"--path",
"[SLAVE_BUILD]/src",
"--url",
"https://chromium.googlesource.com/chromium/src.git",
"--remote",
"not_origin"
],
"cwd": "[SLAVE_BUILD]",
"name": "git setup"
},
{
"cmd": [
"git",
"retry",
"fetch",
"not_origin",
"master",
"--recurse-submodules"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git fetch"
},
{
"cmd": [
"git",
"checkout",
"-f",
"FETCH_HEAD"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git checkout"
},
{
"cmd": [
"git",
"clean",
"-f",
"-d",
"-x"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git clean"
},
{
"cmd": [
"git",
"submodule",
"sync"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "submodule sync"
},
{
"cmd": [
"git",
"submodule",
"update",
"--init",
"--recursive"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "submodule update"
},
{
"cmd": [
"git",
"-c",
"foo=bar",
"count-objects",
"-v"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "count-objects",
"stdout": "/path/to/tmp/"
},
{
"cmd": [
"git",
"config",
"--get",
"remote.origin.url"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git config remote.origin.url",
"stdout": "/path/to/tmp/",
"~followup_annotations": [
"@@@STEP_TEXT@foo@@@"
]
},
{
"cmd": [
"git",
"show",
"HEAD",
"--format=%at",
"-s"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git show",
"stdout": "/path/to/tmp/"
},
{
"cmd": [
"git",
"fetch",
"not_origin",
"--tags"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git fetch tags"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status can_fail_build"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status cannot_fail_build"
},
{
"cmd": [
"git",
"rebase",
"not_origin/master"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "my repo rebase"
},
{
"cmd": [
"git",
"bundle",
"create",
"[SLAVE_BUILD]/all.bundle",
"--all"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git bundle"
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

@ -1,178 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[git]/resources/git_setup.py",
"--path",
"[SLAVE_BUILD]/src",
"--url",
"https://chromium.googlesource.com/chromium/src.git"
],
"cwd": "[SLAVE_BUILD]",
"name": "git setup"
},
{
"cmd": [
"git",
"retry",
"fetch",
"origin",
"master",
"--recurse-submodules"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git fetch"
},
{
"cmd": [
"git",
"checkout",
"-f",
"FETCH_HEAD"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git checkout"
},
{
"cmd": [
"git",
"rev-parse",
"HEAD"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "set got_revision",
"stdout": "/path/to/tmp/",
"~followup_annotations": [
"@@@SET_BUILD_PROPERTY@got_revision@\"deadbeef\"@@@"
]
},
{
"cmd": [
"git",
"clean",
"-f",
"-d",
"-x"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git clean"
},
{
"cmd": [
"git",
"submodule",
"sync"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "submodule sync"
},
{
"cmd": [
"git",
"submodule",
"update",
"--init",
"--recursive"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "submodule update"
},
{
"cmd": [
"git",
"-c",
"foo=bar",
"count-objects",
"-v"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "count-objects",
"stdout": "/path/to/tmp/"
},
{
"cmd": [
"git",
"config",
"--get",
"remote.origin.url"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git config remote.origin.url",
"stdout": "/path/to/tmp/",
"~followup_annotations": [
"@@@STEP_TEXT@foo@@@"
]
},
{
"cmd": [
"git",
"show",
"HEAD",
"--format=%at",
"-s"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git show",
"stdout": "/path/to/tmp/"
},
{
"cmd": [
"git",
"fetch",
"origin",
"--tags"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git fetch tags"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status can_fail_build"
},
{
"cmd": [
"git",
"status"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git status cannot_fail_build"
},
{
"cmd": [
"git",
"rebase",
"origin/master"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "my repo rebase"
},
{
"cmd": [
"git",
"bundle",
"create",
"[SLAVE_BUILD]/all.bundle",
"--all"
],
"cwd": "[SLAVE_BUILD]/src",
"name": "git bundle"
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

@ -1,146 +0,0 @@
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
DEPS = [
'git',
'recipe_engine/path',
'recipe_engine/platform',
'recipe_engine/properties',
'recipe_engine/raw_io',
'recipe_engine/step',
]
def RunSteps(api):
url = 'https://chromium.googlesource.com/chromium/src.git'
# git.checkout can optionally dump GIT_CURL_VERBOSE traces to a log file,
# useful for debugging git access issues that are reproducible only on bots.
curl_trace_file = None
if api.properties.get('use_curl_trace'):
curl_trace_file = api.path['slave_build'].join('curl_trace.log')
submodule_update_force = api.properties.get('submodule_update_force', False)
submodule_update_recursive = api.properties.get('submodule_update_recursive',
True)
# You can use api.git.checkout to perform all the steps of a safe checkout.
api.git.checkout(
url,
ref=api.properties.get('revision'),
recursive=True,
submodule_update_force=submodule_update_force,
set_got_revision=api.properties.get('set_got_revision'),
curl_trace_file=curl_trace_file,
remote_name=api.properties.get('remote_name'),
display_fetch_size=api.properties.get('display_fetch_size'),
file_name=api.properties.get('checkout_file_name'),
submodule_update_recursive=submodule_update_recursive)
# count_objects shows number and size of objects in .git dir.
api.git.count_objects(
name='count-objects',
can_fail_build=api.properties.get('count_objects_can_fail_build'),
git_config_options={'foo': 'bar'})
# Get the remote URL.
api.git.get_remote_url(
step_test_data=lambda: api.raw_io.test_api.stream_output('foo'))
api.git.get_timestamp(test_data='foo')
# You can use api.git.fetch_tags to fetch all tags from the remote
api.git.fetch_tags(api.properties.get('remote_name'))
# If you need to run more arbitrary git commands, you can use api.git itself,
# which behaves like api.step(), but automatically sets the name of the step.
api.git('status', cwd=api.path['checkout'])
api.git('status', name='git status can_fail_build',
can_fail_build=True)
api.git('status', name='git status cannot_fail_build',
can_fail_build=False)
# You can use api.git.rebase to rebase the current branch onto another one
api.git.rebase(name_prefix='my repo', branch='origin/master',
dir_path=api.path['checkout'],
remote_name=api.properties.get('remote_name'))
if api.properties.get('cat_file', None):
step_result = api.git.cat_file_at_commit(api.properties['cat_file'],
api.properties['revision'],
stdout=api.raw_io.output())
if 'TestOutput' in step_result.stdout:
pass # Success!
# Bundle the repository.
api.git.bundle_create(
api.path['slave_build'].join('all.bundle'))
def GenTests(api):
yield api.test('basic')
yield api.test('basic_ref') + api.properties(revision='refs/foo/bar')
yield api.test('basic_branch') + api.properties(revision='refs/heads/testing')
yield api.test('basic_hash') + api.properties(
revision='abcdef0123456789abcdef0123456789abcdef01')
yield api.test('basic_file_name') + api.properties(checkout_file_name='DEPS')
yield api.test('basic_submodule_update_force') + api.properties(
submodule_update_force=True)
yield api.test('platform_win') + api.platform.name('win')
yield api.test('curl_trace_file') + api.properties(
revision='refs/foo/bar', use_curl_trace=True)
yield (
api.test('can_fail_build') +
api.step_data('git status can_fail_build', retcode=1)
)
yield (
api.test('cannot_fail_build') +
api.step_data('git status cannot_fail_build', retcode=1)
)
yield (
api.test('set_got_revision') +
api.properties(set_got_revision=True) +
api.step_data('set got_revision',
stdout=api.raw_io.output('deadbeef'))
)
yield (
api.test('rebase_failed') +
api.step_data('my repo rebase', retcode=1)
)
yield api.test('remote_not_origin') + api.properties(remote_name='not_origin')
yield (
api.test('count-objects_delta') +
api.properties(display_fetch_size=True))
yield (
api.test('count-objects_failed') +
api.step_data('count-objects', retcode=1))
yield (
api.test('count-objects_with_bad_output') +
api.step_data(
'count-objects',
stdout=api.raw_io.output(api.git.count_objects_output('xxx'))))
yield (
api.test('count-objects_with_bad_output_fails_build') +
api.step_data(
'count-objects',
stdout=api.raw_io.output(api.git.count_objects_output('xxx'))) +
api.properties(count_objects_can_fail_build=True))
yield (
api.test('cat-file_test') +
api.step_data('git cat-file abcdef12345:TestFile',
stdout=api.raw_io.output('TestOutput')) +
api.properties(revision='abcdef12345', cat_file='TestFile'))

@ -1,61 +0,0 @@
#!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This script ensures that a given directory is an initialized git repo."""
import argparse
import logging
import os
import subprocess
import sys
def run_git(git_cmd, *args, **kwargs):
"""Runs git with given arguments.
kwargs are passed through to subprocess.
If the kwarg 'throw' is provided, this behaves as check_call, otherwise will
return git's return value.
"""
logging.info('Running: %s %s %s', git_cmd, args, kwargs)
func = subprocess.check_call if kwargs.pop('throw', True) else subprocess.call
return func((git_cmd,)+args, **kwargs)
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--path', help='Path to prospective git repo.',
required=True)
parser.add_argument('--url', help='URL of remote to make origin.',
required=True)
parser.add_argument('--git_cmd_path',
help='Path to the git command to run.',
default='git')
parser.add_argument('--remote', help='Name of the git remote.',
default='origin')
parser.add_argument('-v', '--verbose', action='store_true')
opts = parser.parse_args()
path = opts.path
remote = opts.remote
url = opts.url
logging.getLogger().setLevel(logging.DEBUG if opts.verbose else logging.WARN)
if not os.path.exists(path):
os.makedirs(path)
if os.path.exists(os.path.join(path, '.git')):
run_git(opts.git_cmd_path, 'config', '--remove-section',
'remote.%s' % remote, cwd=path)
else:
run_git(opts.git_cmd_path, 'init', cwd=path)
run_git(opts.git_cmd_path, 'remote', 'add', remote, url, cwd=path)
return 0
if __name__ == '__main__':
sys.exit(main())

@ -1,18 +0,0 @@
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from recipe_engine import recipe_test_api
class GitTestApi(recipe_test_api.RecipeTestApi):
def count_objects_output(self, value):
return (
'count: %s\n'
'size: %s\n'
'in_pack: %s\n'
'packs: %s\n'
'size-pack: %s\n'
'prune-packable: %s\n'
'garbage: %s\n'
'size-garbage: %s\n'
) % tuple([value] * 8)

@ -1,5 +0,0 @@
DEPS = [
'recipe_engine/path',
'recipe_engine/properties',
'recipe_engine/python',
]

@ -1,89 +0,0 @@
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import urlparse
from recipe_engine import recipe_api
class RietveldApi(recipe_api.RecipeApi):
def calculate_issue_root(self, extra_patch_project_roots=None):
"""Returns path where a patch should be applied to based on "patch_project".
Maps Rietveld's "patch_project" to a path of directories relative to
api.gclient.c.solutions[0].name which describe where to place the patch.
Args:
extra_patch_project_roots: Dict mapping project names to relative roots.
Returns:
Relative path or empty string if patch_project is not set or path for a
given is unknown.
"""
# Property 'patch_project' is set by Rietveld, 'project' is set by git-try
# when TRYSERVER_PROJECT is present in codereview.settings.
patch_project = (self.m.properties.get('patch_project') or
self.m.properties.get('project'))
# Please avoid adding projects into this hard-coded list unless your project
# CLs are being run by multiple recipes. Instead pass patch_project_roots to
# ensure_checkout.
patch_project_roots = {
'angle/angle': ['third_party', 'angle'],
'blink': ['third_party', 'WebKit'],
'v8': ['v8'],
'luci-py': ['luci'],
'recipes-py': ['recipes-py'],
}
# Make sure to update common projects (above) with extra projects (and not
# vice versa, so that recipes can override default values if needed.
if extra_patch_project_roots:
patch_project_roots.update(extra_patch_project_roots)
path_parts = patch_project_roots.get(patch_project)
return self.m.path.join(*path_parts) if path_parts else ''
def apply_issue(self, *root_pieces, **kwargs):
"""Call apply_issue from depot_tools.
Args:
root_pieces (strings): location where to run apply_issue, relative to the
checkout root.
authentication (string or None): authentication scheme to use. Can be None
or 'oauth2'. See also apply_issue.py --help (-E and --no-auth options.)
"""
# TODO(pgervais): replace *root_pieces by a single Path object.
authentication = kwargs.get('authentication', None)
rietveld_url = self.m.properties['rietveld']
issue_number = self.m.properties['issue']
if authentication == 'oauth2':
step_result = self.m.python(
'apply_issue',
self.m.path['depot_tools'].join('apply_issue.py'), [
'-r', self.m.path['checkout'].join(*root_pieces),
'-i', issue_number,
'-p', self.m.properties['patchset'],
'-s', rietveld_url,
'-E', self.m.path['build'].join('site_config',
'.rietveld_client_email'),
'-k', self.m.path['build'].join('site_config',
'.rietveld_secret_key')
],
)
else:
step_result = self.m.python(
'apply_issue',
self.m.path['depot_tools'].join('apply_issue.py'), [
'-r', self.m.path['checkout'].join(*root_pieces),
'-i', issue_number,
'-p', self.m.properties['patchset'],
'-s', rietveld_url,
'--no-auth'],
)
step_result.presentation.links['Applied issue %s' % issue_number] = (
urlparse.urljoin(rietveld_url, str(issue_number)))

@ -1,31 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"[DEPOT_TOOLS]/apply_issue.py",
"-r",
"[SLAVE_BUILD]/foo/bar",
"-i",
"1",
"-p",
"1",
"-s",
"http://review_tool.url",
"-E",
"[BUILD]/site_config/.rietveld_client_email",
"-k",
"[BUILD]/site_config/.rietveld_secret_key"
],
"cwd": "[SLAVE_BUILD]",
"name": "apply_issue",
"~followup_annotations": [
"@@@STEP_LINK@Applied issue 1@http://review_tool.url/1@@@"
]
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

@ -1,23 +0,0 @@
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
DEPS = [
'recipe_engine/path',
'recipe_engine/properties',
'recipe_engine/step',
'rietveld',
]
def RunSteps(api):
api.path['checkout'] = api.path['slave_build']
api.rietveld.apply_issue('foo', 'bar', authentication='oauth2')
api.rietveld.calculate_issue_root({'project': ['']})
def GenTests(api):
yield (api.test('basic')
+ api.properties(issue=1,
patchset=1,
rietveld='http://review_tool.url')
)

@ -1,15 +0,0 @@
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
DEPS = [
'git',
'recipe_engine/json',
'recipe_engine/path',
'recipe_engine/platform',
'recipe_engine/properties',
'recipe_engine/python',
'recipe_engine/raw_io',
'rietveld',
'recipe_engine/step',
]

@ -1,247 +0,0 @@
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import contextlib
import hashlib
from recipe_engine import recipe_api
PATCH_STORAGE_RIETVELD = 'rietveld'
PATCH_STORAGE_GIT = 'git'
PATCH_STORAGE_SVN = 'svn'
class TryserverApi(recipe_api.RecipeApi):
def __init__(self, *args, **kwargs):
super(TryserverApi, self).__init__(*args, **kwargs)
self._failure_reasons = []
@property
def patch_url(self):
"""Reads patch_url property and corrects it if needed."""
url = self.m.properties.get('patch_url')
return url
@property
def is_tryserver(self):
"""Returns true iff we can apply_issue or patch."""
return (self.can_apply_issue or self.is_patch_in_svn or
self.is_patch_in_git or self.is_gerrit_issue)
@property
def can_apply_issue(self):
"""Returns true iff the properties exist to apply_issue from rietveld."""
return (self.m.properties.get('rietveld')
and 'issue' in self.m.properties
and 'patchset' in self.m.properties)
@property
def is_gerrit_issue(self):
"""Returns true iff the properties exist to match a Gerrit issue."""
return ('event.patchSet.ref' in self.m.properties and
'event.change.url' in self.m.properties and
'event.change.id' in self.m.properties)
@property
def is_patch_in_svn(self):
"""Returns true iff the properties exist to patch from a patch URL."""
return self.patch_url
@property
def is_patch_in_git(self):
return (self.m.properties.get('patch_storage') == PATCH_STORAGE_GIT and
self.m.properties.get('patch_repo_url') and
self.m.properties.get('patch_ref'))
def _apply_patch_step(self, patch_file=None, patch_content=None, root=None):
assert not (patch_file and patch_content), (
'Please only specify either patch_file or patch_content, not both!')
patch_cmd = [
'patch',
'--dir', root or self.m.path['checkout'],
'--force',
'--forward',
'--remove-empty-files',
'--strip', '0',
]
if patch_file:
patch_cmd.extend(['--input', patch_file])
self.m.step('apply patch', patch_cmd,
stdin=patch_content)
def apply_from_svn(self, cwd):
"""Downloads patch from patch_url using svn-export and applies it"""
# TODO(nodir): accept these properties as parameters
patch_url = self.patch_url
root = cwd
if root is None:
issue_root = self.m.rietveld.calculate_issue_root()
root = self.m.path['checkout'].join(issue_root)
patch_file = self.m.raw_io.output('.diff')
ext = '.bat' if self.m.platform.is_win else ''
svn_cmd = ['svn' + ext, 'export', '--force', patch_url, patch_file]
result = self.m.step('download patch', svn_cmd,
step_test_data=self.test_api.patch_content)
result.presentation.logs['patch.diff'] = (
result.raw_io.output.split('\n'))
patch_content = self.m.raw_io.input(result.raw_io.output)
self._apply_patch_step(patch_content=patch_content, root=root)
def apply_from_git(self, cwd):
"""Downloads patch from given git repo and ref and applies it"""
# TODO(nodir): accept these properties as parameters
patch_repo_url = self.m.properties['patch_repo_url']
patch_ref = self.m.properties['patch_ref']
patch_dir = self.m.path.mkdtemp('patch')
git_setup_py = self.m.path['build'].join('scripts', 'slave', 'git_setup.py')
git_setup_args = ['--path', patch_dir, '--url', patch_repo_url]
patch_path = patch_dir.join('patch.diff')
self.m.python('patch git setup', git_setup_py, git_setup_args)
self.m.git('fetch', 'origin', patch_ref,
name='patch fetch', cwd=patch_dir)
self.m.git('clean', '-f', '-d', '-x',
name='patch clean', cwd=patch_dir)
self.m.git('checkout', '-f', 'FETCH_HEAD',
name='patch git checkout', cwd=patch_dir)
self._apply_patch_step(patch_file=patch_path, root=cwd)
self.m.step('remove patch', ['rm', '-rf', patch_dir])
def determine_patch_storage(self):
"""Determines patch_storage automatically based on properties."""
storage = self.m.properties.get('patch_storage')
if storage:
return storage
if self.can_apply_issue:
return PATCH_STORAGE_RIETVELD
elif self.is_patch_in_svn:
return PATCH_STORAGE_SVN
def maybe_apply_issue(self, cwd=None, authentication=None):
"""If we're a trybot, apply a codereview issue.
Args:
cwd: If specified, apply the patch from the specified directory.
authentication: authentication scheme whenever apply_issue.py is called.
This is only used if the patch comes from Rietveld. Possible values:
None, 'oauth2' (see also api.rietveld.apply_issue.)
"""
storage = self.determine_patch_storage()
if storage == PATCH_STORAGE_RIETVELD:
return self.m.rietveld.apply_issue(
self.m.rietveld.calculate_issue_root(),
authentication=authentication)
elif storage == PATCH_STORAGE_SVN:
return self.apply_from_svn(cwd)
elif storage == PATCH_STORAGE_GIT:
return self.apply_from_git(cwd)
else:
# Since this method is "maybe", we don't raise an Exception.
pass
def get_files_affected_by_patch(self):
git_diff_kwargs = {}
issue_root = self.m.rietveld.calculate_issue_root()
if issue_root:
git_diff_kwargs['cwd'] = self.m.path['checkout'].join(issue_root)
step_result = self.m.git('diff', '--cached', '--name-only',
name='git diff to analyze patch',
stdout=self.m.raw_io.output(),
step_test_data=lambda:
self.m.raw_io.test_api.stream_output('foo.cc'),
**git_diff_kwargs)
paths = step_result.stdout.split()
if issue_root:
paths = [self.m.path.join(issue_root, path) for path in paths]
if self.m.platform.is_win:
# Looks like "analyze" wants POSIX slashes even on Windows (since git
# uses that format even on Windows).
paths = [path.replace('\\', '/') for path in paths]
step_result.presentation.logs['files'] = paths
return paths
def set_subproject_tag(self, subproject_tag):
"""Adds a subproject tag to the build.
This can be used to distinguish between builds that execute different steps
depending on what was patched, e.g. blink vs. pure chromium patches.
"""
assert self.is_tryserver
step_result = self.m.step.active_result
step_result.presentation.properties['subproject_tag'] = subproject_tag
def _set_failure_type(self, failure_type):
if not self.is_tryserver:
return
step_result = self.m.step.active_result
step_result.presentation.properties['failure_type'] = failure_type
def set_patch_failure_tryjob_result(self):
"""Mark the tryjob result as failure to apply the patch."""
self._set_failure_type('PATCH_FAILURE')
def set_compile_failure_tryjob_result(self):
"""Mark the tryjob result as a compile failure."""
self._set_failure_type('COMPILE_FAILURE')
def set_test_failure_tryjob_result(self):
"""Mark the tryjob result as a test failure.
This means we started running actual tests (not prerequisite steps
like checkout or compile), and some of these tests have failed.
"""
self._set_failure_type('TEST_FAILURE')
def set_invalid_test_results_tryjob_result(self):
"""Mark the tryjob result as having invalid test results.
This means we run some tests, but the results were not valid
(e.g. no list of specific test cases that failed, or too many
tests failing, etc).
"""
self._set_failure_type('INVALID_TEST_RESULTS')
def add_failure_reason(self, reason):
"""
Records a more detailed reason why build is failing.
The reason can be any JSON-serializable object.
"""
assert self.m.json.is_serializable(reason)
self._failure_reasons.append(reason)
@contextlib.contextmanager
def set_failure_hash(self):
"""
Context manager that sets a failure_hash build property on StepFailure.
This can be used to easily compare whether two builds have failed
for the same reason. For example, if a patch is bad (breaks something),
we'd expect it to always break in the same way. Different failures
for the same patch are usually a sign of flakiness.
"""
try:
yield
except self.m.step.StepFailure as e:
self.add_failure_reason(e.reason)
failure_hash = hashlib.sha1()
failure_hash.update(self.m.json.dumps(self._failure_reasons))
step_result = self.m.step.active_result
step_result.presentation.properties['failure_hash'] = \
failure_hash.hexdigest()
raise

@ -1,108 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"[BUILD]/scripts/slave/git_setup.py",
"--path",
"[TMP_BASE]/patch_tmp_1",
"--url",
"http://patch.url/"
],
"cwd": "[SLAVE_BUILD]",
"name": "patch git setup"
},
{
"cmd": [
"git",
"fetch",
"origin",
"johndoe#123.diff"
],
"cwd": "[TMP_BASE]/patch_tmp_1",
"name": "patch fetch"
},
{
"cmd": [
"git",
"clean",
"-f",
"-d",
"-x"
],
"cwd": "[TMP_BASE]/patch_tmp_1",
"name": "patch clean"
},
{
"cmd": [
"git",
"checkout",
"-f",
"FETCH_HEAD"
],
"cwd": "[TMP_BASE]/patch_tmp_1",
"name": "patch git checkout"
},
{
"cmd": [
"patch",
"--dir",
"[SLAVE_BUILD]",
"--force",
"--forward",
"--remove-empty-files",
"--strip",
"0",
"--input",
"[TMP_BASE]/patch_tmp_1/patch.diff"
],
"cwd": "[SLAVE_BUILD]",
"name": "apply patch"
},
{
"cmd": [
"rm",
"-rf",
"[TMP_BASE]/patch_tmp_1"
],
"cwd": "[SLAVE_BUILD]",
"name": "remove patch"
},
{
"cmd": [
"git",
"diff",
"--cached",
"--name-only"
],
"cwd": "[SLAVE_BUILD]/v8",
"name": "git diff to analyze patch",
"stdout": "/path/to/tmp/",
"~followup_annotations": [
"@@@STEP_LOG_LINE@files@v8/foo.cc@@@",
"@@@STEP_LOG_END@files@@@",
"@@@SET_BUILD_PROPERTY@failure_type@\"INVALID_TEST_RESULTS\"@@@",
"@@@SET_BUILD_PROPERTY@subproject_tag@\"v8\"@@@"
]
},
{
"cmd": [
"python",
"-u",
"import sys; sys.exit(1)"
],
"cwd": "[SLAVE_BUILD]",
"name": "fail",
"~followup_annotations": [
"step returned non-zero exit code: 1",
"@@@STEP_TEXT@foo@@@",
"@@@STEP_FAILURE@@@",
"@@@SET_BUILD_PROPERTY@failure_hash@\"c2311ad770732eade3d2f48247abd147e40a70e7\"@@@"
]
},
{
"name": "$result",
"reason": "Step('fail') failed with return_code 1",
"status_code": 1
}
]

@ -1,60 +0,0 @@
[
{
"cmd": [
"python",
"-u",
"[DEPOT_TOOLS]/apply_issue.py",
"-r",
"[SLAVE_BUILD]",
"-i",
"12853011",
"-p",
"1",
"-s",
"https://codereview.chromium.org",
"--no-auth"
],
"cwd": "[SLAVE_BUILD]",
"name": "apply_issue",
"~followup_annotations": [
"@@@STEP_LINK@Applied issue 12853011@https://codereview.chromium.org/12853011@@@"
]
},
{
"cmd": [
"git",
"diff",
"--cached",
"--name-only"
],
"cwd": "[SLAVE_BUILD]",
"name": "git diff to analyze patch",
"stdout": "/path/to/tmp/",
"~followup_annotations": [
"@@@STEP_LOG_LINE@files@foo.cc@@@",
"@@@STEP_LOG_END@files@@@",
"@@@SET_BUILD_PROPERTY@failure_type@\"INVALID_TEST_RESULTS\"@@@",
"@@@SET_BUILD_PROPERTY@subproject_tag@\"v8\"@@@"
]
},
{
"cmd": [
"python",
"-u",
"import sys; sys.exit(1)"
],
"cwd": "[SLAVE_BUILD]",
"name": "fail",
"~followup_annotations": [
"step returned non-zero exit code: 1",
"@@@STEP_TEXT@foo@@@",
"@@@STEP_FAILURE@@@",
"@@@SET_BUILD_PROPERTY@failure_hash@\"c2311ad770732eade3d2f48247abd147e40a70e7\"@@@"
]
},
{
"name": "$result",
"reason": "Step('fail') failed with return_code 1",
"status_code": 1
}
]

@ -1,71 +0,0 @@
[
{
"cmd": [
"svn",
"export",
"--force",
"svn://checkout.url",
"/path/to/tmp/diff"
],
"cwd": "[SLAVE_BUILD]",
"name": "download patch",
"~followup_annotations": [
"@@@STEP_LOG_LINE@patch.diff@fake patch.diff content (line 1)@@@",
"@@@STEP_LOG_LINE@patch.diff@fake patch.diff content (line 2)@@@",
"@@@STEP_LOG_LINE@patch.diff@@@@",
"@@@STEP_LOG_END@patch.diff@@@"
]
},
{
"cmd": [
"patch",
"--dir",
"[SLAVE_BUILD]",
"--force",
"--forward",
"--remove-empty-files",
"--strip",
"0"
],
"cwd": "[SLAVE_BUILD]",
"name": "apply patch",
"stdin": "fake patch.diff content (line 1)\nfake patch.diff content (line 2)\n"
},
{
"cmd": [
"git",
"diff",
"--cached",
"--name-only"
],
"cwd": "[SLAVE_BUILD]",
"name": "git diff to analyze patch",
"stdout": "/path/to/tmp/",
"~followup_annotations": [
"@@@STEP_LOG_LINE@files@foo.cc@@@",
"@@@STEP_LOG_END@files@@@",
"@@@SET_BUILD_PROPERTY@failure_type@\"INVALID_TEST_RESULTS\"@@@",
"@@@SET_BUILD_PROPERTY@subproject_tag@\"v8\"@@@"
]
},
{
"cmd": [
"python",
"-u",
"import sys; sys.exit(1)"
],
"cwd": "[SLAVE_BUILD]",
"name": "fail",
"~followup_annotations": [
"step returned non-zero exit code: 1",
"@@@STEP_TEXT@foo@@@",
"@@@STEP_FAILURE@@@",
"@@@SET_BUILD_PROPERTY@failure_hash@\"c2311ad770732eade3d2f48247abd147e40a70e7\"@@@"
]
},
{
"name": "$result",
"reason": "Step('fail') failed with return_code 1",
"status_code": 1
}
]

@ -1,37 +0,0 @@
[
{
"cmd": [
"[DEPOT_TOOLS]\\git.bat",
"diff",
"--cached",
"--name-only"
],
"cwd": "[SLAVE_BUILD]",
"name": "git diff to analyze patch",
"stdout": "/path/to/tmp/",
"~followup_annotations": [
"@@@STEP_LOG_LINE@files@foo.cc@@@",
"@@@STEP_LOG_END@files@@@"
]
},
{
"cmd": [
"python",
"-u",
"import sys; sys.exit(1)"
],
"cwd": "[SLAVE_BUILD]",
"name": "fail",
"~followup_annotations": [
"step returned non-zero exit code: 1",
"@@@STEP_TEXT@foo@@@",
"@@@STEP_FAILURE@@@",
"@@@SET_BUILD_PROPERTY@failure_hash@\"c2311ad770732eade3d2f48247abd147e40a70e7\"@@@"
]
},
{
"name": "$result",
"reason": "Step('fail') failed with return_code 1",
"status_code": 1
}
]

@ -1,45 +0,0 @@
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
DEPS = [
'recipe_engine/path',
'recipe_engine/platform',
'recipe_engine/properties',
'recipe_engine/python',
'tryserver',
]
def RunSteps(api):
api.path['checkout'] = api.path['slave_build']
api.tryserver.maybe_apply_issue()
api.tryserver.get_files_affected_by_patch()
if api.tryserver.is_tryserver:
api.tryserver.set_subproject_tag('v8')
api.tryserver.set_patch_failure_tryjob_result()
api.tryserver.set_compile_failure_tryjob_result()
api.tryserver.set_test_failure_tryjob_result()
api.tryserver.set_invalid_test_results_tryjob_result()
with api.tryserver.set_failure_hash():
api.python.failing_step('fail', 'foo')
def GenTests(api):
yield (api.test('with_svn_patch') +
api.properties(patch_url='svn://checkout.url'))
yield (api.test('with_git_patch') +
api.properties(
patch_storage='git',
patch_project='v8',
patch_repo_url='http://patch.url/',
patch_ref='johndoe#123.diff'))
yield (api.test('with_rietveld_patch') +
api.properties.tryserver())
yield (api.test('with_wrong_patch') + api.platform('win', 32))

@ -1,7 +0,0 @@
from recipe_engine import recipe_test_api
class TryserverTestApi(recipe_test_api.RecipeTestApi):
def patch_content(self):
return self.m.raw_io.output(
'fake patch.diff content (line 1)\n'
'fake patch.diff content (line 2)\n')
Loading…
Cancel
Save