OLD | NEW |
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 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 'recipe_engine/json', | 10 'recipe_engine/json', |
10 'recipe_engine/path', | 11 'recipe_engine/path', |
11 'recipe_engine/properties', | 12 'recipe_engine/properties', |
12 'recipe_engine/python', | 13 'recipe_engine/python', |
13 'depot_tools/tryserver', | 14 'depot_tools/tryserver', |
14 ] | 15 ] |
15 | 16 |
16 | 17 |
17 def _run_presubmit(api, patch_root, bot_update_step): | 18 def _run_presubmit(api, patch_root, bot_update_step): |
18 upstream = bot_update_step.json.output['properties'].get( | 19 upstream = bot_update_step.json.output['properties'].get( |
19 api.gclient.c.got_revision_mapping[ | 20 api.gclient.c.got_revision_mapping[ |
20 'infra/go/src/github.com/luci/luci-go']) | 21 'infra/go/src/github.com/luci/luci-go']) |
21 # The presubmit must be run with proper Go environment. | 22 # The presubmit must be run with proper Go environment. |
22 # infra/go/env.py takes care of this. | 23 # infra/go/env.py takes care of this. |
23 presubmit_cmd = [ | 24 presubmit_cmd = [ |
24 'python', # env.py will replace with this its sys.executable. | 25 'python', # env.py will replace with this its sys.executable. |
25 api.path['depot_tools'].join('presubmit_support.py'), | 26 api.infra_paths['depot_tools'].join('presubmit_support.py'), |
26 '--root', api.path['slave_build'].join(patch_root), | 27 '--root', api.infra_paths['slave_build'].join(patch_root), |
27 '--commit', | 28 '--commit', |
28 '--verbose', '--verbose', | 29 '--verbose', '--verbose', |
29 '--issue', api.properties['issue'], | 30 '--issue', api.properties['issue'], |
30 '--patchset', api.properties['patchset'], | 31 '--patchset', api.properties['patchset'], |
31 '--skip_canned', 'CheckRietveldTryJobExecution', | 32 '--skip_canned', 'CheckRietveldTryJobExecution', |
32 '--skip_canned', 'CheckTreeIsOpen', | 33 '--skip_canned', 'CheckTreeIsOpen', |
33 '--skip_canned', 'CheckBuildbotPendingBuilds', | 34 '--skip_canned', 'CheckBuildbotPendingBuilds', |
34 '--rietveld_url', api.properties['rietveld'], | 35 '--rietveld_url', api.properties['rietveld'], |
35 '--rietveld_fetch', | 36 '--rietveld_fetch', |
36 '--upstream', upstream, | 37 '--upstream', upstream, |
37 '--rietveld_email', '' | 38 '--rietveld_email', '' |
38 ] | 39 ] |
39 api.python('presubmit', api.path['checkout'].join('go', 'env.py'), | 40 api.python('presubmit', api.path['checkout'].join('go', 'env.py'), |
40 presubmit_cmd, env={'PRESUBMIT_BUILDER': '1'}) | 41 presubmit_cmd, env={'PRESUBMIT_BUILDER': '1'}) |
41 | 42 |
42 | 43 |
43 def _commit_change(api, patch_root): | 44 def _commit_change(api, patch_root): |
44 api.git('-c', 'user.email=commit-bot@chromium.org', | 45 api.git('-c', 'user.email=commit-bot@chromium.org', |
45 '-c', 'user.name=The Commit Bot', | 46 '-c', 'user.name=The Commit Bot', |
46 'commit', '-a', '-m', 'Committed patch', | 47 'commit', '-a', '-m', 'Committed patch', |
47 name='commit git patch', | 48 name='commit git patch', |
48 cwd=api.path['slave_build'].join(patch_root)) | 49 cwd=api.infra_paths['slave_build'].join(patch_root)) |
49 | 50 |
50 | 51 |
51 def RunSteps(api): | 52 def RunSteps(api): |
52 api.gclient.set_config('luci_go') | 53 api.gclient.set_config('luci_go') |
53 # patch_root must match the luci-go repo, not infra checkout. | 54 # patch_root must match the luci-go repo, not infra checkout. |
54 for path in api.gclient.c.got_revision_mapping: | 55 for path in api.gclient.c.got_revision_mapping: |
55 if 'luci-go' in path: | 56 if 'luci-go' in path: |
56 patch_root = path | 57 patch_root = path |
57 break | 58 break |
58 bot_update_step = api.bot_update.ensure_checkout(force=True, | 59 bot_update_step = api.bot_update.ensure_checkout(force=True, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 repository='https://chromium.googlesource.com/external/github.com/luci/l
uci-go', | 96 repository='https://chromium.googlesource.com/external/github.com/luci/l
uci-go', |
96 ) | 97 ) |
97 ) | 98 ) |
98 yield ( | 99 yield ( |
99 api.test('presubmit_try_job') + | 100 api.test('presubmit_try_job') + |
100 api.properties.tryserver( | 101 api.properties.tryserver( |
101 mastername='tryserver.infra', | 102 mastername='tryserver.infra', |
102 buildername='Luci-go Presubmit', | 103 buildername='Luci-go Presubmit', |
103 ) + api.step_data('presubmit', api.json.output([[]])) | 104 ) + api.step_data('presubmit', api.json.output([[]])) |
104 ) | 105 ) |
OLD | NEW |