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 <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
diff --git a/cmd/retrybuilds/retrybuilds.go b/cmd/retrybuilds/retrybuilds.go
index d6d5c55..06876ac 100644
--- a/cmd/retrybuilds/retrybuilds.go
+++ b/cmd/retrybuilds/retrybuilds.go
@@ -57,8 +57,7 @@
 	sendMasterKey = flag.Bool("sendmaster", false, "send the master key in request instead of a builder-specific key; allows overriding actions of revoked keys")
 	branch        = flag.String("branch", "master", "branch to find flakes from (for use with -redo-flaky)")
 	substr        = flag.String("substr", "", "if non-empty, redoes all build failures whose failure logs contain this substring")
-	// TODO(golang.org/issue/34744) - remove after gRPC API for ClearResults is deployed
-	grpcHost = flag.String("grpc-host", "", "(EXPERIMENTAL) use gRPC for communicating with the API.")
+	grpcHost      = flag.String("grpc-host", "farmer.golang.org:https", "use gRPC for communicating with the Coordinator API")
 )
 
 type Failure struct {
@@ -71,16 +70,17 @@
 	log.SetFlags(0)
 	buildenv.RegisterStagingFlag()
 	flag.Parse()
+
 	*builderPrefix = strings.TrimSuffix(*builderPrefix, "/")
-	cl := client{}
-	if *grpcHost != "" {
-		tc := &tls.Config{InsecureSkipVerify: strings.HasPrefix(*grpcHost, "localhost:")}
-		cc, err := grpc.DialContext(context.Background(), *grpcHost, grpc.WithTransportCredentials(credentials.NewTLS(tc)))
-		if err != nil {
-			log.Fatalf("grpc.DialContext(_, %q, _) = %v, wanted no error", *grpcHost, err)
-		}
-		cl.coordinator = protos.NewCoordinatorClient(cc)
+	tc := &tls.Config{InsecureSkipVerify: strings.HasPrefix(*grpcHost, "localhost:")}
+	cc, err := grpc.DialContext(context.Background(), *grpcHost, grpc.WithTransportCredentials(credentials.NewTLS(tc)))
+	if err != nil {
+		log.Fatalf("grpc.DialContext(_, %q, _) = %v, wanted no error", *grpcHost, err)
 	}
+	cl := client{
+		coordinator: protos.NewCoordinatorClient(cc),
+	}
+
 	if *logHash != "" {
 		substr := "/log/" + *logHash
 		for _, f := range failures() {