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

Side by Side Diff: scripts/slave/recipes/webrtc/auto_roll_chromium_deps.py

Issue 1384273003: WebRTC: Bot for autorolling WebRTC+libjingle in Chromium DEPS. Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Created 5 years, 2 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 2014 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 'bot_update', 6 'bot_update',
7 'chromium', 7 'chromium',
8 'gclient', 8 'gclient',
9 'json', 9 'json',
10 'path', 10 'path',
11 'properties', 11 'properties',
12 'python', 12 'python',
13 'raw_io', 13 'raw_io',
14 'step', 14 'step',
15 'url', 15 'url',
16 ] 16 ]
17 17
18 18
19 def ContainsChromiumRoll(changes): 19 def ContainsChromiumRoll(changes):
20 for change in changes: 20 for change in changes:
21 if change['subject'].startswith('Update V8 to'): 21 if change['subject'].startswith('Roll WebRTC '):
22 return True 22 return True
23 return False 23 return False
24 24
25 25
26 def RunSteps(api): 26 def RunSteps(api):
27 api.chromium.cleanup_temp() 27 api.chromium.cleanup_temp()
28 api.gclient.set_config('chromium') 28 api.gclient.set_config('chromium')
29 api.gclient.apply_config('v8_bleeding_edge_git')
kjellander_chromium 2015/10/05 19:35:47 Our script at https://code.google.com/p/chromium/c
30 29
31 step_result = api.python( 30 step_result = api.python(
32 'check roll status', 31 'check roll status',
33 api.path['build'].join('scripts', 'tools', 'runit.py'), 32 api.path['build'].join('scripts', 'tools', 'runit.py'),
34 [api.path['build'].join('scripts', 'tools', 'pycurl.py'), 33 [api.path['build'].join('scripts', 'tools', 'pycurl.py'),
35 'https://v8-roll.appspot.com/status'], 34 'https://webrtc-roll.appspot.com/status'],
36 stdout=api.raw_io.output(), 35 stdout=api.raw_io.output(),
37 step_test_data=lambda: api.raw_io.test_api.stream_output( 36 step_test_data=lambda: api.raw_io.test_api.stream_output(
38 '1', stream='stdout') 37 '1', stream='stdout')
39 ) 38 )
40 step_result.presentation.logs['stdout'] = step_result.stdout.splitlines() 39 step_result.presentation.logs['stdout'] = step_result.stdout.splitlines()
41 if step_result.stdout.strip() != '1': 40 if step_result.stdout.strip() != '1':
42 step_result.presentation.step_text = 'Rolling deactivated' 41 step_result.presentation.step_text = 'Rolling deactivated'
43 return 42 return
44 else: 43 else:
45 step_result.presentation.step_text = 'Rolling activated' 44 step_result.presentation.step_text = 'Rolling activated'
46 45
47 params = { 46 params = {
48 'closed': 3, 47 'closed': 3,
49 'owner': 'v8-autoroll@chromium.org', 48 'owner': 'webrtc-autoroll@chromium.org',
Michael Achenbach 2015/10/06 09:31:55 You have an account now?
kjellander_chromium 2015/10/06 09:58:09 No, not yet. I might try this with my own account
kjellander_chromium 2015/10/26 08:40:29 Now I have an account (crbug.com/539527).
Michael Achenbach 2015/10/26 08:54:38 Acknowledged. FYI: You might need to log on to the
50 'limit': 30, 49 'limit': 30,
51 'format': 'json', 50 'format': 'json',
52 } 51 }
53 52
54 params = api.url.urlencode(params) 53 params = api.url.urlencode(params)
55 search_url = 'https://codereview.chromium.org/search?' + params 54 search_url = 'https://codereview.chromium.org/search?' + params
56 55
57 result = api.url.fetch( 56 result = api.url.fetch(
58 search_url, 57 search_url,
59 'check active roll', 58 'check active roll',
60 step_test_data=lambda: api.raw_io.test_api.output('{"results": []}') 59 step_test_data=lambda: api.raw_io.test_api.output('{"results": []}')
61 ) 60 )
62 if ContainsChromiumRoll(api.json.loads(result)['results']): 61 if ContainsChromiumRoll(api.json.loads(result)['results']):
63 api.step.active_result.presentation.step_text = 'Active rolls found.' 62 api.step.active_result.presentation.step_text = 'Active rolls found.'
64 return 63 return
65 64
66 # Prevent race with gnumbd by waiting. 65 # Prevent race with gnumbd by waiting.
67 api.python.inline( 66 api.python.inline(
68 'wait for gnumbd', 67 'wait for gnumbd',
69 'import time; time.sleep(20)', 68 'import time; time.sleep(20)',
Michael Achenbach 2015/10/06 09:31:55 Not sure if you need that, but it doesn't hurt muc
kjellander_chromium 2015/10/06 09:58:09 As you say it doesn't hurt so I'll keep it for ini
Michael Achenbach 2015/10/26 08:54:38 Actually you probably do need it. Also here a race
70 ) 69 )
71 70
72 api.bot_update.ensure_checkout(force=True, no_shallow=True) 71 api.bot_update.ensure_checkout(force=True, no_shallow=True)
73 72
74 api.python( 73 api.python(
75 'roll deps', 74 'roll deps',
76 api.path['checkout'].join( 75 api.path['checkout'].join('tools', 'roll_webrtc.py'),
77 'v8', 'tools', 'release', 'auto_roll.py'), 76 ['--wait-for-trybots', '--close-previous-roll', '--verbose'],
78 ['--chromium', api.path['checkout'], 77 cwd=api.path['checkout'],
Michael Achenbach 2015/10/06 09:31:55 Sure this works? This is from a chromium checkout.
kjellander_chromium 2015/10/06 09:58:09 Yeah, we moved the script from WebRTC into Chromiu
kjellander_chromium 2015/10/26 08:40:29 It's worth mentioning that this will wait for max
Michael Achenbach 2015/10/26 08:54:38 Acknowledged.
79 '--author', 'v8-autoroll@chromium.org', 78 )
80 '--reviewer',
81 'hablich@chromium.org,machenbach@chromium.org,'
82 'yangguo@chromium.org,vogelheim@chromium.org',
83 '--roll',
84 '--work-dir', api.path['slave_build'].join('workdir')],
85 cwd=api.path['checkout'].join('v8'),
86 )
87 79
88 80
89 def GenTests(api): 81 def GenTests(api):
90 yield api.test('standard') + api.properties.generic( 82 yield (api.test('standard') +
91 mastername='client.v8.fyi') 83 api.properties.generic(mastername='client.webrtc.fyi')
84 )
92 yield (api.test('rolling_deactivated') + 85 yield (api.test('rolling_deactivated') +
93 api.properties.generic(mastername='client.v8') + 86 api.properties.generic(mastername='client.webrtc.fyi') +
94 api.override_step_data( 87 api.override_step_data(
95 'check roll status', api.raw_io.stream_output('0', stream='stdout')) 88 'check roll status', api.raw_io.stream_output('0', stream='stdout'))
96 ) 89 )
97 yield (api.test('active_roll') + 90 yield (api.test('active_roll') +
98 api.properties.generic(mastername='client.v8') + 91 api.properties.generic(mastername='client.webrtc.fyi') +
99 api.override_step_data( 92 api.override_step_data(
100 'check active roll', api.raw_io.output( 93 'check active roll', api.raw_io.output(
101 '{"results": [{"subject": "Update V8 to foo"}]}')) 94 '{"results": [{"subject": "Roll WebRTC to 123"}]}'))
102 ) 95 )
103
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698