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

Side by Side Diff: scripts/slave/recipe_modules/auto_bisect/bisector.py

Issue 1773933002: Use the crrev recipe module to fetch commit hashes. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Update other bisect & bisect_test recipe expectations Created 4 years, 9 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 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 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 json 5 import json
6 import re 6 import re
7 import time 7 import time
8 import urllib 8 import urllib
9 9
10 from . import depot_config 10 from . import depot_config
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 140
141 Args: 141 Args:
142 rev (str): A commit hash or commit position number. 142 rev (str): A commit hash or commit position number.
143 143
144 Returns: 144 Returns:
145 A 40-digit git commit hash string. 145 A 40-digit git commit hash string.
146 """ 146 """
147 if self._is_sha1(rev): # pragma: no cover 147 if self._is_sha1(rev): # pragma: no cover
148 return rev 148 return rev
149 if rev.isdigit(): 149 if rev.isdigit():
150 return self._api.m.commit_position.chromium_hash_from_commit_position(rev) 150 commit_position = self._api.m.commit_position.construct(
151 branch='refs/heads/master', value=rev)
152 try:
153 return self._api.m.crrev.to_commit_hash(commit_position)
154 except self.api.m.step.StepFailure: # pragma: no cover
155 self.surface_result('BAD_REV')
156 raise
qyearsley 2016/03/07 23:32:53 Note: this will make up to 3 requests to crrev and
151 self.surface_result('BAD_REV') # pragma: no cover 157 self.surface_result('BAD_REV') # pragma: no cover
152 raise self.api.m.step.StepFailure( 158 raise self.api.m.step.StepFailure(
153 'Invalid input revision: %r' % (rev,)) # pragma: no cover 159 'Invalid input revision: %r' % (rev,)) # pragma: no cover
154 160
155 @staticmethod 161 @staticmethod
156 def _is_sha1(s): 162 def _is_sha1(s):
157 return bool(re.match('^[0-9A-Fa-f]{40}$', s)) 163 return bool(re.match('^[0-9A-Fa-f]{40}$', s))
158 164
159 def significantly_different( 165 def significantly_different(
160 self, list_a, list_b, 166 self, list_a, list_b,
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 }) 854 })
849 return revision_rows 855 return revision_rows
850 856
851 def _get_build_url(self): 857 def _get_build_url(self):
852 properties = self.api.m.properties 858 properties = self.api.m.properties
853 bot_url = properties.get('buildbotURL', 859 bot_url = properties.get('buildbotURL',
854 'http://build.chromium.org/p/chromium/') 860 'http://build.chromium.org/p/chromium/')
855 builder_name = urllib.quote(properties.get('buildername', '')) 861 builder_name = urllib.quote(properties.get('buildername', ''))
856 builder_number = str(properties.get('buildnumber', '')) 862 builder_number = str(properties.get('buildnumber', ''))
857 return '%sbuilders/%s/builds/%s' % (bot_url, builder_name, builder_number) 863 return '%sbuilders/%s/builds/%s' % (bot_url, builder_name, builder_number)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698