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

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

Issue 1836243002: Reland of Use the crrev recipe module to fetch commit hashes. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.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 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 6
7 DEPS = [ 7 DEPS = [
8 'auto_bisect', 8 'auto_bisect',
9 'chromium_tests', 9 'chromium_tests',
10 'recipe_engine/json', 10 'recipe_engine/json',
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 'skip_gclient_ops': 'True', 397 'skip_gclient_ops': 'True',
398 'recipe_tester_name': 'linux_perf_tester' 398 'recipe_tester_name': 'linux_perf_tester'
399 } 399 }
400 if params: 400 if params:
401 example_config.update(params) 401 example_config.update(params)
402 return example_config 402 return example_config
403 403
404 404
405 def _get_step_data_for_revision(api, revision_data, include_build_steps=True): 405 def _get_step_data_for_revision(api, revision_data, include_build_steps=True):
406 """Generator that produces step patches for fake results.""" 406 """Generator that produces step patches for fake results."""
407 commit_pos = revision_data['commit_pos'] 407 commit_pos_number = revision_data['commit_pos']
408 commit_hash = revision_data['hash'] 408 commit_hash = revision_data['hash']
409 test_results = revision_data.get('test_results') 409 test_results = revision_data.get('test_results')
410 410
411 if 'refrange' in revision_data: 411 if 'refrange' in revision_data:
412 parent_step = 'Resolving reference range.' 412 parent_step = 'Resolving reference range.'
413 step_name = parent_step + 'resolving commit_pos ' + commit_pos 413 commit_pos = 'refs/heads/master@{#%s}' % commit_pos_number
414 yield api.step_data(step_name, 414 step_name = parent_step + 'crrev get commit hash for ' + commit_pos
415 stdout=api.raw_io.output('hash:' + commit_hash)) 415 yield api.step_data(
416 step_name,
417 stdout=api.json.output({'git_sha': commit_hash}))
416 418
417 if include_build_steps: 419 if include_build_steps:
418 if test_results: 420 if test_results:
419 step_name = ('Waiting for chromium@%s.gsutil ' 421 step_name = ('Waiting for chromium@%s.gsutil '
420 'Get test results for build %s') % (commit_hash[:10], 422 'Get test results for build %s') % (commit_hash[:10],
421 commit_hash) 423 commit_hash)
422 yield api.step_data(step_name, stdout=api.json.output(test_results)) 424 yield api.step_data(step_name, stdout=api.json.output(test_results))
423 425
424 if revision_data.get('DEPS', False): 426 if revision_data.get('DEPS', False):
425 step_name = 'fetch file %s:DEPS' % commit_hash 427 step_name = 'fetch file %s:DEPS' % commit_hash
(...skipping 18 matching lines...) Expand all
444 yield api.step_data(step_name, stdout=api.raw_io.output(file_hash)) 446 yield api.step_data(step_name, stdout=api.raw_io.output(file_hash))
445 step_name = 'Expanding revision range for revision %s on depot %s' 447 step_name = 'Expanding revision range for revision %s on depot %s'
446 step_name %= (interval[-1], depot_name) 448 step_name %= (interval[-1], depot_name)
447 stdout = api.json.output([(r, 0) for r in interval[:-1]]) 449 stdout = api.json.output([(r, 0) for r in interval[:-1]])
448 yield api.step_data(step_name, stdout=stdout) 450 yield api.step_data(step_name, stdout=stdout)
449 451
450 if 'cl_info' in revision_data: 452 if 'cl_info' in revision_data:
451 step_name = 'Reading culprit cl information.' 453 step_name = 'Reading culprit cl information.'
452 stdout = api.json.output(revision_data['cl_info']) 454 stdout = api.json.output(revision_data['cl_info'])
453 yield api.step_data(step_name, stdout=stdout) 455 yield api.step_data(step_name, stdout=stdout)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698