Skip to content

Commit 82802b7

Browse files
thepuddsgopherbot
authored andcommitted
cmd/gerritbot: greet with the GitHub username for the PR rule findings comment
Use the GitHub username (e.g., "thepudds") to greet the CL author when we report possible problems, rather than using their email. Updates golang/go#61573 Change-Id: I3699dc4e72c6244cd5d13493e5e4bd7cb098430a Reviewed-on: https://go-review.googlesource.com/c/build/+/520116 TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Heschi Kreinick <[email protected]> Auto-Submit: Dmitri Shuralyov <[email protected]> Run-TryBot: t hepudds <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]>
1 parent e3604e6 commit 82802b7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cmd/gerritbot/gerritbot.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,10 @@ Please visit Gerrit at %s.
789789
problems := rules.Check(change)
790790
if len(problems) > 0 {
791791
summary := rules.FormatResults(problems)
792+
user := author
793+
if pr.User != nil && pr.User.Login != nil {
794+
user = *pr.User.Login
795+
}
792796
// If needed, summary contains advice for how to edit the commit message.
793797
msg := fmt.Sprintf("Hello %v, I've spotted some possible problems.\n\n"+
794798
"These findings are based on simple heuristics. If a finding appears wrong, briefly reply here saying so. "+
@@ -798,7 +802,7 @@ Please visit Gerrit at %s.
798802
"(In general for Gerrit code reviews, the CL author is expected to close out each piece of feedback by "+
799803
"marking it as 'Done' if implemented as suggested or otherwise reply to each review comment. "+
800804
"See the [Review](https://go.dev/doc/contribute#review) section of the Contributing Guide for details.)",
801-
author, summary)
805+
user, summary)
802806

803807
gcl, err := b.gerritChangeForPR(pr)
804808
if err != nil {

0 commit comments

Comments
 (0)