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

Side by Side Diff: scripts/slave/recipes/run_presubmit.py

Issue 15270004: Add step generator protocol, remove annotated_checkout, remove script. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Checkout blobs do not need to be generators Created 7 years, 7 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 | Annotate | Revision Log
OLDNEW
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 # Copyright (c) 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 def GetFactoryProperties(api, factory_properties, build_properties): 5 def GetSteps(api, factory_properties, build_properties):
6 # TODO(iannucci): Pass the build repo info directly via build_properties 6 # TODO(iannucci): Pass the build repo info directly via build_properties
7 repo_name = factory_properties.get('repo_name') 7 repo_name = factory_properties.get('repo_name')
8 steps = api.Steps(build_properties) 8 steps = api.Steps(build_properties)
9 9
10 spec = steps.gclient_common_spec(repo_name) 10 def git_steps(step_history, _failure):
11 11 spec = step_history['gclient setup'].json_data['CheckoutSpec']
12 git_steps = [] 12 if spec['solutions'][0]['url'].endswith('.git'):
13 if spec['solutions'][0]['url'].endswith('.git'): 13 seed_steps = ['git config user.email', 'git config user.name',
14 email = 'commit-bot@chromium.org' 14 'git clean']
15 git_steps = [ 15 yield steps.git('config', 'user.email', 'commit-bot@chromium.org',
16 steps.git_step('config', 'user.email', email), 16 seed_steps=seed_steps)
17 steps.git_step('config', 'user.name', 'The Commit Bot'), 17 yield steps.git('config', 'user.name', 'The Commit Bot')
18 steps.git_step('clean', '-xfq'), 18 yield steps.git('clean', '-xfq')
19 ]
20 19
21 root = build_properties.get('root', '') 20 root = build_properties.get('root', '')
22 # FIXME: Rietveld passes the blink path as src/third_party/WebKit 21 # FIXME: Rietveld passes the blink path as src/third_party/WebKit
23 # so we have to strip the src bit off before passing to 22 # so we have to strip the src bit off before passing to
24 # api.checkout_path. :( 23 # api.checkout_path. :(
25 if root.startswith('src'): 24 if root.startswith('src'):
26 root = root[3:].lstrip('/') 25 root = root[3:].lstrip('/')
27 26
28 # FIXME: Remove the blink_bare repository type. 27 # FIXME: Remove the blink_bare repository type.
29 if repo_name == 'blink_bare': 28 if repo_name == 'blink_bare':
30 root = '' 29 root = ''
31 30
32 return { 31 return (
33 'checkout': 'gclient', 32 steps.gclient_checkout(repo_name),
34 'gclient_spec': spec, 33 git_steps,
35 'steps': git_steps + [ 34 steps.apply_issue(root),
36 steps.apply_issue_step(root), 35 steps.step('presubmit', [
37 steps.step('presubmit', [ 36 api.depot_tools_path('presubmit_support.py'),
38 api.depot_tools_path('presubmit_support.py'), 37 '--root', api.checkout_path(root),
39 '--root', api.checkout_path(root), 38 '--commit',
40 '--commit', 39 '--verbose', '--verbose',
41 '--verbose', '--verbose', 40 '--issue', build_properties['issue'],
42 '--issue', build_properties['issue'], 41 '--patchset', build_properties['patchset'],
43 '--patchset', build_properties['patchset'], 42 '--skip_canned', 'CheckRietveldTryJobExecution',
44 '--skip_canned', 'CheckRietveldTryJobExecution', 43 '--skip_canned', 'CheckTreeIsOpen',
45 '--skip_canned', 'CheckTreeIsOpen', 44 '--skip_canned', 'CheckBuildbotPendingBuilds',
46 '--skip_canned', 'CheckBuildbotPendingBuilds', 45 '--rietveld_url', build_properties['rietveld'],
47 '--rietveld_url', build_properties['rietveld'], 46 '--rietveld_email', '', # activates anonymous mode
48 '--rietveld_email', '', # activates anonymous mode 47 '--rietveld_fetch'])
49 '--rietveld_fetch']) 48 )
50 ]
51 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698