infra_paths: do nothing if path_config is not specified

Currently if path_config is not specified, infra_paths
defaults to buildbot paths. We want to make this behavior explicit,
so we don't have to introduce a new "luci" path configuration which
tells infra_paths module to do nothing.

Buildbot now specifies path_config=buildbot since
https://chromium-review.googlesource.com/c/412029/ ,
so now we can remove this default.

This also affects all expectation files because this CL switches 
the default path configuration from Buildbot to LUCI.
In particular, it changes default git cache dir from [GIT_CACHE]
to [CACHE]/git.
Also code paths that work only in Buildbot environment has to 
have a test with path_config=buildbot.

R=iannucci@chromium.org, martiniss@chromium.org
BUG=662586

Change-Id: Ifeabe13e69810dd24a6deb4830699f8c9fafafae
Reviewed-on: https://chromium-review.googlesource.com/411989
Commit-Queue: Nodir Turakulov <nodir@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
changes/89/411989/6
Nodir Turakulov 9 years ago committed by Commit Bot
parent e672f93953
commit 7da798be10

@ -145,7 +145,7 @@ class BotUpdateApi(recipe_api.RecipeApi):
if use_site_config_creds: if use_site_config_creds:
try: try:
build_path = self.m.path['build'] build_path = self.m.path['build']
except KeyError: # pragma: no cover | TODO(nodir): cover except KeyError:
raise self.m.step.StepFailure( raise self.m.step.StepFailure(
'build path is not defined. This is normal for LUCI builds. ' 'build path is not defined. This is normal for LUCI builds. '
'In LUCI, use_site_config_creds parameter of ' 'In LUCI, use_site_config_creds parameter of '

@ -0,0 +1,50 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec",
"cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'https://chromium.googlesource.com/chromium/src.git'}]",
"--patch_root",
"src",
"--revision_mapping_file",
"{\"src\": \"got_cr_revision\"}",
"--git-cache-dir",
"[GIT_CACHE]",
"--output_json",
"/path/to/tmp/json",
"--revision",
"src@abc"
],
"env": {
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]"
},
"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,54 +1,8 @@
[ [
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec",
"cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'https://chromium.googlesource.com/chromium/src.git'}]",
"--patch_root",
"src",
"--revision_mapping_file",
"{\"src\": \"got_cr_revision\"}",
"--git-cache-dir",
"[GIT_CACHE]",
"--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"
],
"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", "name": "$result",
"reason": "build path is not defined. This is normal for LUCI builds. In LUCI, use_site_config_creds parameter of bot_update.ensure_checkout is not supported",
"recipe_result": null, "recipe_result": null,
"status_code": 0 "status_code": 1
} }
] ]

@ -0,0 +1,54 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec",
"cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'https://chromium.googlesource.com/chromium/src.git'}]",
"--patch_root",
"src",
"--revision_mapping_file",
"{\"src\": \"got_cr_revision\"}",
"--git-cache-dir",
"[GIT_CACHE]",
"--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"
],
"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
}
]

