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

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

Issue 1919193002: build: roll infra_paths changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: merge Created 4 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 DEPS = [ 5 DEPS = [
6 'depot_tools/bot_update', 6 'depot_tools/bot_update',
7 'depot_tools/gclient', 7 'depot_tools/gclient',
8 'depot_tools/git', 8 'depot_tools/git',
9 'depot_tools/infra_paths',
9 'depot_tools/presubmit', 10 'depot_tools/presubmit',
10 'recipe_engine/json', 11 'recipe_engine/json',
11 'recipe_engine/path', 12 'recipe_engine/path',
12 'recipe_engine/properties', 13 'recipe_engine/properties',
13 'recipe_engine/python', 14 'recipe_engine/python',
14 'depot_tools/tryserver', 15 'depot_tools/tryserver',
15 'depot_tools/rietveld', 16 'depot_tools/rietveld',
16 'v8', 17 'v8',
17 'webrtc', 18 'webrtc',
18 ] 19 ]
(...skipping 14 matching lines...) Expand all
33 got_revision_property = api.gclient.c.got_revision_mapping[relative_root] 34 got_revision_property = api.gclient.c.got_revision_mapping[relative_root]
34 upstream = bot_update_step.json.output['properties'].get( 35 upstream = bot_update_step.json.output['properties'].get(
35 got_revision_property) 36 got_revision_property)
36 if (not upstream or 37 if (not upstream or
37 isinstance(upstream, int) or 38 isinstance(upstream, int) or
38 (upstream.isdigit() and len(upstream) < 40)): 39 (upstream.isdigit() and len(upstream) < 40)):
39 # If got_revision is an svn revision, then use got_revision_git. 40 # If got_revision is an svn revision, then use got_revision_git.
40 upstream = bot_update_step.json.output['properties'].get( 41 upstream = bot_update_step.json.output['properties'].get(
41 '%s_git' % got_revision_property) or '' 42 '%s_git' % got_revision_property) or ''
42 43
43 abs_root = api.path['slave_build'].join(relative_root) 44 abs_root = api.infra_paths['slave_build'].join(relative_root)
44 # TODO(hinoka): Extract email/name from issue? 45 # TODO(hinoka): Extract email/name from issue?
45 api.git('-c', 'user.email=commit-bot@chromium.org', 46 api.git('-c', 'user.email=commit-bot@chromium.org',
46 '-c', 'user.name=The Commit Bot', 47 '-c', 'user.name=The Commit Bot',
47 'commit', '-a', '-m', 'Committed patch', 48 'commit', '-a', '-m', 'Committed patch',
48 name='commit git patch', cwd=abs_root) 49 name='commit git patch', cwd=abs_root)
49 50
50 if api.properties.get('runhooks'): 51 if api.properties.get('runhooks'):
51 api.gclient.runhooks() 52 api.gclient.runhooks()
52 53
53 patch_storage = api.properties.get('patch_storage', 'rietveld') 54 patch_storage = api.properties.get('patch_storage', 'rietveld')
54 if patch_storage == 'rietveld': 55 if patch_storage == 'rietveld':
55 presubmit_args = [ 56 presubmit_args = [
56 '--issue', api.properties['issue'], 57 '--issue', api.properties['issue'],
57 '--patchset', api.properties['patchset'], 58 '--patchset', api.properties['patchset'],
58 '--rietveld_url', api.properties['rietveld'], 59 '--rietveld_url', api.properties['rietveld'],
59 '--rietveld_fetch', 60 '--rietveld_fetch',
60 ] 61 ]
61 if codereview_auth: 62 if codereview_auth:
62 presubmit_args.extend([ 63 presubmit_args.extend([
63 '--rietveld_email_file', 64 '--rietveld_email_file',
64 api.path['build'].join('site_config', '.rietveld_client_email')]) 65 api.infra_paths['build'].join('site_config', '.rietveld_client_email') ])
65 presubmit_args.extend([ 66 presubmit_args.extend([
66 '--rietveld_private_key_file', 67 '--rietveld_private_key_file',
67 api.path['build'].join('site_config', '.rietveld_secret_key')]) 68 api.infra_paths['build'].join('site_config', '.rietveld_secret_key')])
68 else: 69 else:
69 presubmit_args.extend(['--rietveld_email', '']) # activate anonymous mode 70 presubmit_args.extend(['--rietveld_email', '']) # activate anonymous mode
70 elif patch_storage == 'gerrit': 71 elif patch_storage == 'gerrit':
71 # Field event.patchSet.ref looks like 'refs/changes/11/338811/4' 72 # Field event.patchSet.ref looks like 'refs/changes/11/338811/4'
72 issue, patchset = api.properties['event.patchSet.ref'].split('/')[-2:] 73 issue, patchset = api.properties['event.patchSet.ref'].split('/')[-2:]
73 presubmit_args = [ 74 presubmit_args = [
74 '--issue', issue, 75 '--issue', issue,
75 '--patchset', patchset, 76 '--patchset', patchset,
76 '--gerrit_url', api.properties['gerrit'], 77 '--gerrit_url', api.properties['gerrit'],
77 '--gerrit_fetch', 78 '--gerrit_fetch',
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 api.test('recipes-py') + 175 api.test('recipes-py') +
175 api.properties.tryserver( 176 api.properties.tryserver(
176 mastername='tryserver.infra', 177 mastername='tryserver.infra',
177 buildername='infra_presubmit', 178 buildername='infra_presubmit',
178 repo_name='recipes_py', 179 repo_name='recipes_py',
179 patch_project='recipes-py', 180 patch_project='recipes-py',
180 runhooks=True) + 181 runhooks=True) +
181 api.step_data('presubmit', api.json.output([['infra_presubmit', 182 api.step_data('presubmit', api.json.output([['infra_presubmit',
182 ['compile']]])) 183 ['compile']]]))
183 ) 184 )
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698