Commit 75229247 authored by Edward Lesmes's avatar Edward Lesmes Committed by LUCI CQ

gclient: Set DEPOT_TOOLS_REPORT_BUILD to report bot metrics.

Recipe-Nontrivial-Roll: build_limited_scripts_slave
Recipe-Nontrivial-Roll: chrome_release
Recipe-Nontrivial-Roll: infra
Recipe-Nontrivial-Roll: build
Recipe-Nontrivial-Roll: chromiumos
Change-Id: I5c7b2188a84580a0575e9e748946e66cc7140787
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2872856Reviewed-by: 's avatarGavin Mak <gavinmak@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
parent 3da91715
......@@ -269,32 +269,32 @@ Returns (Path): The "depot_tools" root directory.
&emsp; **@property**<br>&mdash; **def [upload\_to\_google\_storage\_path](/recipes/recipe_modules/depot_tools/api.py#17)(self):**
### *recipe_modules* / [gclient](/recipes/recipe_modules/gclient)
[DEPS](/recipes/recipe_modules/gclient/__init__.py#1): [git](#recipe_modules-git), [gitiles](#recipe_modules-gitiles), [tryserver](#recipe_modules-tryserver), [recipe\_engine/context][recipe_engine/recipe_modules/context], [recipe\_engine/json][recipe_engine/recipe_modules/json], [recipe\_engine/path][recipe_engine/recipe_modules/path], [recipe\_engine/platform][recipe_engine/recipe_modules/platform], [recipe\_engine/properties][recipe_engine/recipe_modules/properties], [recipe\_engine/python][recipe_engine/recipe_modules/python], [recipe\_engine/raw\_io][recipe_engine/recipe_modules/raw_io], [recipe\_engine/step][recipe_engine/recipe_modules/step]
[DEPS](/recipes/recipe_modules/gclient/__init__.py#1): [git](#recipe_modules-git), [gitiles](#recipe_modules-gitiles), [tryserver](#recipe_modules-tryserver), [recipe\_engine/buildbucket][recipe_engine/recipe_modules/buildbucket], [recipe\_engine/context][recipe_engine/recipe_modules/context], [recipe\_engine/json][recipe_engine/recipe_modules/json], [recipe\_engine/path][recipe_engine/recipe_modules/path], [recipe\_engine/platform][recipe_engine/recipe_modules/platform], [recipe\_engine/properties][recipe_engine/recipe_modules/properties], [recipe\_engine/python][recipe_engine/recipe_modules/python], [recipe\_engine/raw\_io][recipe_engine/recipe_modules/raw_io], [recipe\_engine/step][recipe_engine/recipe_modules/step]
#### **class [GclientApi](/recipes/recipe_modules/gclient/api.py#70)([RecipeApi][recipe_engine/wkt/RecipeApi]):**
&emsp; **@property**<br>&mdash; **def [DepsDiffException](/recipes/recipe_modules/gclient/api.py#424)(self):**
&emsp; **@property**<br>&mdash; **def [DepsDiffException](/recipes/recipe_modules/gclient/api.py#431)(self):**
&mdash; **def [\_\_call\_\_](/recipes/recipe_modules/gclient/api.py#80)(self, name, cmd, infra_step=True, \*\*kwargs):**
Wrapper for easy calling of gclient steps.
&mdash; **def [break\_locks](/recipes/recipe_modules/gclient/api.py#276)(self):**
&mdash; **def [break\_locks](/recipes/recipe_modules/gclient/api.py#283)(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.
&mdash; **def [checkout](/recipes/recipe_modules/gclient/api.py#236)(self, gclient_config=None, revert=RevertOnTryserver, inject_parent_got_revision=True, extra_sync_flags=None, \*\*kwargs):**
&mdash; **def [checkout](/recipes/recipe_modules/gclient/api.py#243)(self, gclient_config=None, revert=RevertOnTryserver, inject_parent_got_revision=True, extra_sync_flags=None, \*\*kwargs):**
Return a step generator function for gclient checkouts.
&emsp; **@staticmethod**<br>&mdash; **def [config\_to\_pythonish](/recipes/recipe_modules/gclient/api.py#125)(cfg):**
&emsp; **@staticmethod**<br>&mdash; **def [config\_to\_pythonish](/recipes/recipe_modules/gclient/api.py#132)(cfg):**
&mdash; **def [diff\_deps](/recipes/recipe_modules/gclient/api.py#367)(self, cwd):**
&mdash; **def [diff\_deps](/recipes/recipe_modules/gclient/api.py#374)(self, cwd):**
&mdash; **def [get\_config\_defaults](/recipes/recipe_modules/gclient/api.py#119)(self):**
&mdash; **def [get\_config\_defaults](/recipes/recipe_modules/gclient/api.py#126)(self):**
&mdash; **def [get\_gerrit\_patch\_root](/recipes/recipe_modules/gclient/api.py#298)(self, gclient_config=None):**
&mdash; **def [get\_gerrit\_patch\_root](/recipes/recipe_modules/gclient/api.py#305)(self, gclient_config=None):**
Returns local path to the repo where gerrit patch will be applied.
......@@ -307,7 +307,7 @@ Instead, properly map a repository to a local path using repo_path_map.
TODO(nodir): remove this. Update all recipe tests to specify a git_repo
matching the recipe.
&mdash; **def [get\_repo\_path](/recipes/recipe_modules/gclient/api.py#325)(self, repo_url, gclient_config=None):**
&mdash; **def [get\_repo\_path](/recipes/recipe_modules/gclient/api.py#332)(self, repo_url, gclient_config=None):**
Returns local path to the repo checkout given its url.
......@@ -315,7 +315,7 @@ Consults cfg.repo_path_map and fallbacks to urls in configured solutions.
Returns None if not found.
&emsp; **@staticmethod**<br>&mdash; **def [got\_revision\_reverse\_mapping](/recipes/recipe_modules/gclient/api.py#130)(cfg):**
&emsp; **@staticmethod**<br>&mdash; **def [got\_revision\_reverse\_mapping](/recipes/recipe_modules/gclient/api.py#137)(cfg):**
Returns the merged got_revision_reverse_mapping.
......@@ -323,7 +323,7 @@ Returns (dict): A mapping from property name -> project name. It merges the
values of the deprecated got_revision_mapping and the new
got_revision_reverse_mapping.
&mdash; **def [inject\_parent\_got\_revision](/recipes/recipe_modules/gclient/api.py#211)(self, gclient_config=None, override=False):**
&mdash; **def [inject\_parent\_got\_revision](/recipes/recipe_modules/gclient/api.py#218)(self, gclient_config=None, override=False):**
Match gclient config to build revisions obtained from build_properties.
......@@ -333,22 +333,22 @@ Args:
override (bool) - If True, will forcibly set revision and custom_vars
even if the config already contains values for them.
&mdash; **def [resolve\_revision](/recipes/recipe_modules/gclient/api.py#147)(self, revision):**
&mdash; **def [resolve\_revision](/recipes/recipe_modules/gclient/api.py#154)(self, revision):**
&mdash; **def [runhooks](/recipes/recipe_modules/gclient/api.py#270)(self, args=None, name='runhooks', \*\*kwargs):**
&mdash; **def [runhooks](/recipes/recipe_modules/gclient/api.py#277)(self, args=None, name='runhooks', \*\*kwargs):**
&mdash; **def [set\_patch\_repo\_revision](/recipes/recipe_modules/gclient/api.py#355)(self, gclient_config=None):**
&mdash; **def [set\_patch\_repo\_revision](/recipes/recipe_modules/gclient/api.py#362)(self, gclient_config=None):**
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.
&emsp; **@spec_alias.deleter**<br>&mdash; **def [spec\_alias](/recipes/recipe_modules/gclient/api.py#115)(self):**
&emsp; **@spec_alias.deleter**<br>&mdash; **def [spec\_alias](/recipes/recipe_modules/gclient/api.py#122)(self):**
&mdash; **def [sync](/recipes/recipe_modules/gclient/api.py#152)(self, cfg, extra_sync_flags=None, \*\*kwargs):**
&mdash; **def [sync](/recipes/recipe_modules/gclient/api.py#159)(self, cfg, extra_sync_flags=None, \*\*kwargs):**
&emsp; **@use_mirror.setter**<br>&mdash; **def [use\_mirror](/recipes/recipe_modules/gclient/api.py#102)(self, val):**
&emsp; **@use_mirror.setter**<br>&mdash; **def [use\_mirror](/recipes/recipe_modules/gclient/api.py#109)(self, val):**
### *recipe_modules* / [gerrit](/recipes/recipe_modules/gerrit)
[DEPS](/recipes/recipe_modules/gerrit/__init__.py#1): [recipe\_engine/context][recipe_engine/recipe_modules/context], [recipe\_engine/json][recipe_engine/recipe_modules/json], [recipe\_engine/path][recipe_engine/recipe_modules/path], [recipe\_engine/python][recipe_engine/recipe_modules/python], [recipe\_engine/raw\_io][recipe_engine/recipe_modules/raw_io], [recipe\_engine/step][recipe_engine/recipe_modules/step]
......
DEPS = [
'git',
'gitiles',
'recipe_engine/buildbucket',
'recipe_engine/context',
'recipe_engine/json',
'recipe_engine/path',
......
......@@ -84,8 +84,15 @@ class GclientApi(recipe_api.RecipeApi):
if self.spec_alias:
prefix = ('[spec: %s] ' % self.spec_alias) + prefix
with self.m.context(
env_suffixes={'PATH': [self.repo_resource()]}):
env_suffixes = {'PATH': [self.repo_resource()]}
env = {}
if self.m.buildbucket.build.id != 0:
env['DEPOT_TOOLS_REPORT_BUILD'] = '%s/%s/%s/%s' % (
self.m.buildbucket.build.builder.project,
self.m.buildbucket.build.builder.bucket,
self.m.buildbucket.build.builder.builder,
self.m.buildbucket.build.id)
with self.m.context(env=env, env_suffixes=env_suffixes):
return self.m.python(prefix + name,
self.repo_resource('gclient.py'),
cmd,
......
......@@ -8,6 +8,9 @@
"--spec",
"cache_dir = '[CACHE]/git'\nsolutions = [{'custom_vars': {'string_var': 'string_val', 'true_var': True}, 'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'https://chromium.googlesource.com/chromium/src.git'}]"
],
"env": {
"DEPOT_TOOLS_REPORT_BUILD": "project/ci/builder/8945511751514863184"
},
"env_suffixes": {
"PATH": [
"RECIPE_REPO[depot_tools]"
......@@ -37,6 +40,9 @@
"--output-json",
"/path/to/tmp/json"
],
"env": {
"DEPOT_TOOLS_REPORT_BUILD": "project/ci/builder/8945511751514863184"
},
"env_suffixes": {
"PATH": [
"RECIPE_REPO[depot_tools]"
......@@ -66,6 +72,9 @@
"user.name",
"local_bot"
],
"env": {
"DEPOT_TOOLS_REPORT_BUILD": "project/ci/builder/8945511751514863184"
},
"env_suffixes": {
"PATH": [
"RECIPE_REPO[depot_tools]"
......@@ -85,6 +94,9 @@
"user.email",
"local_bot@example.com"
],
"env": {
"DEPOT_TOOLS_REPORT_BUILD": "project/ci/builder/8945511751514863184"
},
"env_suffixes": {
"PATH": [
"RECIPE_REPO[depot_tools]"
......@@ -103,6 +115,9 @@
"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",
"env": {
"DEPOT_TOOLS_REPORT_BUILD": "project/ci/builder/8945511751514863184"
},
"env_suffixes": {
"PATH": [
"RECIPE_REPO[depot_tools]"
......@@ -133,6 +148,9 @@
"/path/to/tmp/json"
],
"cwd": "[START_DIR]/src/third_party",
"env": {
"DEPOT_TOOLS_REPORT_BUILD": "project/ci/builder/8945511751514863184"
},
"env_suffixes": {
"PATH": [
"RECIPE_REPO[depot_tools]"
......@@ -167,6 +185,9 @@
"local_bot"
],
"cwd": "[START_DIR]/src/third_party",
"env": {
"DEPOT_TOOLS_REPORT_BUILD": "project/ci/builder/8945511751514863184"
},
"env_suffixes": {
"PATH": [
"RECIPE_REPO[depot_tools]"
......@@ -187,6 +208,9 @@
"local_bot@example.com"
],
"cwd": "[START_DIR]/src/third_party",
"env": {
"DEPOT_TOOLS_REPORT_BUILD": "project/ci/builder/8945511751514863184"
},
"env_suffixes": {
"PATH": [
"RECIPE_REPO[depot_tools]"
......@@ -227,6 +251,9 @@
"runhooks"
],
"cwd": "[START_DIR]/src",
"env": {
"DEPOT_TOOLS_REPORT_BUILD": "project/ci/builder/8945511751514863184"
},
"env_suffixes": {
"PATH": [
"RECIPE_REPO[depot_tools]"
......
......@@ -8,6 +8,9 @@
"--spec",
"cache_dir = '[CACHE]/git'\nsolutions = [{'custom_vars': {'string_var': 'string_val', 'true_var': True}, 'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'https://chromium.googlesource.com/chromium/src.git'}]"
],
"env": {
"DEPOT_TOOLS_REPORT_BUILD": "project/try/builder/8945511751514863184"
},
"env_suffixes": {
"PATH": [
"RECIPE_REPO[depot_tools]"
......@@ -35,6 +38,9 @@
"--output-json",
"/path/to/tmp/json"
],
"env": {
"DEPOT_TOOLS_REPORT_BUILD": "project/try/builder/8945511751514863184"
},
"env_suffixes": {
"PATH": [
"RECIPE_REPO[depot_tools]"
......@@ -64,6 +70,9 @@
"user.name",
"local_bot"
],
"env": {
"DEPOT_TOOLS_REPORT_BUILD": "project/try/builder/8945511751514863184"
},
"env_suffixes": {
"PATH": [
"RECIPE_REPO[depot_tools]"
......@@ -83,6 +92,9 @@
"user.email",
"local_bot@example.com"
],
"env": {
"DEPOT_TOOLS_REPORT_BUILD": "project/try/builder/8945511751514863184"
},
"env_suffixes": {
"PATH": [
"RECIPE_REPO[depot_tools]"
......@@ -101,6 +113,9 @@
"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",
"env": {
"DEPOT_TOOLS_REPORT_BUILD": "project/try/builder/8945511751514863184"
},
"env_suffixes": {
"PATH": [
"RECIPE_REPO[depot_tools]"
......@@ -131,6 +146,9 @@
"/path/to/tmp/json"
],
"cwd": "[START_DIR]/src/third_party",
"env": {
"DEPOT_TOOLS_REPORT_BUILD": "project/try/builder/8945511751514863184"
},
"env_suffixes": {
"PATH": [
"RECIPE_REPO[depot_tools]"
......@@ -165,6 +183,9 @@
"local_bot"
],
"cwd": "[START_DIR]/src/third_party",
"env": {
"DEPOT_TOOLS_REPORT_BUILD": "project/try/builder/8945511751514863184"
},
"env_suffixes": {
"PATH": [
"RECIPE_REPO[depot_tools]"
......@@ -185,6 +206,9 @@
"local_bot@example.com"
],
"cwd": "[START_DIR]/src/third_party",
"env": {
"DEPOT_TOOLS_REPORT_BUILD": "project/try/builder/8945511751514863184"
},
"env_suffixes": {
"PATH": [
"RECIPE_REPO[depot_tools]"
......@@ -225,6 +249,9 @@
"runhooks"
],
"cwd": "[START_DIR]/src",
"env": {
"DEPOT_TOOLS_REPORT_BUILD": "project/try/builder/8945511751514863184"
},
"env_suffixes": {
"PATH": [
"RECIPE_REPO[depot_tools]"
......
......@@ -23,6 +23,9 @@
"RECIPE_MODULE[depot_tools::gclient]/resources/diff_deps.py"
],
"cwd": "[CACHE]",
"env": {
"DEPOT_TOOLS_REPORT_BUILD": "project/try/builder/8945511751514863184"
},
"env_suffixes": {
"PATH": [
"RECIPE_REPO[depot_tools]"
......
......@@ -23,6 +23,9 @@
"RECIPE_MODULE[depot_tools::gclient]/resources/diff_deps.py"
],
"cwd": "[CACHE]",
"env": {
"DEPOT_TOOLS_REPORT_BUILD": "project/try/builder/8945511751514863184"
},
"env_suffixes": {
"PATH": [
"RECIPE_REPO[depot_tools]"
......@@ -61,7 +64,7 @@
"Traceback (most recent call last):",
" File \"RECIPE_REPO[depot_tools]/recipes/recipe_modules/gclient/tests/diff_deps.py\", line 33, in RunSteps",
" affected_files = api.gclient.diff_deps(api.path['cache'])",
" File \"RECIPE_REPO[depot_tools]/recipes/recipe_modules/gclient/api.py\", line 396, in diff_deps",
" File \"RECIPE_REPO[depot_tools]/recipes/recipe_modules/gclient/api.py\", line 403, in diff_deps",
" raise self.DepsDiffException(msg)",
"DepsDiffException: Couldn't checkout previous ref: fatal: bad object abcdef1234567890"
]
......
......@@ -23,6 +23,9 @@
"RECIPE_MODULE[depot_tools::gclient]/resources/diff_deps.py"
],
"cwd": "[CACHE]",
"env": {
"DEPOT_TOOLS_REPORT_BUILD": "project/try/builder/8945511751514863184"
},
"env_suffixes": {
"PATH": [
"RECIPE_REPO[depot_tools]"
......@@ -60,7 +63,7 @@
"Traceback (most recent call last):",
" File \"RECIPE_REPO[depot_tools]/recipes/recipe_modules/gclient/tests/diff_deps.py\", line 33, in RunSteps",
" affected_files = api.gclient.diff_deps(api.path['cache'])",
" File \"RECIPE_REPO[depot_tools]/recipes/recipe_modules/gclient/api.py\", line 412, in diff_deps",
" File \"RECIPE_REPO[depot_tools]/recipes/recipe_modules/gclient/api.py\", line 419, in diff_deps",
" raise self.DepsDiffException(msg)",
"DepsDiffException: Unexpected result: autoroll diff found 0 files changed"
]
......
......@@ -23,6 +23,9 @@
"RECIPE_MODULE[depot_tools::gclient]\\resources\\diff_deps.py"
],
"cwd": "[CACHE]",
"env": {
"DEPOT_TOOLS_REPORT_BUILD": "project/try/builder/8945511751514863184"
},
"env_suffixes": {
"PATH": [
"RECIPE_REPO[depot_tools]"
......
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