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

Side by Side Diff: infra/bots/recipe_modules/vars/api.py

Issue 2455523004: Fix recipes for Gerrit property rename (Closed)
Patch Set: Created 4 years, 1 month 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 | infra/bots/recipes/swarm_compile.py » ('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 5
6 # pylint: disable=W0201 6 # pylint: disable=W0201
7 7
8 8
9 from recipe_engine import recipe_api 9 from recipe_engine import recipe_api
10 10
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 self.patch_storage = self.m.properties.get('patch_storage', 'rietveld') 113 self.patch_storage = self.m.properties.get('patch_storage', 'rietveld')
114 self.issue = None 114 self.issue = None
115 self.patchset = None 115 self.patchset = None
116 if self.no_buildbot: 116 if self.no_buildbot:
117 self.is_trybot = False 117 self.is_trybot = False
118 if (self.m.properties.get('issue', '') and 118 if (self.m.properties.get('issue', '') and
119 self.m.properties.get('patchset', '')): 119 self.m.properties.get('patchset', '')):
120 self.is_trybot = True 120 self.is_trybot = True
121 self.issue = self.m.properties['issue'] 121 self.issue = self.m.properties['issue']
122 self.patchset = self.m.properties['patchset'] 122 self.patchset = self.m.properties['patchset']
123 elif (self.m.properties.get('event.change.number', '') and 123 elif (self.m.properties.get('patch_issue', '') and
124 self.m.properties.get('event.patchSet.ref', '')): 124 self.m.properties.get('patch_ref', '')):
125 self.is_trybot = True 125 self.is_trybot = True
126 self.issue = self.m.properties['event.change.number'] 126 self.issue = self.m.properties['patch_issue']
127 self.patchset = self.m.properties['event.patchSet.ref'].split('/')[-1] 127 self.patchset = self.m.properties['patch_ref'].split('/')[-1]
128 else: 128 else:
129 self.is_trybot = self.builder_cfg['is_trybot'] 129 self.is_trybot = self.builder_cfg['is_trybot']
130 if self.is_trybot: 130 if self.is_trybot:
131 if self.patch_storage == 'gerrit': 131 if self.patch_storage == 'gerrit':
132 self.issue = self.m.properties['event.change.number'] 132 self.issue = self.m.properties['patch_issue']
133 self.patchset = self.m.properties['event.patchSet.ref'].split('/')[-1] 133 self.patchset = self.m.properties['patch_ref'].split('/')[-1]
134 else: 134 else:
135 self.issue = self.m.properties['issue'] 135 self.issue = self.m.properties['issue']
136 self.patchset = self.m.properties['patchset'] 136 self.patchset = self.m.properties['patchset']
137 137
138 self.dm_dir = self.m.path.join( 138 self.dm_dir = self.m.path.join(
139 self.swarming_out_dir, 'dm') 139 self.swarming_out_dir, 'dm')
140 self.perf_data_dir = self.m.path.join(self.swarming_out_dir, 140 self.perf_data_dir = self.m.path.join(self.swarming_out_dir,
141 'perfdata', self.builder_name, 'data') 141 'perfdata', self.builder_name, 'data')
142 self._swarming_bot_id = None 142 self._swarming_bot_id = None
143 self._swarming_task_id = None 143 self._swarming_task_id = None
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 def swarming_task_id(self): 195 def swarming_task_id(self):
196 if not self._swarming_task_id: 196 if not self._swarming_task_id:
197 self._swarming_task_id = self.m.python.inline( 197 self._swarming_task_id = self.m.python.inline(
198 name='get swarming task id', 198 name='get swarming task id',
199 program='''import os 199 program='''import os
200 print os.environ.get('SWARMING_TASK_ID', '') 200 print os.environ.get('SWARMING_TASK_ID', '')
201 ''', 201 ''',
202 stdout=self.m.raw_io.output()).stdout.rstrip() 202 stdout=self.m.raw_io.output()).stdout.rstrip()
203 return self._swarming_task_id 203 return self._swarming_task_id
204 204
OLDNEW
« no previous file with comments | « no previous file | infra/bots/recipes/swarm_compile.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698