@ -63,6 +63,11 @@ def GenTests(api):
patch=False, patch=False,
revision='abc' revision='abc'
) )
yield api.test('buildbot') + api.properties(
path_config='buildbot',
patch=False,
revision='abc'
)
yield api.test('basic_with_branch_heads') + api.properties( yield api.test('basic_with_branch_heads') + api.properties(
with_branch_heads=True, with_branch_heads=True,
suffix='with branch heads' suffix='with branch heads'
@ -81,6 +86,10 @@ def GenTests(api):
yield api.test('trychange_oauth2') + api.properties( yield api.test('trychange_oauth2') + api.properties(
oauth2=True, oauth2=True,
) )
yield api.test('trychange_oauth2_buildbot') + api.properties(
path_config='buildbot',
oauth2=True,
)
yield api.test('trychange_oauth2_json') + api.properties( yield api.test('trychange_oauth2_json') + api.properties(
mastername='tryserver.chromium.linux', mastername='tryserver.chromium.linux',
buildername='linux_rel', buildername='linux_rel',

@ -85,7 +85,7 @@
"RECIPE_PACKAGE_REPO[depot_tools]/gclient.py", "RECIPE_PACKAGE_REPO[depot_tools]/gclient.py",
"config", "config",
"--spec", "--spec",
"cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'Angle', 'url': 'https://chromium.googlesource.com/angle/angle.git'}]" "cache_dir = '[CACHE]/git'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'Angle', 'url': 'https://chromium.googlesource.com/angle/angle.git'}]"
], ],
"cwd": "[START_DIR]/src/third_party", "cwd": "[START_DIR]/src/third_party",
"env": { "env": {

@ -0,0 +1,211 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_PACKAGE_REPO[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'}]"
],
"env": {
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "gclient setup"
},
{
"cmd": [
"python",
"-u",
"RECIPE_PACKAGE_REPO[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"
],
"env": {
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]"
},
"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",
"RECIPE_PACKAGE_REPO[depot_tools]/gclient.py",
"recurse",
"git",
"config",
"user.name",
"local_bot"
],
"env": {
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "gclient recurse (git config user.name)"
},
{
"cmd": [
"python",
"-u",
"RECIPE_PACKAGE_REPO[depot_tools]/gclient.py",
"recurse",
"git",
"config",
"user.email",
"local_bot@example.com"
],
"env": {
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "gclient recurse (git config user.email)"
},
{
"cmd": [
"python",
"-u",
"RECIPE_PACKAGE_REPO[depot_tools]/gclient.py",
"config",
"--spec",
"cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'Angle', 'url': 'https://chromium.googlesource.com/angle/angle.git'}]"
],
"cwd": "[START_DIR]/src/third_party",
"env": {
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "[spec: Angle] gclient setup"
},
{
"cmd": [
"python",
"-u",
"RECIPE_PACKAGE_REPO[depot_tools]/gclient.py",
"sync",
"--verbose",
"--with_branch_heads",
"--nohooks",
"-j8",
"--reset",
"--force",
"--upstream",
"--no-nag-max",
"--delete_unversioned_trees",
"--revision",
"src/third_party/angle@refs/heads/lkgr",
"--output-json",
"/path/to/tmp/json"
],
"cwd": "[START_DIR]/src/third_party",
"env": {
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "[spec: Angle] gclient sync",
"~followup_annotations": [
"@@@STEP_LOG_LINE@json.output@{@@@",
"@@@STEP_LOG_LINE@json.output@ \"solutions\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"Angle/\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"revision\": \"1fd70473fb3de634b409d4acaf49ffc1f90aae1f\"@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"src/blatley/\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"revision\": \"5e800497199d615131a76cd10651e74d7c8a0962\"@@@",
"@@@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@\"5e800497199d615131a76cd10651e74d7c8a0962\"@@@"
]
},
{
"cmd": [
"python",
"-u",
"RECIPE_PACKAGE_REPO[depot_tools]/gclient.py",
"recurse",
"git",
"config",
"user.name",
"local_bot"
],
"cwd": "[START_DIR]/src/third_party",
"env": {
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "[spec: Angle] gclient recurse (git config user.name)"
},
{
"cmd": [
"python",
"-u",
"RECIPE_PACKAGE_REPO[depot_tools]/gclient.py",
"recurse",
"git",
"config",
"user.email",
"local_bot@example.com"
],
"cwd": "[START_DIR]/src/third_party",
"env": {
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "[spec: Angle] gclient recurse (git config user.email)"
},
{
"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",
"[START_DIR]"
],
"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",
"RECIPE_PACKAGE_REPO[depot_tools]/gclient.py",
"runhooks"
],
"cwd": "[START_DIR]/src",
"env": {
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "gclient runhooks"
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

@ -87,7 +87,7 @@
"RECIPE_PACKAGE_REPO[depot_tools]/gclient.py", "RECIPE_PACKAGE_REPO[depot_tools]/gclient.py",
"config", "config",
"--spec", "--spec",
"cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'Angle', 'url': 'https://chromium.googlesource.com/angle/angle.git'}]" "cache_dir = '[CACHE]/git'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'Angle', 'url': 'https://chromium.googlesource.com/angle/angle.git'}]"
], ],
"cwd": "[START_DIR]/src/third_party", "cwd": "[START_DIR]/src/third_party",
"env": { "env": {

@ -87,7 +87,7 @@
"RECIPE_PACKAGE_REPO[depot_tools]/gclient.py", "RECIPE_PACKAGE_REPO[depot_tools]/gclient.py",
"config", "config",
"--spec", "--spec",
"cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'Angle', 'url': 'https://chromium.googlesource.com/angle/angle.git'}]" "cache_dir = '[CACHE]/git'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'Angle', 'url': 'https://chromium.googlesource.com/angle/angle.git'}]"
], ],
"cwd": "[START_DIR]/src/third_party", "cwd": "[START_DIR]/src/third_party",
"env": { "env": {

@ -95,6 +95,8 @@ def RunSteps(api):
def GenTests(api): def GenTests(api):
yield api.test('basic') yield api.test('basic')
yield api.test('buildbot') + api.properties(path_config='buildbot')
yield api.test('revision') + api.properties(revision='abc') yield api.test('revision') + api.properties(revision='abc')
yield api.test('tryserver') + api.properties.tryserver() yield api.test('tryserver') + api.properties.tryserver()

@ -18,7 +18,7 @@
"cache", "cache",
"populate", "populate",
"-c", "-c",
"[GIT_CACHE]", "[CACHE]/git",
"https://chromium.googlesource.com/chromium/src.git" "https://chromium.googlesource.com/chromium/src.git"
], ],
"cwd": "[START_DIR]/src", "cwd": "[START_DIR]/src",
@ -34,7 +34,7 @@
"exists", "exists",
"--quiet", "--quiet",
"--cache-dir", "--cache-dir",
"[GIT_CACHE]", "[CACHE]/git",
"https://chromium.googlesource.com/chromium/src.git" "https://chromium.googlesource.com/chromium/src.git"
], ],
"cwd": "[START_DIR]/src", "cwd": "[START_DIR]/src",

@ -9,9 +9,10 @@ class InfraPathsApi(recipe_api.RecipeApi):
"""infra_paths module is glue for design mistakes. It will be removed.""" """infra_paths module is glue for design mistakes. It will be removed."""
def initialize(self): def initialize(self):
# TODO(phajdan.jr): remove dupes from the engine and delete infra_ prefix. path_config = self.m.properties.get('path_config')
self.m.path.set_config( if path_config:
'infra_' + self.m.properties.get('path_config', 'buildbot')) # TODO(phajdan.jr): remove dupes from the engine and delete infra_ prefix.
self.m.path.set_config('infra_' + path_config)
@property @property
def default_git_cache_dir(self): def default_git_cache_dir(self):
@ -24,5 +25,5 @@ class InfraPathsApi(recipe_api.RecipeApi):
""" """
try: try:
return self.m.path['git_cache'] return self.m.path['git_cache']
except KeyError: # pragma: no cover | TODO(nodir): cover except KeyError:
return self.m.path['cache'].join('git') return self.m.path['cache'].join('git')

@ -4,7 +4,7 @@
"name": "show cache path", "name": "show cache path",
"~followup_annotations": [ "~followup_annotations": [
"@@@STEP_LOG_LINE@result@[CACHE]@@@", "@@@STEP_LOG_LINE@result@[CACHE]@@@",
"@@@STEP_LOG_LINE@result@[GIT_CACHE]@@@", "@@@STEP_LOG_LINE@result@[CACHE]/git@@@",
"@@@STEP_LOG_END@result@@@" "@@@STEP_LOG_END@result@@@"
] ]
}, },

@ -2,4 +2,5 @@ DEPS = [
'recipe_engine/path', 'recipe_engine/path',
'recipe_engine/properties', 'recipe_engine/properties',
'recipe_engine/python', 'recipe_engine/python',
'recipe_engine/step',
] ]

@ -67,7 +67,7 @@ class RietveldApi(recipe_api.RecipeApi):
if authentication == 'oauth2': if authentication == 'oauth2':
try: try:
build_path = self.m.path['build'] build_path = self.m.path['build']
except KeyError: # pragma: no cover | TODO(nodir): cover except KeyError:
raise self.m.step.StepFailure( raise self.m.step.StepFailure(
'build path is not defined. This is typical for LUCI builds. ' 'build path is not defined. This is typical for LUCI builds. '
'LUCI does not support rietveld.apply_issue; use bot_update instead') 'LUCI does not support rietveld.apply_issue; use bot_update instead')

@ -1,30 +1,8 @@
[ [
{
"cmd": [
"python",
"-u",
"RECIPE_PACKAGE_REPO[depot_tools]/apply_issue.py",
"-r",
"[START_DIR]/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"
],
"name": "apply_issue",
"~followup_annotations": [
"@@@STEP_LINK@Applied issue 1@http://review_tool.url/1@@@"
]
},
{ {
"name": "$result", "name": "$result",
"reason": "build path is not defined. This is typical for LUCI builds. LUCI does not support rietveld.apply_issue; use bot_update instead",
"recipe_result": null, "recipe_result": null,
"status_code": 0 "status_code": 1
} }
] ]

@ -0,0 +1,30 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_PACKAGE_REPO[depot_tools]/apply_issue.py",
"-r",
"[START_DIR]/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"
],
"name": "apply_issue",
"~followup_annotations": [
"@@@STEP_LINK@Applied issue 1@http://review_tool.url/1@@@"
]
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

