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