diff --git a/cmd/gopherbot/gopherbot.go b/cmd/gopherbot/gopherbot.go index ae56698143..462754ef4c 100644 --- a/cmd/gopherbot/gopherbot.go +++ b/cmd/gopherbot/gopherbot.go @@ -806,7 +806,7 @@ func (b *gopherbot) closeStaleWaitingForInfo(ctx context.Context) error { } -// cl2issue writes "Change https://golang.org/issue/NNNN mentions this issue"\ +// cl2issue writes "Change https://golang.org/issue/NNNN by 'author' mentions this issue"\ // and the change summary on GitHub when a new Gerrit change references a GitHub issue. func (b *gopherbot) cl2issue(ctx context.Context) error { monthAgo := time.Now().Add(-30 * 24 * time.Hour) @@ -831,7 +831,7 @@ func (b *gopherbot) cl2issue(ctx context.Context) error { continue } hasComment := false - substr := fmt.Sprintf("%d mentions this issue", cl.Number) + substr := fmt.Sprintf("Change https://golang.org/cl/%d mentions this issue.", cl.Number) gi.ForeachComment(func(c *maintner.GitHubComment) error { if strings.Contains(c.Body, substr) { hasComment = true @@ -841,7 +841,9 @@ func (b *gopherbot) cl2issue(ctx context.Context) error { }) if !hasComment { printIssue("cl2issue", gi) - msg := fmt.Sprintf("Change https://golang.org/cl/%d mentions this issue: `%s`", cl.Number, cl.Commit.Summary()) + + msg := fmt.Sprintf("Change https://golang.org/cl/%d by %s mentions this issue: `%s`", cl.Number, strings.Split("cl.Commit.Author", "<")[0], cl.Commit.Summary()) + if err := b.addGitHubComment(ctx, "golang", "go", gi.Number, msg); err != nil { return err }