Ignore comments from accounts with no email

Those comments are from bots and not useful when running git cl
comments.

R=ajp@google.com

Fixed: 1266986
Change-Id: I6a8f8f81e02e4b4624027c4c95546bf5e3e7244b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3268350
Auto-Submit: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Andy Perelson <ajp@chromium.org>
Reviewed-by: Andy Perelson <ajp@chromium.org>
changes/50/3268350/2
Josip Sokcevic 4 years ago committed by LUCI CQ
parent 95a44242f7
commit 266129cba3

@ -1919,6 +1919,10 @@ class Changelist(object):
@staticmethod
def _BuildCommentSummary(msg, comments, readable):
if 'email' not in msg['author']:
# Some bot accounts may not have an email associated.
return None
key = (msg['author']['email'], msg['date'])
# Don't bother showing autogenerated messages that don't have associated
# file or line comments. this will filter out most autogenerated

@ -2663,6 +2663,16 @@ class TestGitCl(unittest.TestCase):
u'id': u'f5a6c25ecbd3b3b54a43ae418ed97eff046d4568',
u'message': u'Patch Set 2: Code-Review+1',
},
{
u'_revision_number': 2,
u'author': {
u'_account_id': 42,
u'name': u'reviewer'
},
u'date': u'2017-03-17 05:19:37.900000000',
u'id': u'f5a6c25ecbd3b3b54a43ae418ed97eff046d0000',
u'message': u'A bot with no email set',
},
]
}
self.calls = [

Loading…
Cancel
Save