Commit adaaa28f authored by David Benjamin's avatar David Benjamin Committed by Commit Bot

Include BoringSSL Update-Note summaries in commit messages

Change-Id: I464eecb3ca7ef5417b89378588593d05c452592a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1899897
Auto-Submit: David Benjamin <davidben@chromium.org>
Reviewed-by: default avatarSteven Valdez <svaldez@chromium.org>
Commit-Queue: David Benjamin <davidben@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712781}
parent 58f116da
...@@ -87,6 +87,13 @@ def Log(repo, revspec): ...@@ -87,6 +87,13 @@ def Log(repo, revspec):
return commits return commits
def FormatCommit(commit):
"""Returns a commit formatted into a single line."""
rev = commit['commit'][:9]
line, _ = commit['message'].split('\n', 1)
return '%s %s' % (rev, line)
def main(): def main():
if len(sys.argv) > 2: if len(sys.argv) > 2:
sys.stderr.write('Usage: %s [COMMIT]' % sys.argv[0]) sys.stderr.write('Usage: %s [COMMIT]' % sys.argv[0])
...@@ -115,9 +122,11 @@ def main(): ...@@ -115,9 +122,11 @@ def main():
# Look for commits with associated Chromium bugs. # Look for commits with associated Chromium bugs.
crbugs = set() crbugs = set()
crbug_commits = [] crbug_commits = []
update_note_commits = []
log = Log(BORINGSSL_SRC_PATH, '%s..%s' % (old_head, new_head)) log = Log(BORINGSSL_SRC_PATH, '%s..%s' % (old_head, new_head))
for commit in log: for commit in log:
has_bugs = False has_bugs = False
has_update_note = False
for line in commit['message'].split('\n'): for line in commit['message'].split('\n'):
lower = line.lower() lower = line.lower()
if lower.startswith('bug:') or lower.startswith('bug='): if lower.startswith('bug:') or lower.startswith('bug='):
...@@ -126,8 +135,12 @@ def main(): ...@@ -126,8 +135,12 @@ def main():
if bug.startswith('chromium:'): if bug.startswith('chromium:'):
crbugs.add(int(bug[len('chromium:'):])) crbugs.add(int(bug[len('chromium:'):]))
has_bugs = True has_bugs = True
if lower.startswith('update-note:'):
has_update_note = True
if has_bugs: if has_bugs:
crbug_commits.append(commit) crbug_commits.append(commit)
if has_update_note:
update_note_commits.append(commit)
UpdateDEPS(DEPS_PATH, old_head, new_head) UpdateDEPS(DEPS_PATH, old_head, new_head)
...@@ -167,9 +180,12 @@ https://boringssl.googlesource.com/boringssl/+log/%s..%s ...@@ -167,9 +180,12 @@ https://boringssl.googlesource.com/boringssl/+log/%s..%s
if crbug_commits: if crbug_commits:
message += 'The following commits have Chromium bugs associated:\n' message += 'The following commits have Chromium bugs associated:\n'
for commit in crbug_commits: for commit in crbug_commits:
rev = commit['commit'][:9] message += ' ' + FormatCommit(commit)
line, _ = commit['message'].split('\n', 1) message += '\n'
message += ' %s %s\n' % (rev, line) if update_note_commits:
message += 'The following commits have update notes:\n'
for commit in update_note_commits:
message += ' ' + FormatCommit(commit)
message += '\n' message += '\n'
if crbugs: if crbugs:
message += 'Bug: %s\n' % (', '.join(str(bug) for bug in sorted(crbugs)),) message += 'Bug: %s\n' % (', '.join(str(bug) for bug in sorted(crbugs)),)
......
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