From 621fe6f9b56a04d06b4a730cd2867d50282a6490 Mon Sep 17 00:00:00 2001 From: Sergiy Byelozyorov Date: Fri, 25 May 2018 17:38:46 -0700 Subject: [PATCH] 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 Commit-Queue: Sergiy Byelozyorov --- presubmit_canned_checks.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py index fb7e6c0ea..67ac4459c 100644 --- a/presubmit_canned_checks.py +++ b/presubmit_canned_checks.py @@ -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 = (