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

Side by Side Diff: recipes/recipe_modules/recipe_autoroller/api.py

Issue 2212353002: recipe_autoroller: use git cache (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 unified diff | Download patch
« no previous file with comments | « no previous file | recipes/recipes/recipe_autoroller.expected/basic.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import hashlib 5 import hashlib
6 import json 6 import json
7 import re 7 import re
8 8
9 from recipe_engine import recipe_api 9 from recipe_engine import recipe_api
10 10
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 # New commit in A repo will need to get rolled into B first. However, 156 # New commit in A repo will need to get rolled into B first. However,
157 # it'd also appear as a candidate for C roll, leading to a failure there. 157 # it'd also appear as a candidate for C roll, leading to a failure there.
158 if ROLL_FAILURE in results and ROLL_SUCCESS not in results: 158 if ROLL_FAILURE in results and ROLL_SUCCESS not in results:
159 self.m.python.failing_step( 159 self.m.python.failing_step(
160 'roll result', 160 'roll result',
161 'manual intervention needed: automated roll attempt failed') 161 'manual intervention needed: automated roll attempt failed')
162 162
163 def _roll_project(self, project_data, recipes_dir): 163 def _roll_project(self, project_data, recipes_dir):
164 with self.m.tempfile.temp_dir('roll_%s' % project_data['id']) as workdir: 164 with self.m.tempfile.temp_dir('roll_%s' % project_data['id']) as workdir:
165 self.m.git.checkout( 165 self.m.git.checkout(
166 project_data['repo_url'], dir_path=workdir, submodules=False) 166 project_data['repo_url'], dir_path=workdir, submodules=False,
167 use_git_cache=True)
167 168
168 # Introduce ourselves to git - also needed for git cl upload to work. 169 # Introduce ourselves to git - also needed for git cl upload to work.
169 self.m.git( 170 self.m.git(
170 'config', 'user.email', 'recipe-roller@chromium.org', cwd=workdir) 171 'config', 'user.email', 'recipe-roller@chromium.org', cwd=workdir)
171 self.m.git('config', 'user.name', 'recipe-roller', cwd=workdir) 172 self.m.git('config', 'user.name', 'recipe-roller', cwd=workdir)
172 173
173 # git cl upload cannot work with detached HEAD, it requires a branch. 174 # git cl upload cannot work with detached HEAD, it requires a branch.
174 self.m.git('checkout', '-t', '-b', 'roll', 'origin/master', cwd=workdir) 175 self.m.git('checkout', '-t', '-b', 'roll', 'origin/master', cwd=workdir)
175 176
176 recipes_cfg_path = workdir.join('infra', 'config', 'recipes.cfg') 177 recipes_cfg_path = workdir.join('infra', 'config', 'recipes.cfg')
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 'issue': m.group(1), 281 'issue': m.group(1),
281 'issue_url': m.group(2), 282 'issue_url': m.group(2),
282 'diff_digest': diff_digest, 283 'diff_digest': diff_digest,
283 } 284 }
284 issue_result.presentation.links['Issue %s' % change_data['issue']] = ( 285 issue_result.presentation.links['Issue %s' % change_data['issue']] = (
285 change_data['issue_url']) 286 change_data['issue_url'])
286 self.m.gsutil.upload( 287 self.m.gsutil.upload(
287 self.m.json.input(change_data), 288 self.m.json.input(change_data),
288 'recipe-roller-cl-uploads', 289 'recipe-roller-cl-uploads',
289 cfg_digest) 290 cfg_digest)
OLDNEW
« 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