Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Unified Diff: milo/appengine/buildinfo/service.go

Issue 2674513003: milo: Add BuildInfo implementation for BuildBot. (Closed)
Patch Set: Comments Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « milo/appengine/buildbot/buildinfo_test.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: milo/appengine/buildinfo/service.go
diff --git a/milo/appengine/buildinfo/service.go b/milo/appengine/buildinfo/service.go
index 12ddb21b6bf8c740c16e338dfaea81d906a51b7a..ed63afe2830f06d0fce6151fea44abe262d132f0 100644
--- a/milo/appengine/buildinfo/service.go
+++ b/milo/appengine/buildinfo/service.go
@@ -8,6 +8,7 @@ import (
"github.com/luci/luci-go/grpc/grpcutil"
"github.com/luci/luci-go/luci_config/common/cfgtypes"
milo "github.com/luci/luci-go/milo/api/proto"
+ "github.com/luci/luci-go/milo/appengine/buildbot"
"google.golang.org/grpc/codes"
@@ -15,7 +16,10 @@ import (
)
// Service is a BuildInfoServer implementation.
-type Service struct{}
+type Service struct {
+ // BuildBot is the BuildInfoProvider for the BuildBot service.
+ BuildBot buildbot.BuildInfoProvider
+}
var _ milo.BuildInfoServer = (*Service)(nil)
@@ -30,12 +34,16 @@ func (svc *Service) Get(c context.Context, req *milo.BuildInfoRequest) (*milo.Bu
switch {
case req.GetBuildbot() != nil:
- return nil, grpcutil.Unimplemented
+ resp, err := svc.BuildBot.GetBuildInfo(c, req.GetBuildbot(), projectHint)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
case req.GetSwarming() != nil:
return nil, grpcutil.Unimplemented
default:
- return nil, grpcutil.Unimplemented
+ return nil, grpcutil.Errf(codes.InvalidArgument, "must supply a build")
}
}
« no previous file with comments | « milo/appengine/buildbot/buildinfo_test.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698