-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
roll.go: add a flag to send the CL to the gardener
Bug: dawn:1940 Change-Id: I720d8f6507a18bfd50dcaa1ae8db34b566c7c469 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/147542 Auto-Submit: Austin Eng <[email protected]> Reviewed-by: Ben Clayton <[email protected]> Kokoro: Kokoro <[email protected]> Commit-Queue: Austin Eng <[email protected]>
- Loading branch information
Showing
2 changed files
with
54 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ import ( | |
"context" | ||
"flag" | ||
"fmt" | ||
"log" | ||
"net/url" | ||
"strconv" | ||
"strings" | ||
|
@@ -311,12 +312,24 @@ func (g *Gerrit) Comment(ps Patchset, msg string, comments []FileComment) error | |
} | ||
|
||
// SetReadyForReview marks the change as ready for review. | ||
func (g *Gerrit) SetReadyForReview(changeID, message string) error { | ||
func (g *Gerrit) SetReadyForReview(changeID, message, reviewer string) error { | ||
resp, err := g.client.Changes.SetReadyForReview(changeID, &gerrit.ReadyForReviewInput{ | ||
Message: message, | ||
}) | ||
if err != nil && resp.StatusCode != 409 { // 409: already ready | ||
return err | ||
} | ||
if reviewer != "" { | ||
// Log the reviewer and then replace with enga@. | ||
// TODO(crbug.com/dawn/1940): Use the actual reviewer when the bot is stable. | ||
log.Printf("Got reviewer %s", reviewer) | ||
reviewer = "[email protected]" | ||
_, resp, err = g.client.Changes.AddReviewer(changeID, &gerrit.ReviewerInput{ | ||
Reviewer: reviewer, | ||
}) | ||
if err != nil && resp.StatusCode != 409 { // 409: already ready | ||
return err | ||
} | ||
} | ||
return nil | ||
} |