diff options
author | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-02-13 16:59:00 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-02-22 21:28:51 +0000 |
commit | 138ee97f0c6c925cbc69ece535d33d78369da744 (patch) | |
tree | acaf2abcc466396ece7c98000a0eaf35ce11a7f6 /git-hooks/gerrit-bot | |
parent | 45a7ada21fc00026d23d96277bf910aad451c842 (diff) |
gerrit-bot: use separate account to invite reviewers
notification mails from the sanity bot are suppressed for users not
owning the change, so the invited reviewers would never get a proper
invitation.
Change-Id: I4bb816a3a5178cba01fe11016c46ae933807a454
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'git-hooks/gerrit-bot')
-rwxr-xr-x | git-hooks/gerrit-bot | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/git-hooks/gerrit-bot b/git-hooks/gerrit-bot index 7e51d0a..ad51377 100755 --- a/git-hooks/gerrit-bot +++ b/git-hooks/gerrit-bot @@ -20,6 +20,8 @@ use File::Path; # Valid options are: # gerrithost (mandatory) # Target host. The identification is done via SSH. +# gerritactorhost +# Target host for inviting reviewers. Falls back go gerrithost. # resthost # The REST base URL of the target host. # restuser @@ -88,6 +90,7 @@ sub getcfg($;$) } my $GERRIT_HOST = getcfg 'gerrithost'; +my $GERRIT_ACTOR_HOST = getcfg 'gerritactorhost', $GERRIT_HOST; my $USER_EMAIL = getcfg 'useremail'; my $INVITE_ONLY = getcfg 'inviteonly', 0; my $REST_HOST = getcfg 'resthost', undef; @@ -121,6 +124,7 @@ if ($REST_HOST) { } my @gerrit = ("ssh", $GERRIT_HOST, "gerrit"); +my @gerrit_actor = ("ssh", $GERRIT_ACTOR_HOST, "gerrit"); my %processed = (); my %skipfetch = (); @@ -249,7 +253,7 @@ sub process_commit($$$$$) } } if (@invite) { - if (system(@gerrit, "set-reviewers", (map { ('-a', $_) } @invite), '--', $rev)) { + if (system(@gerrit_actor, "set-reviewers", (map { ('-a', $_) } @invite), '--', $rev)) { print "===== ".strftime("%c", localtime(time()))." ===== invitation FAILED\n"; printerr("Inviting reviewers to ".$rev." (".$project."/".$ref.") failed"); } else { |