| OLD | NEW |
| 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 LKGR_URL = 'https://webrtc-status.appspot.com/lkgr' |
| 20 |
| 21 |
| 19 def ContainsChromiumRoll(changes): | 22 def ContainsChromiumRoll(changes): |
| 20 for change in changes: | 23 for change in changes: |
| 21 if change['subject'].startswith('Update V8 to'): | 24 if change['subject'].startswith('Roll WebRTC '): |
| 22 return True | 25 return True |
| 23 return False | 26 return False |
| 24 | 27 |
| 25 | 28 |
| 26 def RunSteps(api): | 29 def RunSteps(api): |
| 27 api.chromium.cleanup_temp() | 30 api.chromium.cleanup_temp() |
| 28 api.gclient.set_config('chromium') | 31 api.gclient.set_config('chromium') |
| 29 api.gclient.apply_config('v8_bleeding_edge_git') | |
| 30 | 32 |
| 31 step_result = api.python( | 33 step_result = api.python( |
| 32 'check roll status', | 34 'check roll status', |
| 33 api.path['build'].join('scripts', 'tools', 'runit.py'), | 35 api.path['build'].join('scripts', 'tools', 'runit.py'), |
| 34 [api.path['build'].join('scripts', 'tools', 'pycurl.py'), | 36 [api.path['build'].join('scripts', 'tools', 'pycurl.py'), |
| 35 'https://v8-roll.appspot.com/status'], | 37 'https://webrtc-roll.appspot.com/status'], |
| 36 stdout=api.raw_io.output(), | 38 stdout=api.raw_io.output(), |
| 37 step_test_data=lambda: api.raw_io.test_api.stream_output( | 39 step_test_data=lambda: api.raw_io.test_api.stream_output( |
| 38 '1', stream='stdout') | 40 '1', stream='stdout') |
| 39 ) | 41 ) |
| 40 step_result.presentation.logs['stdout'] = step_result.stdout.splitlines() | 42 step_result.presentation.logs['stdout'] = step_result.stdout.splitlines() |
| 41 if step_result.stdout.strip() != '1': | 43 if step_result.stdout.strip() != '1': |
| 42 step_result.presentation.step_text = 'Rolling deactivated' | 44 step_result.presentation.step_text = 'Rolling deactivated' |
| 43 return | 45 return |
| 44 else: | 46 else: |
| 45 step_result.presentation.step_text = 'Rolling activated' | 47 step_result.presentation.step_text = 'Rolling activated' |
| 46 | 48 |
| 47 params = { | 49 params = { |
| 48 'closed': 3, | 50 'closed': 3, |
| 49 'owner': 'v8-autoroll@chromium.org', | 51 'owner': 'webrtc-autoroll@chromium.org', |
| 50 'limit': 30, | 52 'limit': 30, |
| 51 'format': 'json', | 53 'format': 'json', |
| 52 } | 54 } |
| 53 | 55 |
| 54 params = api.url.urlencode(params) | 56 params = api.url.urlencode(params) |
| 55 search_url = 'https://codereview.chromium.org/search?' + params | 57 search_url = 'https://codereview.chromium.org/search?' + params |
| 56 | 58 |
| 57 result = api.url.fetch( | 59 result = api.url.fetch( |
| 58 search_url, | 60 search_url, |
| 59 'check active roll', | 61 'check active roll', |
| 60 step_test_data=lambda: api.raw_io.test_api.output('{"results": []}') | 62 step_test_data=lambda: api.raw_io.test_api.output('{"results": []}') |
| 61 ) | 63 ) |
| 62 if ContainsChromiumRoll(api.json.loads(result)['results']): | 64 if ContainsChromiumRoll(api.json.loads(result)['results']): |
| 63 api.step.active_result.presentation.step_text = 'Active rolls found.' | 65 api.step.active_result.presentation.step_text = 'Active rolls found.' |
| 64 return | 66 return |
| 65 | 67 |
| 66 # Prevent race with gnumbd by waiting. | 68 # Prevent race with gnumbd by waiting. |
| 67 api.python.inline( | 69 api.python.inline( |
| 68 'wait for gnumbd', | 70 'wait for gnumbd', |
| 69 'import time; time.sleep(20)', | 71 'import time; time.sleep(20)', |
| 70 ) | 72 ) |
| 71 | 73 |
| 72 api.bot_update.ensure_checkout(force=True, no_shallow=True) | 74 api.bot_update.ensure_checkout(force=True, no_shallow=True) |
| 73 | 75 |
| 76 # Get the LKGR revision. |
| 77 result = api.url.fetch( |
| 78 LKGR_URL, |
| 79 'get lkgr revision', |
| 80 step_test_data=lambda: api.raw_io.test_api.output('deadbeef') |
| 81 ) |
| 82 |
| 74 api.python( | 83 api.python( |
| 75 'roll deps', | 84 'roll deps', |
| 76 api.path['checkout'].join( | 85 api.path['checkout'].join('tools', 'roll_webrtc.py'), |
| 77 'v8', 'tools', 'release', 'auto_roll.py'), | 86 ['--revision', result, '--wait-for-trybots', '--close-previous-roll', |
| 78 ['--chromium', api.path['checkout'], | 87 '--verbose'], |
| 79 '--author', 'v8-autoroll@chromium.org', | 88 cwd=api.path['checkout'], |
| 80 '--reviewer', | 89 ) |
| 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 | 90 |
| 88 | 91 |
| 89 def GenTests(api): | 92 def GenTests(api): |
| 90 yield api.test('standard') + api.properties.generic( | 93 yield (api.test('standard') + |
| 91 mastername='client.v8.fyi') | 94 api.properties.generic(mastername='client.webrtc.fyi') |
| 95 ) |
| 92 yield (api.test('rolling_deactivated') + | 96 yield (api.test('rolling_deactivated') + |
| 93 api.properties.generic(mastername='client.v8') + | 97 api.properties.generic(mastername='client.webrtc.fyi') + |
| 94 api.override_step_data( | 98 api.override_step_data( |
| 95 'check roll status', api.raw_io.stream_output('0', stream='stdout')) | 99 'check roll status', api.raw_io.stream_output('0', stream='stdout')) |
| 96 ) | 100 ) |
| 97 yield (api.test('active_roll') + | 101 yield (api.test('active_roll') + |
| 98 api.properties.generic(mastername='client.v8') + | 102 api.properties.generic(mastername='client.webrtc.fyi') + |
| 99 api.override_step_data( | 103 api.override_step_data( |
| 100 'check active roll', api.raw_io.output( | 104 'check active roll', api.raw_io.output( |
| 101 '{"results": [{"subject": "Update V8 to foo"}]}')) | 105 '{"results": [{"subject": "Roll WebRTC to 123"}]}')) |
| 102 ) | 106 ) |
| 103 | |
| OLD | NEW |