Skip to content

Commit 8cdc394

Browse files
committed
cmd/retrybuilds: start using gRPC API
It's deployed by now, and it works. The flag will likely stay around as it's useful to be able to point retrybuilds to another host, such as localhost during development. For golang/go#34744. Change-Id: I8f637b9841687673b72b66165a562edaae92a2f8 Reviewed-on: https://go-review.googlesource.com/c/build/+/336214 Run-TryBot: Dmitri Shuralyov <[email protected]> TryBot-Result: Go Bot <[email protected]> Trust: Dmitri Shuralyov <[email protected]> Reviewed-by: Alexander Rakoczy <[email protected]>
1 parent 4b70488 commit 8cdc394

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

cmd/retrybuilds/retrybuilds.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ var (
5757
sendMasterKey = flag.Bool("sendmaster", false, "send the master key in request instead of a builder-specific key; allows overriding actions of revoked keys")
5858
branch = flag.String("branch", "master", "branch to find flakes from (for use with -redo-flaky)")
5959
substr = flag.String("substr", "", "if non-empty, redoes all build failures whose failure logs contain this substring")
60-
// TODO(golang.org/issue/34744) - remove after gRPC API for ClearResults is deployed
61-
grpcHost = flag.String("grpc-host", "", "(EXPERIMENTAL) use gRPC for communicating with the API.")
60+
grpcHost = flag.String("grpc-host", "farmer.golang.org:https", "use gRPC for communicating with the Coordinator API")
6261
)
6362

6463
type Failure struct {
@@ -71,16 +70,17 @@ func main() {
7170
log.SetFlags(0)
7271
buildenv.RegisterStagingFlag()
7372
flag.Parse()
73+
7474
*builderPrefix = strings.TrimSuffix(*builderPrefix, "/")
75-
cl := client{}
76-
if *grpcHost != "" {
77-
tc := &tls.Config{InsecureSkipVerify: strings.HasPrefix(*grpcHost, "localhost:")}
78-
cc, err := grpc.DialContext(context.Background(), *grpcHost, grpc.WithTransportCredentials(credentials.NewTLS(tc)))
79-
if err != nil {
80-
log.Fatalf("grpc.DialContext(_, %q, _) = %v, wanted no error", *grpcHost, err)
81-
}
82-
cl.coordinator = protos.NewCoordinatorClient(cc)
75+
tc := &tls.Config{InsecureSkipVerify: strings.HasPrefix(*grpcHost, "localhost:")}
76+
cc, err := grpc.DialContext(context.Background(), *grpcHost, grpc.WithTransportCredentials(credentials.NewTLS(tc)))
77+
if err != nil {
78+
log.Fatalf("grpc.DialContext(_, %q, _) = %v, wanted no error", *grpcHost, err)
79+
}
80+
cl := client{
81+
coordinator: protos.NewCoordinatorClient(cc),
8382
}
83+
8484
if *logHash != "" {
8585
substr := "/log/" + *logHash
8686
for _, f := range failures() {

0 commit comments

Comments
 (0)