From 29be12934258f15127b0e669d6f859d0999f897d Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Sat, 10 Jan 2015 10:38:53 -0800 Subject: Only build changes that come from @google.com. Googlers should be able to tell the buildbot to launch builds for an external contributor's change, but Gerrit is determined to make this hard for us. The email sent by Gerrit for comments doesn't actually contain the email address of the commenter in any clear way, only the name. It does however contain a list of `Gerrit-Reviewer: Name ` entries that could be used for this though. Change-Id: Iee61f06dcd8f0024f16b535ea9a34765bf01b2e7 --- tools/bionicbb/gmail_listener.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tools') diff --git a/tools/bionicbb/gmail_listener.py b/tools/bionicbb/gmail_listener.py index 8718484..f2c061b 100644 --- a/tools/bionicbb/gmail_listener.py +++ b/tools/bionicbb/gmail_listener.py @@ -200,6 +200,8 @@ def build_project(gerrit_info, dry_run): def handle_change(gerrit_info, _, dry_run): + if '@google.com' not in gerrit_info['Gerrit-Owner']: + return True return build_project(gerrit_info, dry_run) handle_newchange = handle_change handle_newpatchset = handle_change @@ -230,6 +232,10 @@ def handle_comment(gerrit_info, body, dry_run): if 'Verified+1' in body: drop_rejection(gerrit_info, dry_run) + # TODO(danalbert): Needs to be based on the account that made the comment. + if '@google.com' not in gerrit_info['Gerrit-Owner']: + return True + command_map = { 'clean': lambda: clean_project(gerrit_info, dry_run), 'retry': lambda: build_project(gerrit_info, dry_run), -- cgit v1.1