Skip to content

Commit

Permalink
Merge pull request #39272 from benesch/backport19.1-36143-38737
Browse files Browse the repository at this point in the history
release-19.1: stop assigning GitHub test failures to me
  • Loading branch information
benesch authored Aug 2, 2019
2 parents deb9852 + 90df7b0 commit 51a6fde
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions pkg/cmd/internal/issues/issues.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,13 @@ func trimIssueRequestBody(message string, usedCharacters int) string {

// If the assignee would be the key in this map, assign to the value instead.
// Helpful to avoid pinging former employees.
// An "" value means that issues that would have gone to the key are left
// unassigned.
var oldFriendsMap = map[string]string{
"tamird": "tschottdorf",
"a-robinson": "andreimatei",
"benesch": "nvanbenschoten",
"tamird": "tbg",
"vivekmenezes": "",
}

func getAssignee(
Expand Down Expand Up @@ -134,6 +139,9 @@ func getAssignee(
assignee := *commits[0].Author.Login

if newAssignee, ok := oldFriendsMap[assignee]; ok {
if newAssignee == "" {
return "", fmt.Errorf("old friend %s is friendless", assignee)
}
assignee = newAssignee
}
return assignee, nil
Expand Down Expand Up @@ -302,9 +310,6 @@ Failed test: %[3]s`

assignee, err := getAssignee(ctx, authorEmail, p.listCommits)
if err != nil {
// if we *can't* assign anyone, sigh, feel free to hard-code me.
// -- tbg, 11/3/2017
assignee = "tbg"
message += fmt.Sprintf("\n\nFailed to find issue assignee: \n%s", err)
}

Expand Down

0 comments on commit 51a6fde

Please sign in to comment.