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

Side by Side Diff: recipe_modules/rietveld/api.py

Issue 1915463002: depot_tools: add infra_paths recipe module for infra-specific paths (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 8 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
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 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 urlparse 5 import urlparse
6 6
7 from recipe_engine import recipe_api 7 from recipe_engine import recipe_api
8 8
9 9
10 class RietveldApi(recipe_api.RecipeApi): 10 class RietveldApi(recipe_api.RecipeApi):
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 or 'oauth2'. See also apply_issue.py --help (-E and --no-auth options.) 55 or 'oauth2'. See also apply_issue.py --help (-E and --no-auth options.)
56 """ 56 """
57 # TODO(pgervais): replace *root_pieces by a single Path object. 57 # TODO(pgervais): replace *root_pieces by a single Path object.
58 authentication = kwargs.get('authentication', None) 58 authentication = kwargs.get('authentication', None)
59 rietveld_url = self.m.properties['rietveld'] 59 rietveld_url = self.m.properties['rietveld']
60 issue_number = self.m.properties['issue'] 60 issue_number = self.m.properties['issue']
61 61
62 if authentication == 'oauth2': 62 if authentication == 'oauth2':
63 step_result = self.m.python( 63 step_result = self.m.python(
64 'apply_issue', 64 'apply_issue',
65 self.m.path['depot_tools'].join('apply_issue.py'), [ 65 self.m.infra_paths['depot_tools'].join('apply_issue.py'), [
66 '-r', self.m.path['checkout'].join(*root_pieces), 66 '-r', self.m.path['checkout'].join(*root_pieces),
67 '-i', issue_number, 67 '-i', issue_number,
68 '-p', self.m.properties['patchset'], 68 '-p', self.m.properties['patchset'],
69 '-s', rietveld_url, 69 '-s', rietveld_url,
70 '-E', self.m.path['build'].join('site_config', 70 '-E', self.m.infra_paths['build'].join(
71 '.rietveld_client_email'), 71 'site_config', '.rietveld_client_email'),
72 '-k', self.m.path['build'].join('site_config', 72 '-k', self.m.infra_paths['build'].join(
73 '.rietveld_secret_key') 73 'site_config', '.rietveld_secret_key')
74 ], 74 ],
75 ) 75 )
76 76
77 else: 77 else:
78 step_result = self.m.python( 78 step_result = self.m.python(
79 'apply_issue', 79 'apply_issue',
80 self.m.path['depot_tools'].join('apply_issue.py'), [ 80 self.m.infra_paths['depot_tools'].join('apply_issue.py'), [
81 '-r', self.m.path['checkout'].join(*root_pieces), 81 '-r', self.m.path['checkout'].join(*root_pieces),
82 '-i', issue_number, 82 '-i', issue_number,
83 '-p', self.m.properties['patchset'], 83 '-p', self.m.properties['patchset'],
84 '-s', rietveld_url, 84 '-s', rietveld_url,
85 '--no-auth'], 85 '--no-auth'],
86 ) 86 )
87 step_result.presentation.links['Applied issue %s' % issue_number] = ( 87 step_result.presentation.links['Applied issue %s' % issue_number] = (
88 urlparse.urljoin(rietveld_url, str(issue_number))) 88 urlparse.urljoin(rietveld_url, str(issue_number)))
89 89
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698