Commit 6d099d54 authored by Edward Lesmes's avatar Edward Lesmes Committed by LUCI CQ

bot_update: Don't collect metrics if not running as part of a build.

When running using led, DEPOT_TOOLS_REPORT_BUILD might not be set, and
bots will try to collect metrics.

Set DEPOT_TOOLS_COLLECT_METRICS so metrics are not collected on this
case.

Recipe-Nontrivial-Roll: build
Recipe-Nontrivial-Roll: infra
Recipe-Nontrivial-Roll: build_limited_scripts_slave
Recipe-Nontrivial-Roll: chromiumos
Change-Id: I8b1083b31ef6daf87d24544a990bee863543aa1d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2946935Reviewed-by: 's avatarBen Pastene <bpastene@chromium.org>
Reviewed-by: 's avatarJosip Sokcevic <sokcevic@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
parent d3a98715
......@@ -58,12 +58,12 @@ Recipe module to ensure a checkout is consistent on a bot.
Wrapper for easy calling of bot_update.
&mdash; **def [deapply\_patch](/recipes/recipe_modules/bot_update/api.py#529)(self, bot_update_step):**
&mdash; **def [deapply\_patch](/recipes/recipe_modules/bot_update/api.py#531)(self, bot_update_step):**
Deapplies a patch, taking care of DEPS and solution revisions properly.
&mdash; **def [ensure\_checkout](/recipes/recipe_modules/bot_update/api.py#77)(self, gclient_config=None, suffix=None, patch=True, update_presentation=True, patch_root=None, with_branch_heads=False, with_tags=False, no_fetch_tags=False, refs=None, patch_oauth2=None, oauth2_json=None, use_site_config_creds=None, clobber=False, root_solution_revision=None, rietveld=None, issue=None, patchset=None, gerrit_no_reset=False, gerrit_no_rebase_patch_ref=False, assert_one_gerrit_change=True, disable_syntax_validation=False, patch_refs=None, ignore_input_commit=False, add_blamelists=False, set_output_commit=False, step_test_data=None, enforce_fetch=False, \*\*kwargs):**
&mdash; **def [ensure\_checkout](/recipes/recipe_modules/bot_update/api.py#79)(self, gclient_config=None, suffix=None, patch=True, update_presentation=True, patch_root=None, with_branch_heads=False, with_tags=False, no_fetch_tags=False, refs=None, patch_oauth2=None, oauth2_json=None, use_site_config_creds=None, clobber=False, root_solution_revision=None, rietveld=None, issue=None, patchset=None, gerrit_no_reset=False, gerrit_no_rebase_patch_ref=False, assert_one_gerrit_change=True, disable_syntax_validation=False, patch_refs=None, ignore_input_commit=False, add_blamelists=False, set_output_commit=False, step_test_data=None, enforce_fetch=False, \*\*kwargs):**
Args:
* gclient_config: The gclient configuration to use when running bot_update.
......@@ -95,7 +95,7 @@ Args:
bot_update module ONLY supports one change. Users may specify a change
via tryserver.set_change() and explicitly set this flag False.
&mdash; **def [get\_project\_revision\_properties](/recipes/recipe_modules/bot_update/api.py#506)(self, project_name, gclient_config=None):**
&mdash; **def [get\_project\_revision\_properties](/recipes/recipe_modules/bot_update/api.py#508)(self, project_name, gclient_config=None):**
Returns all property names used for storing the checked-out revision of
a given project.
......@@ -109,9 +109,9 @@ Args:
Returns (list of str): All properties that'll hold the checked-out revision
of the given project. An empty list if no such properties exist.
&emsp; **@property**<br>&mdash; **def [last\_returned\_properties](/recipes/recipe_modules/bot_update/api.py#45)(self):**
&emsp; **@property**<br>&mdash; **def [last\_returned\_properties](/recipes/recipe_modules/bot_update/api.py#47)(self):**
&mdash; **def [resolve\_fixed\_revision](/recipes/recipe_modules/bot_update/api.py#457)(self, bot_update_json, name):**
&mdash; **def [resolve\_fixed\_revision](/recipes/recipe_modules/bot_update/api.py#459)(self, bot_update_json, name):**
Sets a fixed revision for a single dependency using project revision
properties.
......
......@@ -32,7 +32,9 @@ class BotUpdateApi(recipe_api.RecipeApi):
'GIT_HTTP_LOW_SPEED_LIMIT': '102400', # in bytes
'GIT_HTTP_LOW_SPEED_TIME': 1800, # in seconds
}
if self.m.buildbucket.build.id != 0:
if self.m.buildbucket.build.id == 0:
env['DEPOT_TOOLS_COLLECT_METRICS'] = '0'
else:
env['DEPOT_TOOLS_REPORT_BUILD'] = '%s/%s/%s/%s' % (
self.m.buildbucket.build.builder.project,
self.m.buildbucket.build.builder.bucket,
......
......@@ -20,6 +20,7 @@
"--disable-syntax-validation"
],
"env": {
"DEPOT_TOOLS_COLLECT_METRICS": "0",
"GIT_HTTP_LOW_SPEED_LIMIT": "102400",
"GIT_HTTP_LOW_SPEED_TIME": "1800"
},
......@@ -130,6 +131,7 @@
"--no_fetch_tags"
],
"env": {
"DEPOT_TOOLS_COLLECT_METRICS": "0",
"GIT_HTTP_LOW_SPEED_LIMIT": "102400",
"GIT_HTTP_LOW_SPEED_TIME": "1800"
},
......
......@@ -20,6 +20,7 @@
"--disable-syntax-validation"
],
"env": {
"DEPOT_TOOLS_COLLECT_METRICS": "0",
"GIT_HTTP_LOW_SPEED_LIMIT": "102400",
"GIT_HTTP_LOW_SPEED_TIME": "1800"
},
......@@ -130,6 +131,7 @@
"--no_fetch_tags"
],
"env": {
"DEPOT_TOOLS_COLLECT_METRICS": "0",
"GIT_HTTP_LOW_SPEED_LIMIT": "102400",
"GIT_HTTP_LOW_SPEED_TIME": "1800"
},
......
......@@ -20,6 +20,7 @@
"--disable-syntax-validation"
],
"env": {
"DEPOT_TOOLS_COLLECT_METRICS": "0",
"GIT_HTTP_LOW_SPEED_LIMIT": "102400",
"GIT_HTTP_LOW_SPEED_TIME": "1800"
},
......@@ -130,6 +131,7 @@
"--no_fetch_tags"
],
"env": {
"DEPOT_TOOLS_COLLECT_METRICS": "0",
"GIT_HTTP_LOW_SPEED_LIMIT": "102400",
"GIT_HTTP_LOW_SPEED_TIME": "1800"
},
......
......@@ -19,6 +19,7 @@
"--disable-syntax-validation"
],
"env": {
"DEPOT_TOOLS_COLLECT_METRICS": "0",
"GIT_HTTP_LOW_SPEED_LIMIT": "102400",
"GIT_HTTP_LOW_SPEED_TIME": "1800"
},
......@@ -129,6 +130,7 @@
"--no_fetch_tags"
],
"env": {
"DEPOT_TOOLS_COLLECT_METRICS": "0",
"GIT_HTTP_LOW_SPEED_LIMIT": "102400",
"GIT_HTTP_LOW_SPEED_TIME": "1800"
},
......
......@@ -23,6 +23,7 @@
"--disable-syntax-validation"
],
"env": {
"DEPOT_TOOLS_COLLECT_METRICS": "0",
"GIT_HTTP_LOW_SPEED_LIMIT": "102400",
"GIT_HTTP_LOW_SPEED_TIME": "1800"
},
......@@ -133,6 +134,7 @@
"--no_fetch_tags"
],
"env": {
"DEPOT_TOOLS_COLLECT_METRICS": "0",
"GIT_HTTP_LOW_SPEED_LIMIT": "102400",
"GIT_HTTP_LOW_SPEED_TIME": "1800"
},
......
......@@ -21,6 +21,7 @@
"--disable-syntax-validation"
],
"env": {
"DEPOT_TOOLS_COLLECT_METRICS": "0",
"GIT_HTTP_LOW_SPEED_LIMIT": "102400",
"GIT_HTTP_LOW_SPEED_TIME": "1800"
},
......@@ -131,6 +132,7 @@
"--no_fetch_tags"
],
"env": {
"DEPOT_TOOLS_COLLECT_METRICS": "0",
"GIT_HTTP_LOW_SPEED_LIMIT": "102400",
"GIT_HTTP_LOW_SPEED_TIME": "1800"
},
......
......@@ -19,6 +19,7 @@
"--disable-syntax-validation"
],
"env": {
"DEPOT_TOOLS_COLLECT_METRICS": "0",
"GIT_HTTP_LOW_SPEED_LIMIT": "102400",
"GIT_HTTP_LOW_SPEED_TIME": "1800"
},
......@@ -129,6 +130,7 @@
"--no_fetch_tags"
],
"env": {
"DEPOT_TOOLS_COLLECT_METRICS": "0",
"GIT_HTTP_LOW_SPEED_LIMIT": "102400",
"GIT_HTTP_LOW_SPEED_TIME": "1800"
},
......
......@@ -20,6 +20,7 @@
"--experiments=no_sync,cool_experiment"
],
"env": {
"DEPOT_TOOLS_COLLECT_METRICS": "0",
"GIT_HTTP_LOW_SPEED_LIMIT": "102400",
"GIT_HTTP_LOW_SPEED_TIME": "1800"
},
......@@ -131,6 +132,7 @@
"--experiments=no_sync,cool_experiment"
],
"env": {
"DEPOT_TOOLS_COLLECT_METRICS": "0",
"GIT_HTTP_LOW_SPEED_LIMIT": "102400",
"GIT_HTTP_LOW_SPEED_TIME": "1800"
},
......
......@@ -20,6 +20,7 @@
"--disable-syntax-validation"
],
"env": {
"DEPOT_TOOLS_COLLECT_METRICS": "0",
"GIT_HTTP_LOW_SPEED_LIMIT": "102400",
"GIT_HTTP_LOW_SPEED_TIME": "1800"
},
......@@ -130,6 +131,7 @@
"--no_fetch_tags"
],
"env": {
"DEPOT_TOOLS_COLLECT_METRICS": "0",
"GIT_HTTP_LOW_SPEED_LIMIT": "102400",
"GIT_HTTP_LOW_SPEED_TIME": "1800"
},
......
......@@ -18,6 +18,7 @@
"depot_tools@HEAD"
],
"env": {
"DEPOT_TOOLS_COLLECT_METRICS": "0",
"GIT_HTTP_LOW_SPEED_LIMIT": "102400",
"GIT_HTTP_LOW_SPEED_TIME": "1800"
},
......
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