| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2015 The Chromium Authors. All rights reserved. | 2 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import argparse | 6 import argparse |
| 7 import collections | 7 import collections |
| 8 import logging | 8 import logging |
| 9 import os | 9 import os |
| 10 import re | 10 import re |
| 11 import subprocess | 11 import subprocess |
| 12 import sys | 12 import sys |
| 13 import time | 13 import time |
| 14 | 14 |
| 15 extra_trybots = [ | 15 extra_trybots = [ |
| 16 { | 16 { |
| 17 "mastername": "tryserver.chromium.win", | 17 "mastername": "tryserver.chromium.win", |
| 18 "buildername": "win_clang_dbg", | 18 "buildernames": ["win_clang_dbg", "win_optional_gpu_tests_rel"] |
| 19 } | 19 } |
| 20 ] | 20 ] |
| 21 | 21 |
| 22 SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) | 22 SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) |
| 23 SRC_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, os.pardir)) | 23 SRC_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, os.pardir)) |
| 24 sys.path.insert(0, os.path.join(SRC_DIR, 'build')) | 24 sys.path.insert(0, os.path.join(SRC_DIR, 'build')) |
| 25 import find_depot_tools | 25 import find_depot_tools |
| 26 find_depot_tools.add_depot_tools_to_path() | 26 find_depot_tools.add_depot_tools_to_path() |
| 27 import roll_dep_svn | 27 import roll_dep_svn |
| 28 from gclient import GClientKeywords | 28 from gclient import GClientKeywords |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 for bug in bugs: | 90 for bug in bugs: |
| 91 bug_str += str(bug) + ',' | 91 bug_str += str(bug) + ',' |
| 92 return bug_str.rstrip(',') | 92 return bug_str.rstrip(',') |
| 93 | 93 |
| 94 if angle_current.git_commit != angle_new.git_commit: | 94 if angle_current.git_commit != angle_new.git_commit: |
| 95 change_str = GetChangeString(angle_current.git_commit, | 95 change_str = GetChangeString(angle_current.git_commit, |
| 96 angle_new.git_commit) | 96 angle_new.git_commit) |
| 97 changelog_url = GetChangeLogURL(angle_current.git_repo_url, | 97 changelog_url = GetChangeLogURL(angle_current.git_repo_url, |
| 98 change_str) | 98 change_str) |
| 99 | 99 |
| 100 def GetExtraTrybotString(): |
| 101 s = '' |
| 102 for t in extra_trybots: |
| 103 if s: |
| 104 s += ';' |
| 105 s += t['mastername'] + ':' + ','.join(t['buildernames']) |
| 106 return s |
| 107 |
| 108 extra_trybot_args = [] |
| 109 if extra_trybots: |
| 110 extra_trybot_string = GetExtraTrybotString() |
| 111 extra_trybot_args = ['-m', 'CQ_INCLUDE_TRYBOTS=' + extra_trybot_string] |
| 112 |
| 100 return [ | 113 return [ |
| 101 '-m', 'Roll ANGLE ' + change_str, | 114 '-m', 'Roll ANGLE ' + change_str, |
| 102 '-m', '%s' % changelog_url, | 115 '-m', '%s' % changelog_url, |
| 103 '-m', GetBugString(bugs), | 116 '-m', GetBugString(bugs), |
| 104 '-m', 'TEST=bots', | 117 '-m', 'TEST=bots', |
| 105 ] | 118 ] + extra_trybot_args |
| 106 | 119 |
| 107 | 120 |
| 108 class AutoRoller(object): | 121 class AutoRoller(object): |
| 109 def __init__(self, chromium_src): | 122 def __init__(self, chromium_src): |
| 110 self._chromium_src = chromium_src | 123 self._chromium_src = chromium_src |
| 111 | 124 |
| 112 def _RunCommand(self, command, working_dir=None, ignore_exit_code=False, | 125 def _RunCommand(self, command, working_dir=None, ignore_exit_code=False, |
| 113 extra_env=None): | 126 extra_env=None): |
| 114 """Runs a command and returns the stdout from that command. | 127 """Runs a command and returns the stdout from that command. |
| 115 | 128 |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 bugs = self._GetBugList(ANGLE_PATH, angle_current, angle_latest) | 267 bugs = self._GetBugList(ANGLE_PATH, angle_current, angle_latest) |
| 255 description = _GenerateCLDescriptionCommand( | 268 description = _GenerateCLDescriptionCommand( |
| 256 angle_current, angle_latest, bugs) | 269 angle_current, angle_latest, bugs) |
| 257 logging.debug('Committing changes locally.') | 270 logging.debug('Committing changes locally.') |
| 258 self._RunCommand(['git', 'add', '--update', '.']) | 271 self._RunCommand(['git', 'add', '--update', '.']) |
| 259 self._RunCommand(['git', 'commit'] + description) | 272 self._RunCommand(['git', 'commit'] + description) |
| 260 logging.debug('Uploading changes...') | 273 logging.debug('Uploading changes...') |
| 261 self._RunCommand(['git', 'cl', 'upload'], | 274 self._RunCommand(['git', 'cl', 'upload'], |
| 262 extra_env={'EDITOR': 'true'}) | 275 extra_env={'EDITOR': 'true'}) |
| 263 | 276 |
| 264 # Run the default trybots | 277 # Kick off tryjobs. |
| 265 base_try_cmd = ['git', 'cl', 'try'] | 278 base_try_cmd = ['git', 'cl', 'try'] |
| 266 self._RunCommand(base_try_cmd) | 279 self._RunCommand(base_try_cmd) |
| 267 | 280 |
| 268 if extra_trybots: | 281 if extra_trybots: |
| 269 # Run additional tryjobs | 282 # Run additional tryjobs. |
| 270 extra_try_args = [] | 283 # TODO(kbr): this should not be necessary -- the |
| 271 for extra_trybot in extra_trybots: | 284 # CQ_INCLUDE_TRYBOTS directive above should handle it. |
| 272 extra_try_args += ['-m', extra_trybot["mastername"], | 285 # http://crbug.com/585237 |
| 273 '-b', extra_trybot["buildername"]] | 286 for trybot in extra_trybots: |
| 274 self._RunCommand(base_try_cmd + extra_try_args) | 287 for builder in trybot['buildernames']: |
| 288 self._RunCommand(base_try_cmd + [ |
| 289 '-m', trybot['mastername'], |
| 290 '-b', builder]) |
| 275 | 291 |
| 276 cl_info = self._GetCLInfo() | 292 cl_info = self._GetCLInfo() |
| 277 print 'Issue: %d URL: %s' % (cl_info.issue, cl_info.url) | 293 print 'Issue: %d URL: %s' % (cl_info.issue, cl_info.url) |
| 278 | 294 |
| 279 # Checkout master again. | 295 # Checkout master again. |
| 280 self._RunCommand(['git', 'checkout', 'master']) | 296 self._RunCommand(['git', 'checkout', 'master']) |
| 281 print 'Roll branch left as ' + ROLL_BRANCH_NAME | 297 print 'Roll branch left as ' + ROLL_BRANCH_NAME |
| 282 return 0 | 298 return 0 |
| 283 | 299 |
| 284 def _UpdateDep(self, deps_filename, dep_relative_to_src, commit_info): | 300 def _UpdateDep(self, deps_filename, dep_relative_to_src, commit_info): |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 logging.basicConfig(level=logging.ERROR) | 369 logging.basicConfig(level=logging.ERROR) |
| 354 | 370 |
| 355 autoroller = AutoRoller(SRC_DIR) | 371 autoroller = AutoRoller(SRC_DIR) |
| 356 if args.abort: | 372 if args.abort: |
| 357 return autoroller.Abort() | 373 return autoroller.Abort() |
| 358 else: | 374 else: |
| 359 return autoroller.PrepareRoll(args.ignore_checks) | 375 return autoroller.PrepareRoll(args.ignore_checks) |
| 360 | 376 |
| 361 if __name__ == '__main__': | 377 if __name__ == '__main__': |
| 362 sys.exit(main()) | 378 sys.exit(main()) |
| OLD | NEW |