diff --git a/recipes/README.recipes.md b/recipes/README.recipes.md index 76c1910d1..df947ba4f 100644 --- a/recipes/README.recipes.md +++ b/recipes/README.recipes.md @@ -375,7 +375,7 @@ Returns: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#submit-change ### *recipe_modules* / [git](/recipes/recipe_modules/git) -[DEPS](/recipes/recipe_modules/git/__init__.py#3): [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/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/runtime][recipe_engine/recipe_modules/runtime], [recipe\_engine/step][recipe_engine/recipe_modules/step] +[DEPS](/recipes/recipe_modules/git/__init__.py#3): [depot\_tools](#recipe_modules-depot_tools), [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/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/runtime][recipe_engine/recipe_modules/runtime], [recipe\_engine/step][recipe_engine/recipe_modules/step] PYTHON_VERSION_COMPATIBILITY: PY2+3 diff --git a/recipes/recipe_modules/git/__init__.py b/recipes/recipe_modules/git/__init__.py index 8e6c8e090..b49b0a490 100644 --- a/recipes/recipe_modules/git/__init__.py +++ b/recipes/recipe_modules/git/__init__.py @@ -1,6 +1,7 @@ PYTHON_VERSION_COMPATIBILITY = 'PY2+3' DEPS = [ + 'depot_tools', 'recipe_engine/buildbucket', 'recipe_engine/context', 'recipe_engine/runtime', diff --git a/recipes/recipe_modules/git/api.py b/recipes/recipe_modules/git/api.py index fe548fb7c..605e59b14 100644 --- a/recipes/recipe_modules/git/api.py +++ b/recipes/recipe_modules/git/api.py @@ -451,7 +451,12 @@ class GitApi(recipe_api.RecipeApi): args = ['number'] args.extend(commitrefs or []) - step_result = self(*args, - stdout=self.m.raw_io.output_text(add_output_log=True), - step_test_data=step_test_data) + # Put depot_tools on the path so that git-number can be found + with self.m.depot_tools.on_path(): + # git-number is only meant for use on bots, so it prints an error message + # if CHROME_HEADLESS is not set + with self.m.context(env={'CHROME_HEADLESS': '1'}): + step_result = self(*args, + stdout=self.m.raw_io.output_text(add_output_log=True), + step_test_data=step_test_data) return [l.strip() for l in step_result.stdout.strip().splitlines()]