Update autoroller to use Gerrit.
Rietveld has been having problems since the migration. NOTRY=True Bug: chromium:738330 Change-Id: I54538eee9f5734fac731702fb592580afcae3fae Reviewed-on: https://webrtc-review.googlesource.com/1231 Reviewed-by: Patrik Höglund <phoglund@webrtc.org> Commit-Queue: Edward Lemur <ehmaldonado@webrtc.org> Cr-Commit-Position: refs/heads/master@{#19834}
This commit is contained in:
parent
73276ad7ed
commit
033a1bf337
@ -292,8 +292,6 @@ def GenerateCommitMessage(current_cr_rev, new_cr_rev, current_commit_pos,
|
|||||||
commit_msg.append('Change log: %s' % (CHROMIUM_LOG_TEMPLATE % rev_interval))
|
commit_msg.append('Change log: %s' % (CHROMIUM_LOG_TEMPLATE % rev_interval))
|
||||||
commit_msg.append('Full diff: %s\n' % (CHROMIUM_COMMIT_TEMPLATE %
|
commit_msg.append('Full diff: %s\n' % (CHROMIUM_COMMIT_TEMPLATE %
|
||||||
rev_interval))
|
rev_interval))
|
||||||
# TBR field will be empty unless in some custom cases, where some engineers
|
|
||||||
# are added.
|
|
||||||
tbr_authors = ''
|
tbr_authors = ''
|
||||||
if changed_deps_list:
|
if changed_deps_list:
|
||||||
commit_msg.append('Changed dependencies:')
|
commit_msg.append('Changed dependencies:')
|
||||||
@ -319,7 +317,8 @@ def GenerateCommitMessage(current_cr_rev, new_cr_rev, current_commit_pos,
|
|||||||
else:
|
else:
|
||||||
commit_msg.append('No update to Clang.\n')
|
commit_msg.append('No update to Clang.\n')
|
||||||
|
|
||||||
commit_msg.append('TBR=%s' % tbr_authors)
|
# TBR needs to be non-empty for Gerrit to process it.
|
||||||
|
commit_msg.append('TBR=kjellander@webrtc.org, %s' % tbr_authors)
|
||||||
commit_msg.append('BUG=None')
|
commit_msg.append('BUG=None')
|
||||||
commit_msg.append('CQ_INCLUDE_TRYBOTS=%s' % EXTRA_TRYBOTS)
|
commit_msg.append('CQ_INCLUDE_TRYBOTS=%s' % EXTRA_TRYBOTS)
|
||||||
return '\n'.join(commit_msg)
|
return '\n'.join(commit_msg)
|
||||||
@ -399,22 +398,16 @@ 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, skip_cq=False):
|
||||||
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', '-f', '--gerrit']
|
||||||
if rietveld_email:
|
if not skip_cq:
|
||||||
cmd.append('--email=%s' % rietveld_email)
|
logging.info('Sending the CL to the CQ...')
|
||||||
|
cmd.extend(['--use-commit-queue', '--send-mail'])
|
||||||
_RunCommand(cmd, extra_env={'EDITOR': 'true'})
|
_RunCommand(cmd, extra_env={'EDITOR': 'true'})
|
||||||
|
|
||||||
|
|
||||||
def _SendToCQ(dry_run, skip_cq):
|
|
||||||
logging.info('Sending the CL to the CQ...')
|
|
||||||
if not dry_run and not skip_cq:
|
|
||||||
_RunCommand(['git', 'cl', 'set_commit'])
|
|
||||||
logging.info('Sent the CL to the CQ.')
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
p = argparse.ArgumentParser()
|
p = argparse.ArgumentParser()
|
||||||
p.add_argument('--clean', action='store_true', default=False,
|
p.add_argument('--clean', action='store_true', default=False,
|
||||||
@ -483,8 +476,7 @@ def main():
|
|||||||
logging.info("No DEPS changes detected, skipping CL creation.")
|
logging.info("No DEPS changes detected, skipping CL creation.")
|
||||||
else:
|
else:
|
||||||
_LocalCommit(commit_msg, opts.dry_run)
|
_LocalCommit(commit_msg, opts.dry_run)
|
||||||
_UploadCL(opts.dry_run, opts.rietveld_email)
|
_UploadCL(opts.dry_run, opts.skip_cq)
|
||||||
_SendToCQ(opts.dry_run, opts.skip_cq)
|
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user