Commit 2025b984 authored by Andrii Shyshkalov's avatar Andrii Shyshkalov Committed by Commit Bot

recipes: update to stop using legacy properties.

The only exception is 'revision' of gclient's weird RevisionResolver,
which will be tackled in https://crbug.com/949334

R=ehmaldonado

Bug: 877161
Change-Id: Ic65a2d13578802cf093f2a1cfb4002fe97509b3b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1818973Reviewed-by: 's avatarEdward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@google.com>
parent 5eac9d30
......@@ -322,7 +322,7 @@ Args:
&mdash; **def [set\_patch\_repo\_revision](/recipes/recipe_modules/gclient/api.py#349)(self, gclient_config=None):**
Updates config revision corresponding to patch_project.
Updates config revision corresponding to patched project.
Useful for bot_update only, as this is the only consumer of gclient's config
revision map. This doesn't overwrite the revision if it was already set.
......@@ -979,14 +979,14 @@ Raises:
&mdash; **def [RunSteps](/recipes/recipes/fetch_end_to_end_test.py#16)(api):**
### *recipes* / [gclient:examples/full](/recipes/recipe_modules/gclient/examples/full.py)
[DEPS](/recipes/recipe_modules/gclient/examples/full.py#5): [gclient](#recipe_modules-gclient), [recipe\_engine/context][recipe_engine/recipe_modules/context], [recipe\_engine/path][recipe_engine/recipe_modules/path], [recipe\_engine/properties][recipe_engine/recipe_modules/properties], [recipe\_engine/step][recipe_engine/recipe_modules/step]
[DEPS](/recipes/recipe_modules/gclient/examples/full.py#5): [gclient](#recipe_modules-gclient), [recipe\_engine/buildbucket][recipe_engine/recipe_modules/buildbucket], [recipe\_engine/context][recipe_engine/recipe_modules/context], [recipe\_engine/path][recipe_engine/recipe_modules/path], [recipe\_engine/properties][recipe_engine/recipe_modules/properties], [recipe\_engine/step][recipe_engine/recipe_modules/step]
&mdash; **def [RunSteps](/recipes/recipe_modules/gclient/examples/full.py#53)(api):**
&mdash; **def [RunSteps](/recipes/recipe_modules/gclient/examples/full.py#54)(api):**
### *recipes* / [gclient:tests/patch\_project](/recipes/recipe_modules/gclient/tests/patch_project.py)
[DEPS](/recipes/recipe_modules/gclient/tests/patch_project.py#9): [gclient](#recipe_modules-gclient), [recipe\_engine/buildbucket][recipe_engine/recipe_modules/buildbucket], [recipe\_engine/properties][recipe_engine/recipe_modules/properties]
&mdash; **def [RunSteps](/recipes/recipe_modules/gclient/tests/patch_project.py#22)(api, patch_project, patch_repository_url):**
&mdash; **def [RunSteps](/recipes/recipe_modules/gclient/tests/patch_project.py#16)(api):**
### *recipes* / [gerrit:examples/full](/recipes/recipe_modules/gerrit/examples/full.py)
[DEPS](/recipes/recipe_modules/gerrit/examples/full.py#5): [gerrit](#recipe_modules-gerrit), [recipe\_engine/step][recipe_engine/recipe_modules/step]
......
......@@ -119,7 +119,7 @@ class BotUpdateApi(recipe_api.RecipeApi):
patch_root = patch_root or self.m.gclient.get_gerrit_patch_root(
gclient_config=cfg)
# Allow patch_project's revision if necessary.
# Allow patched project's revision if necessary.
# This is important for projects which are checked out as DEPS of the
# gclient solution.
self.m.gclient.set_patch_repo_revision(cfg)
......
......@@ -347,7 +347,7 @@ class GclientApi(recipe_api.RecipeApi):
return None
def set_patch_repo_revision(self, gclient_config=None):
"""Updates config revision corresponding to patch_project.
"""Updates config revision corresponding to patched project.
Useful for bot_update only, as this is the only consumer of gclient's config
revision map. This doesn't overwrite the revision if it was already set.
......
......@@ -128,8 +128,6 @@
"--with_tags",
"--delete_unversioned_trees",
"--revision",
"Angle@abc",
"--revision",
"src/third_party/angle@refs/heads/lkgr",
"--output-json",
"/path/to/tmp/json"
......
......@@ -4,6 +4,7 @@
DEPS = [
'gclient',
'recipe_engine/buildbucket',
'recipe_engine/context',
'recipe_engine/path',
'recipe_engine/properties',
......@@ -58,7 +59,7 @@ def RunSteps(api):
soln = src_cfg.solutions.add()
soln.name = 'src'
soln.url = 'https://chromium.googlesource.com/chromium/src.git'
soln.revision = api.properties.get('revision')
soln.revision = api.buildbucket.gitiles_commit.id
soln.custom_vars = {'string_var': 'string_val', 'true_var': True}
src_cfg.parent_got_revision_mapping['parent_got_revision'] = 'got_revision'
api.gclient.c = src_cfg
......@@ -90,6 +91,6 @@ def GenTests(api):
yield api.test('buildbot') + api.properties(path_config='buildbot')
yield api.test('revision') + api.properties(revision='abc')
yield api.test('revision') + api.buildbucket.ci_build(revision='abc')
yield api.test('tryserver') + api.properties.tryserver()
yield api.test('tryserver') + api.buildbucket.try_build()
......@@ -13,13 +13,7 @@ DEPS = [
]
PROPERTIES = {
'patch_project': recipe_api.Property(None),
'patch_repository_url': recipe_api.Property(None),
}
def RunSteps(api, patch_project, patch_repository_url):
def RunSteps(api):
src_cfg = api.gclient.make_config(CACHE_DIR='[ROOT]/git_cache')
soln = src_cfg.solutions.add()
soln.name = 'src'
......@@ -61,9 +55,7 @@ def GenTests(api):
project='chromium',
builder='linux',
git_repo='https://chromium.googlesource.com/src') +
api.properties(
expected_patch_root=None,
patch_project='chromium') +
api.properties(expected_patch_root=None) +
api.post_process(post_process.DropExpectation)
)
......@@ -73,9 +65,7 @@ def GenTests(api):
project='chromium',
builder='linux',
git_repo='https://chromium.googlesource.com/src') +
api.properties(
expected_patch_root='src',
patch_project='chromium') +
api.properties(expected_patch_root='src') +
api.post_process(post_process.DropExpectation)
)
......@@ -85,9 +75,7 @@ def GenTests(api):
project='chromium',
builder='linux',
git_repo='https://chromium.googlesource.com/v8/v8') +
api.properties(
expected_patch_root='src/v8',
patch_project='v8') +
api.properties(expected_patch_root='src/v8') +
api.post_process(post_process.DropExpectation)
)
......@@ -97,8 +85,6 @@ def GenTests(api):
project='chromium',
builder='linux',
git_repo='https://webrtc.googlesource.com/src') +
api.properties(
expected_patch_root='src/third_party/webrtc',
patch_project='webrtc') +
api.properties(expected_patch_root='src/third_party/webrtc')+
api.post_process(post_process.DropExpectation)
)
......@@ -19,5 +19,4 @@ def RunSteps(api):
def GenTests(api):
for platform in ('linux', 'mac', 'win'):
yield (api.test(platform) +
api.platform.name(platform) +
api.properties.generic(buildername='test_builder'))
api.platform.name(platform))
[
{
"cmd": [
"git",
"-c",
"core.quotePath=false",
"diff",
"--cached",
"--name-only"
],
"cwd": "[START_DIR]/v8",
"infra_step": true,
"name": "git diff to analyze patch",
"~followup_annotations": [
"@@@STEP_LOG_LINE@files@v8/foo.cc@@@",
"@@@STEP_LOG_END@files@@@"
]
},
{
"cmd": [],
"name": "TRYJOB SET SUBPROJECT_TAG",
"~followup_annotations": [
"@@@STEP_TEXT@v8@@@",
"@@@SET_BUILD_PROPERTY@subproject_tag@\"v8\"@@@"
]
},
{
"cmd": [],
"name": "TRYJOB FAILURE",
"~followup_annotations": [
"@@@STEP_TEXT@PATCH_FAILURE@@@",
"@@@SET_BUILD_PROPERTY@failure_type@\"PATCH_FAILURE\"@@@",
"@@@STEP_FAILURE@@@"
]
},
{
"cmd": [],
"name": "TRYJOB DO NOT RETRY",
"~followup_annotations": [
"@@@SET_BUILD_PROPERTY@do_not_retry@true@@@"
]
},
{
"cmd": [],
"name": "TRYJOB FAILURE (2)",
"~followup_annotations": [
"@@@STEP_TEXT@COMPILE_FAILURE@@@",
"@@@SET_BUILD_PROPERTY@failure_type@\"COMPILE_FAILURE\"@@@",
"@@@STEP_FAILURE@@@"
]
},
{
"cmd": [],
"name": "TRYJOB FAILURE (3)",
"~followup_annotations": [
"@@@STEP_TEXT@TEST_FAILURE@@@",
"@@@SET_BUILD_PROPERTY@failure_type@\"TEST_FAILURE\"@@@",
"@@@STEP_FAILURE@@@"
]
},
{
"cmd": [],
"name": "TRYJOB FAILURE (4)",
"~followup_annotations": [
"@@@STEP_TEXT@INVALID_TEST_RESULTS@@@",
"@@@SET_BUILD_PROPERTY@failure_type@\"INVALID_TEST_RESULTS\"@@@",
"@@@STEP_FAILURE@@@"
]
},
{
"cmd": [],
"name": "TRYJOB FAILURE (5)",
"~followup_annotations": [
"@@@STEP_TEXT@TEST_TIMEOUT@@@",
"@@@SET_BUILD_PROPERTY@failure_type@\"TEST_TIMEOUT\"@@@",
"@@@STEP_FAILURE@@@"
]
},
{
"cmd": [],
"name": "TRYJOB FAILURE (6)",
"~followup_annotations": [
"@@@STEP_TEXT@TEST_EXPIRED@@@",
"@@@SET_BUILD_PROPERTY@failure_type@\"TEST_EXPIRED\"@@@",
"@@@STEP_FAILURE@@@"
]
},
{
"cmd": [
"python",
"-u",
"import sys; sys.exit(1)"
],
"name": "fail",
"~followup_annotations": [
"@@@STEP_TEXT@foo@@@",
"@@@SET_BUILD_PROPERTY@failure_hash@\"622c0c52e65e6d0dc78957dd113ad343e57ae6d2\"@@@",
"@@@STEP_FAILURE@@@"
]
},
{
"failure": {
"failure": {},
"humanReason": "Step('fail') (retcode: 1)"
},
"name": "$result"
}
]
\ No newline at end of file
[
{
"cmd": [
"git",
"-c",
"core.quotePath=false",
"diff",
"--cached",
"--name-only"
],
"cwd": "[START_DIR]/v8",
"infra_step": true,
"name": "git diff to analyze patch",
"~followup_annotations": [
"@@@STEP_LOG_LINE@files@v8/foo.cc@@@",
"@@@STEP_LOG_END@files@@@"
]
},
{
"cmd": [],
"name": "TRYJOB SET SUBPROJECT_TAG",
"~followup_annotations": [
"@@@STEP_TEXT@v8@@@",
"@@@SET_BUILD_PROPERTY@subproject_tag@\"v8\"@@@"
]
},
{
"cmd": [],
"name": "TRYJOB FAILURE",
"~followup_annotations": [
"@@@STEP_TEXT@PATCH_FAILURE@@@",
"@@@SET_BUILD_PROPERTY@failure_type@\"PATCH_FAILURE\"@@@",
"@@@STEP_FAILURE@@@"
]
},
{
"cmd": [],
"name": "TRYJOB DO NOT RETRY",
"~followup_annotations": [
"@@@SET_BUILD_PROPERTY@do_not_retry@true@@@"
]
},
{
"cmd": [],
"name": "TRYJOB FAILURE (2)",
"~followup_annotations": [
"@@@STEP_TEXT@COMPILE_FAILURE@@@",
"@@@SET_BUILD_PROPERTY@failure_type@\"COMPILE_FAILURE\"@@@",
"@@@STEP_FAILURE@@@"
]
},
{
"cmd": [],
"name": "TRYJOB FAILURE (3)",
"~followup_annotations": [
"@@@STEP_TEXT@TEST_FAILURE@@@",
"@@@SET_BUILD_PROPERTY@failure_type@\"TEST_FAILURE\"@@@",
"@@@STEP_FAILURE@@@"
]
},
{
"cmd": [],
"name": "TRYJOB FAILURE (4)",
"~followup_annotations": [
"@@@STEP_TEXT@INVALID_TEST_RESULTS@@@",
"@@@SET_BUILD_PROPERTY@failure_type@\"INVALID_TEST_RESULTS\"@@@",
"@@@STEP_FAILURE@@@"
]
},
{
"cmd": [],
"name": "TRYJOB FAILURE (5)",
"~followup_annotations": [
"@@@STEP_TEXT@TEST_TIMEOUT@@@",
"@@@SET_BUILD_PROPERTY@failure_type@\"TEST_TIMEOUT\"@@@",
"@@@STEP_FAILURE@@@"
]
},
{
"cmd": [],
"name": "TRYJOB FAILURE (6)",
"~followup_annotations": [
"@@@STEP_TEXT@TEST_EXPIRED@@@",
"@@@SET_BUILD_PROPERTY@failure_type@\"TEST_EXPIRED\"@@@",
"@@@STEP_FAILURE@@@"
]
},
{
"cmd": [
"python",
"-u",
"import sys; sys.exit(1)"
],
"name": "fail",
"~followup_annotations": [
"@@@STEP_TEXT@foo@@@",
"@@@SET_BUILD_PROPERTY@failure_hash@\"622c0c52e65e6d0dc78957dd113ad343e57ae6d2\"@@@",
"@@@STEP_FAILURE@@@"
]
},
{
"failure": {
"failure": {},
"humanReason": "Step('fail') (retcode: 1)"
},
"name": "$result"
}
]
\ No newline at end of file
......@@ -34,7 +34,8 @@ def RunSteps(api):
assert (api.tryserver.gerrit_change_repo_url ==
'https://chromium.googlesource.com/chromium/src')
assert api.tryserver.gerrit_change_fetch_ref == 'refs/changes/27/91827/1'
expected_target_ref = api.properties.get('target_ref', 'refs/heads/master')
expected_target_ref = api.properties.get(
'expected_target_ref', 'refs/heads/master')
assert api.tryserver.gerrit_change_target_ref == expected_target_ref
if api.tryserver.is_gerrit_issue:
......@@ -65,23 +66,6 @@ def GenTests(api):
# The 'test_patch_root' property used below is just so that these
# tests can avoid using the gclient module to calculate the
# patch root. Normal users would use gclient.get_gerrit_patch_root().
yield (api.test('with_git_patch') +
api.properties(
path_config='buildbot',
patch_storage='git',
patch_project='v8',
patch_repo_url='http://patch.url/',
patch_ref='johndoe#123.diff',
test_patch_root='v8'))
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',
test_patch_root='v8'))
yield (api.test('with_wrong_patch') +
api.platform('win', 32) +
api.properties(test_patch_root=''))
......@@ -101,7 +85,7 @@ def GenTests(api):
git_repo='https://chromium.googlesource.com/chromium/src',
change_number=91827,
patch_set=1) +
api.properties(target_ref='refs/heads/experiment') +
api.properties(expected_target_ref='refs/heads/experiment') +
api.tryserver.gerrit_change_target_ref('refs/heads/experiment'))
yield (api.test('with_wrong_patch_new') + api.platform('win', 32) +
......
......@@ -18,9 +18,4 @@ def RunSteps(api):
def GenTests(api):
for platform in ('linux', 'mac', 'win'):
properties = {
'buildername': 'test_builder',
}
yield (api.test(platform) +
api.platform.name(platform) +
api.properties.generic(**properties))
yield api.test(platform) + api.platform.name(platform)
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