Commit 3583835a authored by Oleh Prypin's avatar Oleh Prypin Committed by Commit Bot

Autoroller: pull some updates from WebRTC's copy of the script

This is mostly removing deprecated stuff and helping to run on LUCI

No-Try: True
Bug: chromium:892545
Change-Id: I93dbdd78d35532f65976de96cb724ee5a1a89983
Reviewed-on: https://chromium-review.googlesource.com/c/1264417Reviewed-by: 's avatarPatrik Höglund <phoglund@chromium.org>
Commit-Queue: Oleh Prypin <oprypin@chromium.org>
parent 20bf569a
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
# be found in the AUTHORS file in the root of the source tree. # be found in the AUTHORS file in the root of the source tree.
# This is a modified copy of the script in # This is a modified copy of the script in
# https://chromium.googlesource.com/external/webrtc/+/master/tools-webrtc/autoroller/roll_deps.py # https://webrtc.googlesource.com/src/+/master/tools_webrtc/autoroller/roll_deps.py
# customized for libyuv. # customized for libyuv.
...@@ -109,7 +109,7 @@ def _RunCommand(command, working_dir=None, ignore_exit_code=False, ...@@ -109,7 +109,7 @@ def _RunCommand(command, working_dir=None, ignore_exit_code=False,
logging.debug('CMD: %s CWD: %s', ' '.join(command), working_dir) logging.debug('CMD: %s CWD: %s', ' '.join(command), working_dir)
env = os.environ.copy() env = os.environ.copy()
if extra_env: if extra_env:
assert all(type(value) == str for value in extra_env.values()) assert all(isinstance(value, str) for value in extra_env.values())
logging.debug('extra env: %s', extra_env) logging.debug('extra env: %s', extra_env)
env.update(extra_env) env.update(extra_env)
p = subprocess.Popen(command, stdout=subprocess.PIPE, p = subprocess.Popen(command, stdout=subprocess.PIPE,
...@@ -397,13 +397,17 @@ def _LocalCommit(commit_msg, dry_run): ...@@ -397,13 +397,17 @@ def _LocalCommit(commit_msg, dry_run):
_RunCommand(['git', 'commit', '-m', commit_msg]) _RunCommand(['git', 'commit', '-m', commit_msg])
def _UploadCL(dry_run, rietveld_email=None): def _UploadCL(dry_run):
logging.info('Uploading CL...') logging.info('Uploading CL...')
if not dry_run: if not dry_run:
cmd = ['git', 'cl', 'upload', '-f'] cmd = ['git', 'cl', 'upload', '--force', '--bypass-hooks']
if rietveld_email: extra_env = {
cmd.append('--email=%s' % rietveld_email) 'EDITOR': 'true',
_RunCommand(cmd, extra_env={'EDITOR': 'true'}) 'SKIP_GCE_AUTH_FOR_GIT': '1',
}
stdout, stderr = _RunCommand(cmd, extra_env=extra_env)
logging.debug('Output from "git cl upload":\nstdout:\n%s\n\nstderr:\n%s',
stdout, stderr)
def _SendToCQ(dry_run, skip_cq): def _SendToCQ(dry_run, skip_cq):
...@@ -420,10 +424,6 @@ def main(): ...@@ -420,10 +424,6 @@ def main():
p.add_argument('-r', '--revision', p.add_argument('-r', '--revision',
help=('Chromium Git revision to roll to. Defaults to the ' help=('Chromium Git revision to roll to. Defaults to the '
'Chromium HEAD revision if omitted.')) 'Chromium HEAD revision if omitted.'))
p.add_argument('-u', '--rietveld-email',
help=('E-mail address to use for creating the CL at Rietveld'
'If omitted a previously cached one will be used or an '
'error will be thrown during upload.'))
p.add_argument('--dry-run', action='store_true', default=False, p.add_argument('--dry-run', action='store_true', default=False,
help=('Calculate changes and modify DEPS, but don\'t create ' help=('Calculate changes and modify DEPS, but don\'t create '
'any local branch, commit, upload CL or send any ' 'any local branch, commit, upload CL or send any '
...@@ -478,7 +478,7 @@ def main(): ...@@ -478,7 +478,7 @@ def main():
_CreateRollBranch(opts.dry_run) _CreateRollBranch(opts.dry_run)
UpdateDepsFile(deps_filename, current_cr_rev, new_cr_rev, changed_deps) UpdateDepsFile(deps_filename, current_cr_rev, new_cr_rev, changed_deps)
_LocalCommit(commit_msg, opts.dry_run) _LocalCommit(commit_msg, opts.dry_run)
_UploadCL(opts.dry_run, opts.rietveld_email) _UploadCL(opts.dry_run)
_SendToCQ(opts.dry_run, opts.skip_cq) _SendToCQ(opts.dry_run, opts.skip_cq)
return 0 return 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment