Commit 990ab1b4 authored by iannucci's avatar iannucci Committed by Commit bot

Remove force parameter from bot_update.ensure_checkout.

This is the simplest change I can make here. The bot_update.py script already
ignores the value of force (and sets it to True in all cases). This is an
expectations-only change.

I'll refactor the content of the bot_update.py script to account for this
removed option in a followup CL as well.

R=agable@chromium.org, estaab@chromium.org, hinoka@chromium.org, martiniss@chromium.org
BUG=643885

Review-Url: https://codereview.chromium.org/2316323002
parent 1332f33d
......@@ -67,7 +67,7 @@ class BotUpdateApi(recipe_api.RecipeApi):
def ensure_checkout(self, gclient_config=None, suffix=None,
patch=True, update_presentation=True,
force=False, patch_root=None, no_shallow=False,
patch_root=None, no_shallow=False,
with_branch_heads=False, refs=None,
patch_oauth2=False, use_site_config_creds=True,
output_manifest=True, clobber=False,
......@@ -214,8 +214,6 @@ class BotUpdateApi(recipe_api.RecipeApi):
if clobber:
cmd.append('--clobber')
if force:
cmd.append('--force')
if no_shallow:
cmd.append('--no_shallow')
if output_manifest:
......@@ -230,8 +228,7 @@ class BotUpdateApi(recipe_api.RecipeApi):
# Inject Json output for testing.
first_sln = cfg.solutions[0].name
step_test_data = lambda: self.test_api.output_json(
master, builder, slave, root, first_sln, rev_map, force,
self._fail_patch,
master, builder, slave, root, first_sln, rev_map, self._fail_patch,
output_manifest=output_manifest, fixed_revisions=fixed_revisions)
# Add suffixes to the step name, if specified.
......
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--master",
"experimental",
"--builder",
"Experimental Builder",
"--slave",
"somehost",
"--spec",
"cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'https://chromium.googlesource.com/chromium/src.git'}]",
"--root",
"src",
"--revision_mapping_file",
"{\"src\": \"got_cr_revision\"}",
"--git-cache-dir",
"[GIT_CACHE]",
"--output_json",
"/path/to/tmp/json",
"--revision",
"src@HEAD",
"--force"
],
"env": {
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]"
},
"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
}
]
\ No newline at end of file
......@@ -25,7 +25,6 @@ def RunSteps(api):
'HEAD')
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)
......@@ -44,7 +43,6 @@ def RunSteps(api):
gerrit_no_rebase_patch_ref=gerrit_no_rebase_patch_ref)
else:
api.bot_update.ensure_checkout(
force=force,
no_shallow=no_shallow,
patch=patch,
with_branch_heads=with_branch_heads,
......@@ -124,12 +122,6 @@ def GenTests(api):
rietveld='https://rietveld.example.com/',
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',
......
......@@ -11,57 +11,53 @@ from recipe_engine import recipe_test_api
class BotUpdateTestApi(recipe_test_api.RecipeTestApi):
def output_json(self, master, builder, slave, root, first_sln,
revision_mapping, force=False, fail_patch=False,
revision_mapping, fail_patch=False,
output_manifest=False, fixed_revisions=None):
"""Deterministically synthesize json.output test data for gclient's
--output-json option.
"""
active = True
output = {
'did_run': active,
'did_run': True,
'patch_failure': False
}
# Add in extra json output if active.
if active:
properties = {
property_name: self.gen_revision(project_name)
for project_name, property_name in revision_mapping.iteritems()
}
properties.update({
'%s_cp' % property_name: ('refs/heads/master@{#%s}' %
self.gen_commit_position(project_name))
for project_name, property_name in revision_mapping.iteritems()
})
properties = {
property_name: self.gen_revision(project_name)
for project_name, property_name in revision_mapping.iteritems()
}
properties.update({
'%s_cp' % property_name: ('refs/heads/master@{#%s}' %
self.gen_commit_position(project_name))
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'
})
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),
}
for project_name in revision_mapping
if output_manifest:
output.update({
'manifest': {
project_name: {
'repository': 'https://fake.org/%s.git' % project_name,
'revision': self.gen_revision(project_name),
}
})
for project_name in revision_mapping
}
})
if fixed_revisions:
output['fixed_revisions'] = fixed_revisions
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
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment