Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(290)

Unified Diff: recipes/recipe_modules/recipe_autoroller/api.py

Issue 2249413005: recipe_autoroller: pass cwd=workdir directly, not using a context (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | recipes/recipes/recipe_autoroller.expected/basic.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipes/recipe_modules/recipe_autoroller/api.py
diff --git a/recipes/recipe_modules/recipe_autoroller/api.py b/recipes/recipe_modules/recipe_autoroller/api.py
index e1d4ec8664bda6dd7414f4c68609430dc1582982..ca236920f3cdb8c9e89b906ffe83f80e5dea4599 100644
--- a/recipes/recipe_modules/recipe_autoroller/api.py
+++ b/recipes/recipe_modules/recipe_autoroller/api.py
@@ -179,9 +179,8 @@ class RecipeAutorollerApi(recipe_api.RecipeApi):
# Check status of last known CL for this repo. Ensure there's always
# at most one roll CL in flight.
- with self.m.step.context({'cwd': workdir}):
- repo_data, cl_status = self._get_pending_cl_status(
- project_data['repo_url'])
+ repo_data, cl_status = self._get_pending_cl_status(
+ project_data['repo_url'], workdir)
if repo_data:
# Allow trivial rolls in CQ to finish.
if repo_data['trivial'] and cl_status == 'commit':
@@ -334,7 +333,7 @@ class RecipeAutorollerApi(recipe_api.RecipeApi):
'recipe-roller-cl-uploads',
'repo_metadata/%s' % base64.urlsafe_b64encode(repo_url))
- def _get_pending_cl_status(self, repo_url):
+ def _get_pending_cl_status(self, repo_url, workdir):
"""Returns (current_repo_data, git_cl_status_string) of the last known
roll CL for given repo.
@@ -371,6 +370,7 @@ class RecipeAutorollerApi(recipe_api.RecipeApi):
'--rietveld',
'--field', 'status',
name='git cl status', stdout=self.m.raw_io.output(),
+ cwd=workdir,
step_test_data=lambda: self.m.raw_io.test_api.stream_output(
'foo')
).stdout.strip()
« no previous file with comments | « no previous file | recipes/recipes/recipe_autoroller.expected/basic.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698