Add ability to whitelist bot accounts as valid authors

Example usage: https://crrev.com/c/1074367

R=machenbach@chromium.org

Bug: 831171
Change-Id: Ic3deff5040a268e10161ccce635f06b7f8c08d36
Reviewed-on: https://chromium-review.googlesource.com/1074368
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Sergiy Byelozyorov <sergiyb@chromium.org>
changes/68/1074368/2
Sergiy Byelozyorov 7 years ago committed by Commit Bot
parent 0ae14e9aad
commit 621fe6f9b5

@ -80,7 +80,7 @@ def CheckChangeWasUploaded(input_api, output_api):
### Content checks
def CheckAuthorizedAuthor(input_api, output_api):
def CheckAuthorizedAuthor(input_api, output_api, bot_whitelist=None):
"""For non-googler/chromites committers, verify the author's email address is
in AUTHORS.
"""
@ -93,6 +93,11 @@ def CheckAuthorizedAuthor(input_api, output_api):
if not author:
input_api.logging.info('No author, skipping AUTHOR check')
return []
# This is used for CLs created by trusted robot accounts.
if bot_whitelist and author in bot_whitelist:
return []
authors_path = input_api.os_path.join(
input_api.PresubmitLocalPath(), 'AUTHORS')
valid_authors = (

Loading…
Cancel
Save