From c6512213a7b74a8363c93788a9c376ebaeb4ec6c Mon Sep 17 00:00:00 2001 From: Edward Lemur Date: Mon, 14 Oct 2019 21:28:16 +0000 Subject: [PATCH] depot_tools: Run recipe scripts using vpython. This is a reland of 88d7869db09169044c1a0b2d1fbb57f11ffaee2a Original change's description: > Reland "depot_tools: Add httplib2 to .vpython" > > This is a reland of e1410883a38ac3a3491ed470883ec405193442f6 > > Use vpython to execute git_cl.py, gerrit_util.py and presubmit_support.py on recipes. > > Original change's description: > > depot_tools: Add httplib2 to .vpython > > > > Check that things won't break before further changes are made. > > > > Bug: 1002153 > > Change-Id: I41866f26334bf9ec2732bc0f25007234a95130e4 > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1854749 > > Auto-Submit: Edward Lesmes > > Commit-Queue: Andrii Shyshkalov > > Reviewed-by: Andrii Shyshkalov > > Bug: 1002153 > Recipe-Nontrivial-Roll: build > Recipe-Nontrivial-Roll: chromiumos > Recipe-Nontrivial-Roll: infra > Recipe-Nontrivial-Roll: skia > Recipe-Nontrivial-Roll: build_limited_scripts_slave > Recipe-Nontrivial-Roll: release_scripts > Change-Id: Id94057eae8830dec197257df3ea35c0c4ff946b7 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1856650 > Reviewed-by: Andrii Shyshkalov > Commit-Queue: Edward Lesmes Bug: 1002153 Recipe-Nontrivial-Roll: build Recipe-Nontrivial-Roll: infra Recipe-Nontrivial-Roll: skia Recipe-Nontrivial-Roll: build_limited_scripts_slave Recipe-Nontrivial-Roll: release_scripts Change-Id: If071bfd2e4514a06deec2c0d4196b4953841b64f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1859895 Commit-Queue: Edward Lesmes Reviewed-by: Anthony Polito Reviewed-by: Andrii Shyshkalov --- recipes/README.recipes.md | 12 ++++++------ .../deprecated_got_revision_mapping.json | 2 +- .../full.expected/no_apply_patch_on_gclient.json | 2 +- .../examples/full.expected/tryjob_fail.json | 2 +- .../examples/full.expected/tryjob_fail_patch.json | 2 +- .../full.expected/tryjob_fail_patch_download.json | 2 +- .../full.expected/tryjob_gerrit_angle.json | 2 +- .../full.expected/tryjob_gerrit_branch_heads.json | 2 +- .../tryjob_gerrit_feature_branch.json | 2 +- .../tryjob_gerrit_v8_feature_branch.json | 2 +- .../full.expected/tryjob_gerrit_webrtc.json | 2 +- .../examples/full.expected/tryjob_v8.json | 2 +- .../full.expected/tryjob_v8_head_by_default.json | 2 +- recipes/recipe_modules/gerrit/api.py | 1 + .../gerrit/examples/full.expected/basic.json | 14 +++++++------- recipes/recipe_modules/git_cl/api.py | 2 +- .../git_cl/examples/full.expected/basic.json | 14 +++++++------- recipes/recipe_modules/presubmit/api.py | 2 +- .../examples/full.expected/with_gerrit_patch.json | 4 ++-- .../with_gerrit_patch_and_target_ref.json | 4 ++-- 20 files changed, 39 insertions(+), 38 deletions(-) diff --git a/recipes/README.recipes.md b/recipes/README.recipes.md index a9e12e727..8d32c9431 100644 --- a/recipes/README.recipes.md +++ b/recipes/README.recipes.md @@ -344,16 +344,16 @@ Module for interact with gerrit endpoints Wrapper for easy calling of gerrit_utils steps. -— **def [abandon\_change](/recipes/recipe_modules/gerrit/api.py#159)(self, host, change, message=None, name=None, step_test_data=None):** +— **def [abandon\_change](/recipes/recipe_modules/gerrit/api.py#160)(self, host, change, message=None, name=None, step_test_data=None):** -— **def [create\_gerrit\_branch](/recipes/recipe_modules/gerrit/api.py#31)(self, host, project, branch, commit, \*\*kwargs):** +— **def [create\_gerrit\_branch](/recipes/recipe_modules/gerrit/api.py#32)(self, host, project, branch, commit, \*\*kwargs):** Create a new branch from given project and commit Returns: the ref of the branch created -— **def [get\_change\_description](/recipes/recipe_modules/gerrit/api.py#72)(self, host, change, patchset):** +— **def [get\_change\_description](/recipes/recipe_modules/gerrit/api.py#73)(self, host, change, patchset):** Get the description for a given CL and patchset. @@ -365,7 +365,7 @@ Args: Returns: The description corresponding to given CL and patchset. -— **def [get\_changes](/recipes/recipe_modules/gerrit/api.py#117)(self, host, query_params, start=None, limit=None, o_params=None, step_test_data=None, \*\*kwargs):** +— **def [get\_changes](/recipes/recipe_modules/gerrit/api.py#118)(self, host, query_params, start=None, limit=None, o_params=None, step_test_data=None, \*\*kwargs):** Query changes for the given host. @@ -383,14 +383,14 @@ Returns: A list of change dicts as documented here: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-changes -— **def [get\_gerrit\_branch](/recipes/recipe_modules/gerrit/api.py#53)(self, host, project, branch, \*\*kwargs):** +— **def [get\_gerrit\_branch](/recipes/recipe_modules/gerrit/api.py#54)(self, host, project, branch, \*\*kwargs):** Get a branch from given project and commit Returns: the revision of the branch -— **def [get\_revision\_info](/recipes/recipe_modules/gerrit/api.py#87)(self, host, change, patchset):** +— **def [get\_revision\_info](/recipes/recipe_modules/gerrit/api.py#88)(self, host, change, patchset):** Returns the info for a given patchset of a given change. diff --git a/recipes/recipe_modules/bot_update/examples/full.expected/deprecated_got_revision_mapping.json b/recipes/recipe_modules/bot_update/examples/full.expected/deprecated_got_revision_mapping.json index c86183a51..5a7faf4cd 100644 --- a/recipes/recipe_modules/bot_update/examples/full.expected/deprecated_got_revision_mapping.json +++ b/recipes/recipe_modules/bot_update/examples/full.expected/deprecated_got_revision_mapping.json @@ -1,7 +1,7 @@ [ { "cmd": [ - "python", + "vpython", "-u", "RECIPE_REPO[depot_tools]/gerrit_client.py", "changes", diff --git a/recipes/recipe_modules/bot_update/examples/full.expected/no_apply_patch_on_gclient.json b/recipes/recipe_modules/bot_update/examples/full.expected/no_apply_patch_on_gclient.json index eb1ea8b0a..1c496d352 100644 --- a/recipes/recipe_modules/bot_update/examples/full.expected/no_apply_patch_on_gclient.json +++ b/recipes/recipe_modules/bot_update/examples/full.expected/no_apply_patch_on_gclient.json @@ -1,7 +1,7 @@ [ { "cmd": [ - "python", + "vpython", "-u", "RECIPE_REPO[depot_tools]/gerrit_client.py", "changes", diff --git a/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail.json b/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail.json index ae558fb78..cf0341d08 100644 --- a/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail.json +++ b/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail.json @@ -1,7 +1,7 @@ [ { "cmd": [ - "python", + "vpython", "-u", "RECIPE_REPO[depot_tools]/gerrit_client.py", "changes", diff --git a/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail_patch.json b/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail_patch.json index 71b9132df..d35179c9b 100644 --- a/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail_patch.json +++ b/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail_patch.json @@ -1,7 +1,7 @@ [ { "cmd": [ - "python", + "vpython", "-u", "RECIPE_REPO[depot_tools]/gerrit_client.py", "changes", diff --git a/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail_patch_download.json b/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail_patch_download.json index cfde7a9ce..a42112fc9 100644 --- a/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail_patch_download.json +++ b/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail_patch_download.json @@ -1,7 +1,7 @@ [ { "cmd": [ - "python", + "vpython", "-u", "RECIPE_REPO[depot_tools]/gerrit_client.py", "changes", diff --git a/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_angle.json b/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_angle.json index eb1ea8b0a..1c496d352 100644 --- a/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_angle.json +++ b/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_angle.json @@ -1,7 +1,7 @@ [ { "cmd": [ - "python", + "vpython", "-u", "RECIPE_REPO[depot_tools]/gerrit_client.py", "changes", diff --git a/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_branch_heads.json b/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_branch_heads.json index 5641ce512..621ef0fca 100644 --- a/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_branch_heads.json +++ b/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_branch_heads.json @@ -1,7 +1,7 @@ [ { "cmd": [ - "python", + "vpython", "-u", "RECIPE_REPO[depot_tools]/gerrit_client.py", "changes", diff --git a/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_feature_branch.json b/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_feature_branch.json index 139147bbf..beed9a511 100644 --- a/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_feature_branch.json +++ b/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_feature_branch.json @@ -1,7 +1,7 @@ [ { "cmd": [ - "python", + "vpython", "-u", "RECIPE_REPO[depot_tools]/gerrit_client.py", "changes", diff --git a/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_v8_feature_branch.json b/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_v8_feature_branch.json index 89fadef83..8bd5a4f31 100644 --- a/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_v8_feature_branch.json +++ b/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_v8_feature_branch.json @@ -1,7 +1,7 @@ [ { "cmd": [ - "python", + "vpython", "-u", "RECIPE_REPO[depot_tools]/gerrit_client.py", "changes", diff --git a/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_webrtc.json b/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_webrtc.json index d11a80d4a..a43fd3b2a 100644 --- a/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_webrtc.json +++ b/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_webrtc.json @@ -1,7 +1,7 @@ [ { "cmd": [ - "python", + "vpython", "-u", "RECIPE_REPO[depot_tools]/gerrit_client.py", "changes", diff --git a/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_v8.json b/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_v8.json index d616b344f..a0f6e80fe 100644 --- a/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_v8.json +++ b/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_v8.json @@ -1,7 +1,7 @@ [ { "cmd": [ - "python", + "vpython", "-u", "RECIPE_REPO[depot_tools]/gerrit_client.py", "changes", diff --git a/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_v8_head_by_default.json b/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_v8_head_by_default.json index bb2c38ad6..bba65b517 100644 --- a/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_v8_head_by_default.json +++ b/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_v8_head_by_default.json @@ -1,7 +1,7 @@ [ { "cmd": [ - "python", + "vpython", "-u", "RECIPE_REPO[depot_tools]/gerrit_client.py", "changes", diff --git a/recipes/recipe_modules/gerrit/api.py b/recipes/recipe_modules/gerrit/api.py index 94a0e0a3f..27a3e60b8 100644 --- a/recipes/recipe_modules/gerrit/api.py +++ b/recipes/recipe_modules/gerrit/api.py @@ -26,6 +26,7 @@ class GerritApi(recipe_api.RecipeApi): self.repo_resource('gerrit_client.py'), cmd, infra_step=infra_step, + venv=True, **kwargs) def create_gerrit_branch(self, host, project, branch, commit, **kwargs): diff --git a/recipes/recipe_modules/gerrit/examples/full.expected/basic.json b/recipes/recipe_modules/gerrit/examples/full.expected/basic.json index 5cf761854..02ad3eb53 100644 --- a/recipes/recipe_modules/gerrit/examples/full.expected/basic.json +++ b/recipes/recipe_modules/gerrit/examples/full.expected/basic.json @@ -1,7 +1,7 @@ [ { "cmd": [ - "python", + "vpython", "-u", "RECIPE_REPO[depot_tools]/gerrit_client.py", "branch", @@ -32,7 +32,7 @@ }, { "cmd": [ - "python", + "vpython", "-u", "RECIPE_REPO[depot_tools]/gerrit_client.py", "branchinfo", @@ -60,7 +60,7 @@ }, { "cmd": [ - "python", + "vpython", "-u", "RECIPE_REPO[depot_tools]/gerrit_client.py", "changes", @@ -110,7 +110,7 @@ }, { "cmd": [ - "python", + "vpython", "-u", "RECIPE_REPO[depot_tools]/gerrit_client.py", "changes", @@ -137,7 +137,7 @@ }, { "cmd": [ - "python", + "vpython", "-u", "RECIPE_REPO[depot_tools]/gerrit_client.py", "changes", @@ -185,7 +185,7 @@ }, { "cmd": [ - "python", + "vpython", "-u", "RECIPE_REPO[depot_tools]/gerrit_client.py", "abandon", @@ -229,7 +229,7 @@ }, { "cmd": [ - "python", + "vpython", "-u", "RECIPE_REPO[depot_tools]/gerrit_client.py", "changes", diff --git a/recipes/recipe_modules/git_cl/api.py b/recipes/recipe_modules/git_cl/api.py index 732aa1be8..c4e1e349d 100644 --- a/recipes/recipe_modules/git_cl/api.py +++ b/recipes/recipe_modules/git_cl/api.py @@ -18,7 +18,7 @@ class GitClApi(recipe_api.RecipeApi): with self.m.context(cwd=self.m.context.cwd or my_loc): return self.m.python( name, self.repo_resource('git_cl.py'), [subcmd] + args, - **kwargs) + venv=True, **kwargs) def get_description(self, patch_url=None, codereview=None, **kwargs): """DEPRECATED. Consider using gerrit.get_change_description instead.""" diff --git a/recipes/recipe_modules/git_cl/examples/full.expected/basic.json b/recipes/recipe_modules/git_cl/examples/full.expected/basic.json index 6f0b33085..1bb2db34c 100644 --- a/recipes/recipe_modules/git_cl/examples/full.expected/basic.json +++ b/recipes/recipe_modules/git_cl/examples/full.expected/basic.json @@ -1,7 +1,7 @@ [ { "cmd": [ - "python", + "vpython", "-u", "RECIPE_REPO[depot_tools]/git_cl.py", "upload", @@ -12,7 +12,7 @@ }, { "cmd": [ - "python", + "vpython", "-u", "RECIPE_REPO[depot_tools]/git_cl.py", "issue" @@ -21,7 +21,7 @@ }, { "cmd": [ - "python", + "vpython", "-u", "RECIPE_REPO[depot_tools]/git_cl.py", "description", @@ -33,7 +33,7 @@ }, { "cmd": [ - "python", + "vpython", "-u", "RECIPE_REPO[depot_tools]/git_cl.py", "description", @@ -54,7 +54,7 @@ }, { "cmd": [ - "python", + "vpython", "-u", "RECIPE_REPO[depot_tools]/git_cl.py", "description", @@ -72,7 +72,7 @@ }, { "cmd": [ - "python", + "vpython", "-u", "RECIPE_REPO[depot_tools]/git_cl.py", "description", @@ -85,7 +85,7 @@ }, { "cmd": [ - "python", + "vpython", "-u", "RECIPE_REPO[depot_tools]/git_cl.py", "description", diff --git a/recipes/recipe_modules/presubmit/api.py b/recipes/recipe_modules/presubmit/api.py index c6690dee1..3fa7b9d4f 100644 --- a/recipes/recipe_modules/presubmit/api.py +++ b/recipes/recipe_modules/presubmit/api.py @@ -106,7 +106,7 @@ class PresubmitApi(recipe_api.RecipeApi): '--upstream', upstream, # '' if not in bot_update mode. ]) - venv = None + venv = True # TODO(iannucci): verify that presubmit_support.py correctly finds and # uses .vpython files, then remove this configuration. if self._vpython_spec_path: diff --git a/recipes/recipe_modules/tryserver/examples/full.expected/with_gerrit_patch.json b/recipes/recipe_modules/tryserver/examples/full.expected/with_gerrit_patch.json index d3adadfb4..3c04236c3 100644 --- a/recipes/recipe_modules/tryserver/examples/full.expected/with_gerrit_patch.json +++ b/recipes/recipe_modules/tryserver/examples/full.expected/with_gerrit_patch.json @@ -1,7 +1,7 @@ [ { "cmd": [ - "python", + "vpython", "-u", "RECIPE_REPO[depot_tools]/gerrit_client.py", "changes", @@ -41,7 +41,7 @@ }, { "cmd": [ - "python", + "vpython", "-u", "RECIPE_REPO[depot_tools]/gerrit_client.py", "changes", diff --git a/recipes/recipe_modules/tryserver/examples/full.expected/with_gerrit_patch_and_target_ref.json b/recipes/recipe_modules/tryserver/examples/full.expected/with_gerrit_patch_and_target_ref.json index 0a7368bbc..288bcdbbd 100644 --- a/recipes/recipe_modules/tryserver/examples/full.expected/with_gerrit_patch_and_target_ref.json +++ b/recipes/recipe_modules/tryserver/examples/full.expected/with_gerrit_patch_and_target_ref.json @@ -1,7 +1,7 @@ [ { "cmd": [ - "python", + "vpython", "-u", "RECIPE_REPO[depot_tools]/gerrit_client.py", "changes", @@ -41,7 +41,7 @@ }, { "cmd": [ - "python", + "vpython", "-u", "RECIPE_REPO[depot_tools]/gerrit_client.py", "changes",