Commit 8ded2664 authored by Edward Lemur's avatar Edward Lemur Committed by Commit Bot

depot_tools: Always use depot_tools .vpython to execute presubmit recipes.

presubmit_support.py should correctly find and use .vpython files.
This will prevent issues like https://chromium-review.googlesource.com/c/infra/luci/luci-py/+/1874458

Bug: 1002153
Change-Id: I677f40b1fd2c436867cb5c6cbdeaff0d16f33a2f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1874892Reviewed-by: 's avatarRobbie Iannucci <iannucci@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
parent ea98ebbe
......@@ -757,7 +757,7 @@ Raises:
Return a presubmit step.
&mdash; **def [execute](/recipes/recipe_modules/presubmit/api.py#74)(self, bot_update_step):**
&mdash; **def [execute](/recipes/recipe_modules/presubmit/api.py#75)(self, bot_update_step):**
Runs presubmit and sets summary markdown if applicable.
......@@ -766,7 +766,7 @@ Args:
Returns:
a RawResult object, suitable for being returned from RunSteps.
&mdash; **def [prepare](/recipes/recipe_modules/presubmit/api.py#39)(self):**
&mdash; **def [prepare](/recipes/recipe_modules/presubmit/api.py#40)(self):**
Set up a presubmit run.
......
......@@ -27,6 +27,7 @@ class PresubmitApi(recipe_api.RecipeApi):
def __call__(self, *args, **kwargs):
"""Return a presubmit step."""
kwargs['venv'] = True
name = kwargs.pop('name', 'presubmit')
with self.m.depot_tools.on_path():
presubmit_args = list(args) + [
......@@ -106,16 +107,10 @@ class PresubmitApi(recipe_api.RecipeApi):
'--upstream', upstream, # '' if not in bot_update mode.
])
venv = True
# TODO(iannucci): verify that presubmit_support.py correctly finds and
# uses .vpython files, then remove this configuration.
if self._vpython_spec_path:
venv = abs_root.join(self._vpython_spec_path)
raw_result = result_pb2.RawResult()
step_json = self(
*presubmit_args,
venv=venv, timeout=self._timeout_s,
timeout=self._timeout_s,
# ok_ret='any' causes all exceptions to be ignored in this step
ok_ret='any')
# Set recipe result values
......
[
{
"cmd": [
"python",
"vpython",
"-u",
"RECIPE_REPO[depot_tools]/presubmit_support.py",
"--json_output",
......
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