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

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

Issue 2230283004: Moving AutoBisectApi.working_dir fallback logic to the property code. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@workingdir
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
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 config_validation 10 from . import config_validation
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 r'(?<=["\']%s["\']: ["\'])([a-fA-F0-9]+)(?=["\'])' % deps_var, 341 r'(?<=["\']%s["\']: ["\'])([a-fA-F0-9]+)(?=["\'])' % deps_var,
342 re.MULTILINE) 342 re.MULTILINE)
343 if not re.search(deps_item_regexp, original_contents): # pragma: no cover 343 if not re.search(deps_item_regexp, original_contents): # pragma: no cover
344 reason = 'DEPS file does not contain entry for ' + deps_var 344 reason = 'DEPS file does not contain entry for ' + deps_var
345 self.api.m.halt(reason) 345 self.api.m.halt(reason)
346 raise self.api.m.step.StepFailure(reason) 346 raise self.api.m.step.StepFailure(reason)
347 347
348 patched_contents = re.sub(deps_item_regexp, new_commit_hash, 348 patched_contents = re.sub(deps_item_regexp, new_commit_hash,
349 original_contents) 349 original_contents)
350 350
351 cwd = (self.api.working_dir or self.api.m.path['slave_build']).join( 351 cwd = self.api.working_dir.join(
352 depot_config.DEPOT_DEPS_NAME[base_revision.depot_name]['src']) 352 depot_config.DEPOT_DEPS_NAME[base_revision.depot_name]['src'])
353 deps_file = 'DEPS' 353 deps_file = 'DEPS'
354 # This is to support backward compatibility on android-chrome because 354 # This is to support backward compatibility on android-chrome because
355 # .DEPS.git got migrated to DEPS on April 5, 2016 355 # .DEPS.git got migrated to DEPS on April 5, 2016
356 if (base_revision.depot_name == 'android-chrome' and 356 if (base_revision.depot_name == 'android-chrome' and
357 self.api.m.path.exists(self.api.m.path.join(cwd, '.DEPS.git'))): 357 self.api.m.path.exists(self.api.m.path.join(cwd, '.DEPS.git'))):
358 deps_file = '.DEPS.git' # pragma: no cover 358 deps_file = '.DEPS.git' # pragma: no cover
359 359
360 interned_deps_hash = self._git_intern_file( 360 interned_deps_hash = self._git_intern_file(
361 patched_contents, cwd, new_commit_hash) 361 patched_contents, cwd, new_commit_hash)
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
946 }) 946 })
947 return revision_rows 947 return revision_rows
948 948
949 def _get_build_url(self): 949 def _get_build_url(self):
950 properties = self.api.m.properties 950 properties = self.api.m.properties
951 bot_url = properties.get('buildbotURL', 951 bot_url = properties.get('buildbotURL',
952 'http://build.chromium.org/p/chromium/') 952 'http://build.chromium.org/p/chromium/')
953 builder_name = urllib.quote(properties.get('buildername', '')) 953 builder_name = urllib.quote(properties.get('buildername', ''))
954 builder_number = str(properties.get('buildnumber', '')) 954 builder_number = str(properties.get('buildnumber', ''))
955 return '%sbuilders/%s/builds/%s' % (bot_url, builder_name, builder_number) 955 return '%sbuilders/%s/builds/%s' % (bot_url, builder_name, builder_number)
OLDNEW
« no previous file with comments | « scripts/slave/recipe_modules/auto_bisect/api.py ('k') | scripts/slave/recipe_modules/auto_bisect/revision_state.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698