| Index: milo/appengine/buildbot/grpc.go
|
| diff --git a/milo/appengine/buildbot/grpc.go b/milo/appengine/buildbot/grpc.go
|
| index 352f640a4d2bc4fb50b0a40f98a2a6a3d4ace433..3a07d879e262a8aaf35d8fc4f4e63d8dd89e08b8 100644
|
| --- a/milo/appengine/buildbot/grpc.go
|
| +++ b/milo/appengine/buildbot/grpc.go
|
| @@ -25,6 +25,34 @@ type Service struct{}
|
|
|
| var errNotFoundGRPC = grpc.Errorf(codes.NotFound, "Master Not Found")
|
|
|
| +func (s *Service) GetBuildbotBuildJSON(
|
| + c context.Context, req *milo.BuildbotBuildRequest) (
|
| + *milo.BuildbotBuildJSON, error) {
|
| +
|
| + if req.Master == "" {
|
| + return nil, grpc.Errorf(codes.InvalidArgument, "No master specified")
|
| + }
|
| + if req.Builder == "" {
|
| + return nil, grpc.Errorf(codes.InvalidArgument, "No builder specified")
|
| + }
|
| +
|
| + b, err := build(c, req.Master, req.Builder, int(req.BuildNum))
|
| + switch {
|
| + case err == errBuildNotFound:
|
| + return nil, grpc.Errorf(codes.NotFound, "Build not found")
|
| + case err != nil:
|
| + return nil, err
|
| + }
|
| +
|
| + bs, err := json.Marshal(b)
|
| + if err != nil {
|
| + return nil, err
|
| + }
|
| +
|
| + // Marshal the build back into JSON format.
|
| + return &milo.BuildbotBuildJSON{Data: bs}, nil
|
| +}
|
| +
|
| // GetCompressedMasterJSON assembles a CompressedMasterJSON object from the
|
| // provided MasterRequest.
|
| func (s *Service) GetCompressedMasterJSON(
|
|
|