@ -17,8 +17,14 @@ def RunSteps(api):
def GenTests(api): def GenTests(api):
yield (api.test('basic') yield api.test('basic') + api.properties(
+ api.properties(issue=1, issue=1,
patchset=1, patchset=1,
rietveld='http://review_tool.url') rietveld='http://review_tool.url',
) )
yield api.test('buildbot') + api.properties(
path_config='buildbot',
issue=1,
patchset=1,
rietveld='http://review_tool.url',
)

@ -106,7 +106,7 @@ class TryserverApi(recipe_api.RecipeApi):
patch_dir = self.m.path.mkdtemp('patch') patch_dir = self.m.path.mkdtemp('patch')
try: try:
build_path = self.m.path['build'] build_path = self.m.path['build']
except KeyError: # pragma: no cover | TODO(nodir): cover except KeyError:
raise self.m.step.StepFailure( raise self.m.step.StepFailure(
'path["build"] is not defined. ' 'path["build"] is not defined. '
'Possibly this is a LUCI build. ' 'Possibly this is a LUCI build. '

@ -0,0 +1,8 @@
[
{
"name": "$result",
"reason": "path[\"build\"] is not defined. Possibly this is a LUCI build. tryserver.apply_from_git is not supported in LUCI builds.",
"recipe_result": null,
"status_code": 1
}
]

@ -50,11 +50,19 @@ def GenTests(api):
yield (api.test('with_git_patch') + yield (api.test('with_git_patch') +
api.properties( api.properties(
path_config='buildbot',
patch_storage='git', patch_storage='git',
patch_project='v8', patch_project='v8',
patch_repo_url='http://patch.url/', patch_repo_url='http://patch.url/',
patch_ref='johndoe#123.diff')) patch_ref='johndoe#123.diff'))
yield (api.test('with_git_patch_luci') +
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') + yield (api.test('with_rietveld_patch') +
api.properties.tryserver() + api.properties.tryserver() +
description_step) description_step)

Loading…
Cancel
Save