| 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 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 CHROMIUM_GIT_URL = 'https://chromium.googlesource.com/chromium/src.git' | 46 CHROMIUM_GIT_URL = 'https://chromium.googlesource.com/chromium/src.git' |
| 47 CL_ISSUE_RE = re.compile('^Issue number: ([0-9]+) \((.*)\)$') | 47 CL_ISSUE_RE = re.compile('^Issue number: ([0-9]+) \((.*)\)$') |
| 48 RIETVELD_URL_RE = re.compile('^https?://(.*)/(.*)') | 48 RIETVELD_URL_RE = re.compile('^https?://(.*)/(.*)') |
| 49 ROLL_BRANCH_NAME = 'special_webgl_roll_branch' | 49 ROLL_BRANCH_NAME = 'special_webgl_roll_branch' |
| 50 TRYJOB_STATUS_SLEEP_SECONDS = 30 | 50 TRYJOB_STATUS_SLEEP_SECONDS = 30 |
| 51 | 51 |
| 52 # Use a shell for subcommands on Windows to get a PATH search. | 52 # Use a shell for subcommands on Windows to get a PATH search. |
| 53 IS_WIN = sys.platform.startswith('win') | 53 IS_WIN = sys.platform.startswith('win') |
| 54 WEBGL_PATH = os.path.join('third_party', 'webgl', 'src') | 54 WEBGL_PATH = os.path.join('third_party', 'webgl', 'src') |
| 55 WEBGL_REVISION_TEXT_FILE = os.path.join( |
| 56 'content', 'test', 'gpu', 'gpu_tests', 'webgl_conformance_revision.txt') |
| 55 | 57 |
| 56 CommitInfo = collections.namedtuple('CommitInfo', ['git_commit', | 58 CommitInfo = collections.namedtuple('CommitInfo', ['git_commit', |
| 57 'git_repo_url']) | 59 'git_repo_url']) |
| 58 CLInfo = collections.namedtuple('CLInfo', ['issue', 'url', 'rietveld_server']) | 60 CLInfo = collections.namedtuple('CLInfo', ['issue', 'url', 'rietveld_server']) |
| 59 | 61 |
| 60 def _PosixPath(path): | 62 def _PosixPath(path): |
| 61 """Convert a possibly-Windows path to a posix-style path.""" | 63 """Convert a possibly-Windows path to a posix-style path.""" |
| 62 (_, path) = os.path.splitdrive(path) | 64 (_, path) = os.path.splitdrive(path) |
| 63 return path.replace(os.sep, '/') | 65 return path.replace(os.sep, '/') |
| 64 | 66 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 95 | 97 |
| 96 def GetChangeLogURL(git_repo_url, change_string): | 98 def GetChangeLogURL(git_repo_url, change_string): |
| 97 return '%s/+log/%s' % (git_repo_url, change_string) | 99 return '%s/+log/%s' % (git_repo_url, change_string) |
| 98 | 100 |
| 99 def GetBugString(bugs): | 101 def GetBugString(bugs): |
| 100 bug_str = 'BUG=' | 102 bug_str = 'BUG=' |
| 101 for bug in bugs: | 103 for bug in bugs: |
| 102 bug_str += str(bug) + ',' | 104 bug_str += str(bug) + ',' |
| 103 return bug_str.rstrip(',') | 105 return bug_str.rstrip(',') |
| 104 | 106 |
| 105 if webgl_current.git_commit != webgl_new.git_commit: | 107 change_str = GetChangeString(webgl_current.git_commit, |
| 106 change_str = GetChangeString(webgl_current.git_commit, | 108 webgl_new.git_commit) |
| 107 webgl_new.git_commit) | 109 changelog_url = GetChangeLogURL(webgl_current.git_repo_url, |
| 108 changelog_url = GetChangeLogURL(webgl_current.git_repo_url, | 110 change_str) |
| 109 change_str) | 111 if webgl_current.git_commit == webgl_new.git_commit: |
| 112 print 'WARNING: WebGL repository is unchanged; proceeding with no-op roll' |
| 110 | 113 |
| 111 def GetExtraTrybotString(): | 114 def GetExtraTrybotString(): |
| 112 s = '' | 115 s = '' |
| 113 for t in extra_trybots: | 116 for t in extra_trybots: |
| 114 if s: | 117 if s: |
| 115 s += ';' | 118 s += ';' |
| 116 s += t['mastername'] + ':' + ','.join(t['buildernames']) | 119 s += t['mastername'] + ':' + ','.join(t['buildernames']) |
| 117 return s | 120 return s |
| 118 | 121 |
| 119 extra_trybot_args = [] | 122 extra_trybot_args = [] |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 webgl_current = self._GetDepsCommitInfo(deps, WEBGL_PATH) | 269 webgl_current = self._GetDepsCommitInfo(deps, WEBGL_PATH) |
| 267 | 270 |
| 268 # Find ToT revisions. | 271 # Find ToT revisions. |
| 269 webgl_latest = self._GetCommitInfo(WEBGL_PATH) | 272 webgl_latest = self._GetCommitInfo(WEBGL_PATH) |
| 270 | 273 |
| 271 if IS_WIN: | 274 if IS_WIN: |
| 272 # Make sure the roll script doesn't use windows line endings | 275 # Make sure the roll script doesn't use windows line endings |
| 273 self._RunCommand(['git', 'config', 'core.autocrlf', 'true']) | 276 self._RunCommand(['git', 'config', 'core.autocrlf', 'true']) |
| 274 | 277 |
| 275 self._UpdateDep(deps_filename, WEBGL_PATH, webgl_latest) | 278 self._UpdateDep(deps_filename, WEBGL_PATH, webgl_latest) |
| 279 self._UpdateWebGLRevTextFile(WEBGL_REVISION_TEXT_FILE, webgl_latest) |
| 276 | 280 |
| 277 if self._IsTreeClean(): | 281 if self._IsTreeClean(): |
| 278 logging.debug('Tree is clean - no changes detected.') | 282 logging.debug('Tree is clean - no changes detected.') |
| 279 self._DeleteRollBranch() | 283 self._DeleteRollBranch() |
| 280 else: | 284 else: |
| 281 bugs = self._GetBugList(WEBGL_PATH, webgl_current, webgl_latest) | 285 bugs = self._GetBugList(WEBGL_PATH, webgl_current, webgl_latest) |
| 282 description = _GenerateCLDescriptionCommand( | 286 description = _GenerateCLDescriptionCommand( |
| 283 webgl_current, webgl_latest, bugs) | 287 webgl_current, webgl_latest, bugs) |
| 284 logging.debug('Committing changes locally.') | 288 logging.debug('Committing changes locally.') |
| 285 self._RunCommand(['git', 'add', '--update', '.']) | 289 self._RunCommand(['git', 'add', '--update', '.']) |
| (...skipping 29 matching lines...) Expand all Loading... |
| 315 dep_name = _PosixPath(os.path.join('src', dep_relative_to_src)) | 319 dep_name = _PosixPath(os.path.join('src', dep_relative_to_src)) |
| 316 | 320 |
| 317 # roll_dep_svn.py relies on cwd being the Chromium checkout, so let's | 321 # roll_dep_svn.py relies on cwd being the Chromium checkout, so let's |
| 318 # temporarily change the working directory and then change back. | 322 # temporarily change the working directory and then change back. |
| 319 cwd = os.getcwd() | 323 cwd = os.getcwd() |
| 320 os.chdir(os.path.dirname(deps_filename)) | 324 os.chdir(os.path.dirname(deps_filename)) |
| 321 roll_dep_svn.update_deps(deps_filename, dep_relative_to_src, dep_name, | 325 roll_dep_svn.update_deps(deps_filename, dep_relative_to_src, dep_name, |
| 322 commit_info.git_commit, '') | 326 commit_info.git_commit, '') |
| 323 os.chdir(cwd) | 327 os.chdir(cwd) |
| 324 | 328 |
| 329 def _UpdateWebGLRevTextFile(self, txt_filename, commit_info): |
| 330 # Rolling the WebGL conformance tests must cause at least all of |
| 331 # the WebGL tests to run. There are already exclusions in |
| 332 # trybot_analyze_config.json which force all tests to run if |
| 333 # changes under src/content/test/gpu are made. (This rule |
| 334 # typically only takes effect on the GPU bots.) To make sure this |
| 335 # happens all the time, update an autogenerated text file in this |
| 336 # directory. |
| 337 with open(txt_filename, 'w') as fh: |
| 338 print >> fh, '# AUTOGENERATED FILE - DO NOT EDIT' |
| 339 print >> fh, '# SEE roll_webgl_conformance.py' |
| 340 print >> fh, 'Current webgl revision %s' % commit_info.git_commit |
| 341 |
| 325 def _DeleteRollBranch(self): | 342 def _DeleteRollBranch(self): |
| 326 self._RunCommand(['git', 'checkout', 'master']) | 343 self._RunCommand(['git', 'checkout', 'master']) |
| 327 self._RunCommand(['git', 'branch', '-D', ROLL_BRANCH_NAME]) | 344 self._RunCommand(['git', 'branch', '-D', ROLL_BRANCH_NAME]) |
| 328 logging.debug('Deleted the local roll branch (%s)', ROLL_BRANCH_NAME) | 345 logging.debug('Deleted the local roll branch (%s)', ROLL_BRANCH_NAME) |
| 329 | 346 |
| 330 | 347 |
| 331 def _GetBranches(self): | 348 def _GetBranches(self): |
| 332 """Returns a tuple of active,branches. | 349 """Returns a tuple of active,branches. |
| 333 | 350 |
| 334 The 'active' is the name of the currently active branch and 'branches' is a | 351 The 'active' is the name of the currently active branch and 'branches' is a |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 logging.basicConfig(level=logging.ERROR) | 404 logging.basicConfig(level=logging.ERROR) |
| 388 | 405 |
| 389 autoroller = AutoRoller(SRC_DIR) | 406 autoroller = AutoRoller(SRC_DIR) |
| 390 if args.abort: | 407 if args.abort: |
| 391 return autoroller.Abort() | 408 return autoroller.Abort() |
| 392 else: | 409 else: |
| 393 return autoroller.PrepareRoll(args.ignore_checks, args.run_tryjobs) | 410 return autoroller.PrepareRoll(args.ignore_checks, args.run_tryjobs) |
| 394 | 411 |
| 395 if __name__ == '__main__': | 412 if __name__ == '__main__': |
| 396 sys.exit(main()) | 413 sys.exit(main()) |
| OLD | NEW |