Commit 1e2cb157 authored by Marc-Antoine Ruel's avatar Marc-Antoine Ruel Committed by Commit Bot

[roll-dep] Ignore chromium-autoroll rolls

- It uses a different commit subject than recipe roller.
- Switch from looking up for magic strings to use a regexp instead. Document the
  source of each string, to help keep up when the source diverge.

Tested manually.

Change-Id: I76fc6b6692508c615a0e76c4b6b403f8c513dd31
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1564938
Commit-Queue: Marc-Antoine Ruel <maruel@chromium.org>
Reviewed-by: 's avatarAndrii Shyshkalov <tandrii@chromium.org>
parent e72279d2
......@@ -22,6 +22,25 @@ GCLIENT_PATH = os.path.join(
os.path.dirname(os.path.abspath(__file__)), 'gclient.py')
# Commit subject that will be considered a roll. In the format generated by the
# git log used, so it's "<year>-<month>-<day> <author> <subject>"
_ROLL_SUBJECT = re.compile(
# Date
r'^\d\d\d\d-\d\d-\d\d '
# Author
r'[^ ]+ '
# Subject
r'('
# Generated by
# https://skia.googlesource.com/buildbot/+/master/autoroll/go/repo_manager/deps_repo_manager.go
r'Roll [^ ]+ [a-f0-9]+\.\.[a-f0-9]+ \(\d+ commits\)'
r'|'
# Generated by
# https://chromium.googlesource.com/infra/infra/+/master/recipes/recipe_modules/recipe_autoroller/api.py
r'Roll recipe dependencies \(trivial\)\.'
r')$')
class Error(Exception):
pass
......@@ -90,10 +109,7 @@ def generate_commit_message(
cwd=full_dir).rstrip()
logs = re.sub(r'(?m)^(\d\d\d\d-\d\d-\d\d [^@]+)@[^ ]+( .*)$', r'\1\2', logs)
lines = logs.splitlines()
cleaned_lines = [
l for l in lines
if not l.endswith('Roll recipe dependencies (trivial).')
]
cleaned_lines = [l for l in lines if not _ROLL_SUBJECT.match(l)]
logs = '\n'.join(cleaned_lines) + '\n'
nb_commits = len(lines)
......
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