| 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 "buildernames": ["win_optional_gpu_tests_rel"] | 18 "buildernames": ["win_optional_gpu_tests_rel"] |
| 19 }, | 19 }, |
| 20 { | 20 { |
| 21 "mastername": "tryserver.chromium.mac", | 21 "mastername": "tryserver.chromium.mac", |
| 22 "buildernames": ["mac_optional_gpu_tests_rel"] | 22 "buildernames": ["mac_optional_gpu_tests_rel"] |
| 23 } | 23 }, |
| 24 { |
| 25 "mastername": "tryserver.chromium.linux", |
| 26 "buildernames": ["linux_optional_gpu_tests_rel"] |
| 27 }, |
| 24 ] | 28 ] |
| 25 | 29 |
| 26 SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) | 30 SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) |
| 27 SRC_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, os.pardir)) | 31 SRC_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, os.pardir)) |
| 28 sys.path.insert(0, os.path.join(SRC_DIR, 'build')) | 32 sys.path.insert(0, os.path.join(SRC_DIR, 'build')) |
| 29 import find_depot_tools | 33 import find_depot_tools |
| 30 find_depot_tools.add_depot_tools_to_path() | 34 find_depot_tools.add_depot_tools_to_path() |
| 31 import roll_dep_svn | 35 import roll_dep_svn |
| 32 from gclient import GClientKeywords | 36 from gclient import GClientKeywords |
| 33 from third_party import upload | 37 from third_party import upload |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 | 226 |
| 223 def _UpdateReadmeFile(self, readme_path, new_revision): | 227 def _UpdateReadmeFile(self, readme_path, new_revision): |
| 224 readme = open(os.path.join(self._chromium_src, readme_path), 'r+') | 228 readme = open(os.path.join(self._chromium_src, readme_path), 'r+') |
| 225 txt = readme.read() | 229 txt = readme.read() |
| 226 m = re.sub(re.compile('.*^Revision\: ([0-9]*).*', re.MULTILINE), | 230 m = re.sub(re.compile('.*^Revision\: ([0-9]*).*', re.MULTILINE), |
| 227 ('Revision: %s' % new_revision), txt) | 231 ('Revision: %s' % new_revision), txt) |
| 228 readme.seek(0) | 232 readme.seek(0) |
| 229 readme.write(m) | 233 readme.write(m) |
| 230 readme.truncate() | 234 readme.truncate() |
| 231 | 235 |
| 232 def PrepareRoll(self, ignore_checks, skip_tryjobs): | 236 def PrepareRoll(self, ignore_checks, run_tryjobs): |
| 233 # TODO(kjellander): use os.path.normcase, os.path.join etc for all paths for | 237 # TODO(kjellander): use os.path.normcase, os.path.join etc for all paths for |
| 234 # cross platform compatibility. | 238 # cross platform compatibility. |
| 235 | 239 |
| 236 if not ignore_checks: | 240 if not ignore_checks: |
| 237 if self._GetCurrentBranchName() != 'master': | 241 if self._GetCurrentBranchName() != 'master': |
| 238 logging.error('Please checkout the master branch.') | 242 logging.error('Please checkout the master branch.') |
| 239 return -1 | 243 return -1 |
| 240 if not self._IsTreeClean(): | 244 if not self._IsTreeClean(): |
| 241 logging.error('Please make sure you don\'t have any modified files.') | 245 logging.error('Please make sure you don\'t have any modified files.') |
| 242 return -1 | 246 return -1 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 273 bugs = self._GetBugList(WEBGL_PATH, webgl_current, webgl_latest) | 277 bugs = self._GetBugList(WEBGL_PATH, webgl_current, webgl_latest) |
| 274 description = _GenerateCLDescriptionCommand( | 278 description = _GenerateCLDescriptionCommand( |
| 275 webgl_current, webgl_latest, bugs) | 279 webgl_current, webgl_latest, bugs) |
| 276 logging.debug('Committing changes locally.') | 280 logging.debug('Committing changes locally.') |
| 277 self._RunCommand(['git', 'add', '--update', '.']) | 281 self._RunCommand(['git', 'add', '--update', '.']) |
| 278 self._RunCommand(['git', 'commit'] + description) | 282 self._RunCommand(['git', 'commit'] + description) |
| 279 logging.debug('Uploading changes...') | 283 logging.debug('Uploading changes...') |
| 280 self._RunCommand(['git', 'cl', 'upload'], | 284 self._RunCommand(['git', 'cl', 'upload'], |
| 281 extra_env={'EDITOR': 'true'}) | 285 extra_env={'EDITOR': 'true'}) |
| 282 | 286 |
| 283 if not skip_tryjobs: | 287 if run_tryjobs: |
| 284 # Kick off tryjobs. | 288 # Kick off tryjobs. |
| 285 base_try_cmd = ['git', 'cl', 'try'] | 289 base_try_cmd = ['git', 'cl', 'try'] |
| 286 self._RunCommand(base_try_cmd) | 290 self._RunCommand(base_try_cmd) |
| 287 if extra_trybots: | 291 if extra_trybots: |
| 288 # Run additional tryjobs. | 292 # Run additional tryjobs. |
| 289 # TODO(kbr): this should not be necessary -- the | 293 # TODO(kbr): this should not be necessary -- the |
| 290 # CQ_INCLUDE_TRYBOTS directive above should handle it. | 294 # CQ_INCLUDE_TRYBOTS directive above should handle it. |
| 291 # http://crbug.com/585237 | 295 # http://crbug.com/585237 |
| 292 for trybot in extra_trybots: | 296 for trybot in extra_trybots: |
| 293 for builder in trybot['buildernames']: | 297 for builder in trybot['buildernames']: |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 parser = argparse.ArgumentParser( | 362 parser = argparse.ArgumentParser( |
| 359 description='Auto-generates a CL containing a WebGL conformance roll.') | 363 description='Auto-generates a CL containing a WebGL conformance roll.') |
| 360 parser.add_argument('--abort', | 364 parser.add_argument('--abort', |
| 361 help=('Aborts a previously prepared roll. ' | 365 help=('Aborts a previously prepared roll. ' |
| 362 'Closes any associated issues and deletes the roll branches'), | 366 'Closes any associated issues and deletes the roll branches'), |
| 363 action='store_true') | 367 action='store_true') |
| 364 parser.add_argument('--ignore-checks', action='store_true', default=False, | 368 parser.add_argument('--ignore-checks', action='store_true', default=False, |
| 365 help=('Skips checks for being on the master branch, dirty workspaces and ' | 369 help=('Skips checks for being on the master branch, dirty workspaces and ' |
| 366 'the updating of the checkout. Will still delete and create local ' | 370 'the updating of the checkout. Will still delete and create local ' |
| 367 'Git branches.')) | 371 'Git branches.')) |
| 368 parser.add_argument('--skip-tryjobs', action='store_true', default=False, | 372 parser.add_argument('--run-tryjobs', action='store_true', default=False, |
| 369 help=('Skip the dry-run tryjobs for the newly generated CL. Use this ' | 373 help=('Start the dry-run tryjobs for the newly generated CL. Use this ' |
| 370 'when you expect to have to make many changes to the WebGL ' | 374 'when you have no need to make changes to the WebGL conformance ' |
| 371 'conformance test expectations in the same CL and want to avoid ' | 375 'test expectations in the same CL and want to avoid.')) |
| 372 'wasted tryjobs.')) | |
| 373 parser.add_argument('-v', '--verbose', action='store_true', default=False, | 376 parser.add_argument('-v', '--verbose', action='store_true', default=False, |
| 374 help='Be extra verbose in printing of log messages.') | 377 help='Be extra verbose in printing of log messages.') |
| 375 args = parser.parse_args() | 378 args = parser.parse_args() |
| 376 | 379 |
| 377 if args.verbose: | 380 if args.verbose: |
| 378 logging.basicConfig(level=logging.DEBUG) | 381 logging.basicConfig(level=logging.DEBUG) |
| 379 else: | 382 else: |
| 380 logging.basicConfig(level=logging.ERROR) | 383 logging.basicConfig(level=logging.ERROR) |
| 381 | 384 |
| 382 autoroller = AutoRoller(SRC_DIR) | 385 autoroller = AutoRoller(SRC_DIR) |
| 383 if args.abort: | 386 if args.abort: |
| 384 return autoroller.Abort() | 387 return autoroller.Abort() |
| 385 else: | 388 else: |
| 386 return autoroller.PrepareRoll(args.ignore_checks, args.skip_tryjobs) | 389 return autoroller.PrepareRoll(args.ignore_checks, args.run_tryjobs) |
| 387 | 390 |
| 388 if __name__ == '__main__': | 391 if __name__ == '__main__': |
| 389 sys.exit(main()) | 392 sys.exit(main()) |
| OLD | NEW |