@@ -151,7 +151,7 @@ func main() {
151151 }
152152 client , err := remoteworker .NewClient (
153153 remoteWorkerClient ,
154- executor ,
154+ remoteworker . NewProtoExecutor ( executor ) ,
155155 clock .SystemClock ,
156156 random .CryptoThreadSafeGenerator ,
157157 platformPrivateKeys ,
@@ -282,14 +282,14 @@ func (e *builderExecutor) CheckReadiness(ctx context.Context) error {
282282 return nil
283283}
284284
285- func (e * builderExecutor ) Execute (ctx context.Context , action * model_build_pb.Action , executionTimeout time.Duration , executionEvents chan <- proto. Message ) (proto. Message , time.Duration , remoteworker_pb.CurrentState_Completed_Result ) {
285+ func (e * builderExecutor ) Execute (ctx context.Context , action * model_build_pb.Action , executionTimeout time.Duration , executionEvents chan <- * emptypb. Empty ) (* model_build_pb. Result , time.Duration , remoteworker_pb.CurrentState_Completed_Result , error ) {
286286 namespace , err := object .NewNamespace (action .Namespace )
287287 if err != nil {
288288 return & model_build_pb.Result {
289289 Failure : & model_build_pb.Result_Failure {
290290 Status : status .Convert (util .StatusWrap (err , "Invalid namespace" )).Proto (),
291291 },
292- }, 0 , remoteworker_pb .CurrentState_Completed_FAILED
292+ }, 0 , remoteworker_pb .CurrentState_Completed_FAILED , nil
293293 }
294294 instanceName := namespace .InstanceName
295295 buildSpecificationReference , err := model_core .NewDecodableLocalReferenceFromWeakProto (namespace .ReferenceFormat , action .BuildSpecificationReference )
@@ -298,7 +298,7 @@ func (e *builderExecutor) Execute(ctx context.Context, action *model_build_pb.Ac
298298 Failure : & model_build_pb.Result_Failure {
299299 Status : status .Convert (util .StatusWrap (err , "Invalid build specification reference" )).Proto (),
300300 },
301- }, 0 , remoteworker_pb .CurrentState_Completed_FAILED
301+ }, 0 , remoteworker_pb .CurrentState_Completed_FAILED , nil
302302 }
303303 buildSpecificationEncoder , err := encoding .NewBinaryEncoderFromProto (
304304 action .BuildSpecificationEncoders ,
@@ -309,7 +309,7 @@ func (e *builderExecutor) Execute(ctx context.Context, action *model_build_pb.Ac
309309 Failure : & model_build_pb.Result_Failure {
310310 Status : status .Convert (util .StatusWrap (err , "Invalid build specification encoder" )).Proto (),
311311 },
312- }, 0 , remoteworker_pb .CurrentState_Completed_FAILED
312+ }, 0 , remoteworker_pb .CurrentState_Completed_FAILED , nil
313313 }
314314
315315 // Perform the build.
@@ -415,7 +415,7 @@ func (e *builderExecutor) Execute(ctx context.Context, action *model_build_pb.Ac
415415 Failure : & model_build_pb.Result_Failure {
416416 Status : status .Convert (err ).Proto (),
417417 },
418- }, 0 , remoteworker_pb .CurrentState_Completed_FAILED
418+ }, 0 , remoteworker_pb .CurrentState_Completed_FAILED , nil
419419 }
420420 patcher := key .Patcher
421421
@@ -434,7 +434,7 @@ func (e *builderExecutor) Execute(ctx context.Context, action *model_build_pb.Ac
434434 Failure : & model_build_pb.Result_Failure {
435435 Status : status .Convert (err ).Proto (),
436436 },
437- }, 0 , remoteworker_pb .CurrentState_Completed_FAILED
437+ }, 0 , remoteworker_pb .CurrentState_Completed_FAILED , nil
438438 }
439439 patcher .Merge (value .Patcher )
440440 }
@@ -472,7 +472,7 @@ func (e *builderExecutor) Execute(ctx context.Context, action *model_build_pb.Ac
472472 Failure : & model_build_pb.Result_Failure {
473473 Status : status .Convert (err ).Proto (),
474474 },
475- }, 0 , remoteworker_pb .CurrentState_Completed_FAILED
475+ }, 0 , remoteworker_pb .CurrentState_Completed_FAILED , nil
476476 }
477477 if err := dependencyTreeBuilder .PushChild (
478478 model_core .NewPatchedMessage (
@@ -488,7 +488,7 @@ func (e *builderExecutor) Execute(ctx context.Context, action *model_build_pb.Ac
488488 Failure : & model_build_pb.Result_Failure {
489489 Status : status .Convert (err ).Proto (),
490490 },
491- }, 0 , remoteworker_pb .CurrentState_Completed_FAILED
491+ }, 0 , remoteworker_pb .CurrentState_Completed_FAILED , nil
492492 }
493493 }
494494 dependencies , err := dependencyTreeBuilder .FinalizeList ()
@@ -497,7 +497,7 @@ func (e *builderExecutor) Execute(ctx context.Context, action *model_build_pb.Ac
497497 Failure : & model_build_pb.Result_Failure {
498498 Status : status .Convert (err ).Proto (),
499499 },
500- }, 0 , remoteworker_pb .CurrentState_Completed_FAILED
500+ }, 0 , remoteworker_pb .CurrentState_Completed_FAILED , nil
501501 }
502502 patcher .Merge (dependencies .Patcher )
503503
@@ -519,7 +519,7 @@ func (e *builderExecutor) Execute(ctx context.Context, action *model_build_pb.Ac
519519 Failure : & model_build_pb.Result_Failure {
520520 Status : status .Convert (err ).Proto (),
521521 },
522- }, 0 , remoteworker_pb .CurrentState_Completed_FAILED
522+ }, 0 , remoteworker_pb .CurrentState_Completed_FAILED , nil
523523 }
524524 }
525525 evaluations , err := evaluationTreeBuilder .FinalizeList ()
@@ -528,7 +528,7 @@ func (e *builderExecutor) Execute(ctx context.Context, action *model_build_pb.Ac
528528 Failure : & model_build_pb.Result_Failure {
529529 Status : status .Convert (err ).Proto (),
530530 },
531- }, 0 , remoteworker_pb .CurrentState_Completed_FAILED
531+ }, 0 , remoteworker_pb .CurrentState_Completed_FAILED , nil
532532 }
533533 var evaluationsReference * model_core_pb.WeakDecodableReference
534534 if len (evaluations .Message ) > 0 {
@@ -542,7 +542,7 @@ func (e *builderExecutor) Execute(ctx context.Context, action *model_build_pb.Ac
542542 Failure : & model_build_pb.Result_Failure {
543543 Status : status .Convert (err ).Proto (),
544544 },
545- }, 0 , remoteworker_pb .CurrentState_Completed_FAILED
545+ }, 0 , remoteworker_pb .CurrentState_Completed_FAILED , nil
546546 }
547547 createdEvaluationsReference := createdEvaluations .Value .GetLocalReference ()
548548 if err := dag .UploadDAG (
@@ -562,7 +562,7 @@ func (e *builderExecutor) Execute(ctx context.Context, action *model_build_pb.Ac
562562 Failure : & model_build_pb.Result_Failure {
563563 Status : status .Convert (errCompute ).Proto (),
564564 },
565- }, 0 , remoteworker_pb .CurrentState_Completed_FAILED
565+ }, 0 , remoteworker_pb .CurrentState_Completed_FAILED , nil
566566 }
567567 evaluationsReference = model_core .DecodableLocalReferenceToWeakProto (
568568 model_core .CopyDecodable (
@@ -583,7 +583,7 @@ func (e *builderExecutor) Execute(ctx context.Context, action *model_build_pb.Ac
583583 Status : status .Convert (err ).Proto (),
584584 },
585585 EvaluationsReference : evaluationsReference ,
586- }, 0 , remoteworker_pb .CurrentState_Completed_FAILED
586+ }, 0 , remoteworker_pb .CurrentState_Completed_FAILED , nil
587587 }
588588 marshaledKey , err := model_core .MarshalTopLevelMessage (keyAny )
589589 if err != nil {
@@ -592,7 +592,7 @@ func (e *builderExecutor) Execute(ctx context.Context, action *model_build_pb.Ac
592592 Status : status .Convert (err ).Proto (),
593593 },
594594 EvaluationsReference : evaluationsReference ,
595- }, 0 , remoteworker_pb .CurrentState_Completed_FAILED
595+ }, 0 , remoteworker_pb .CurrentState_Completed_FAILED , nil
596596 }
597597 marshaledStackTraceKeys = append (marshaledStackTraceKeys , marshaledKey )
598598 }
@@ -602,12 +602,12 @@ func (e *builderExecutor) Execute(ctx context.Context, action *model_build_pb.Ac
602602 Status : status .Convert (errCompute ).Proto (),
603603 },
604604 EvaluationsReference : evaluationsReference ,
605- }, 0 , remoteworker_pb .CurrentState_Completed_FAILED
605+ }, 0 , remoteworker_pb .CurrentState_Completed_FAILED , nil
606606 }
607607 return & model_build_pb.Result {
608608 Failure : & model_build_pb.Result_Failure {
609609 Status : status .Newf (codes .Internal , "TODO: %s" , value ).Proto (),
610610 },
611611 EvaluationsReference : evaluationsReference ,
612- }, 0 , remoteworker_pb .CurrentState_Completed_FAILED
612+ }, 0 , remoteworker_pb .CurrentState_Completed_FAILED , nil
613613}
0 commit comments