diff options
author | Mikhail Mazurskiy <mmazurskiy@gitlab.com> | 2021-04-23 13:41:31 +0300 |
---|---|---|
committer | Mikhail Mazurskiy <mmazurskiy@gitlab.com> | 2021-05-01 03:33:05 +0300 |
commit | 545cdd3427d74548937a9ab98ca580bbf27339d2 (patch) | |
tree | 783e257032982d5a53e2c825ccbd31c4675d7e71 | |
parent | 13e0435b815fad435a72c0da0d810710abd9b2b4 (diff) |
Embed Unimplemented* structs
31 files changed, 37 insertions, 4 deletions
diff --git a/client/dial_test.go b/client/dial_test.go index e3f5a8cd8..8909f2482 100644 --- a/client/dial_test.go +++ b/client/dial_test.go @@ -147,7 +147,7 @@ func TestDial(t *testing.T) { } type testSvc struct { - proxytestdata.TestServiceServer + proxytestdata.UnimplementedTestServiceServer PingMethod func(context.Context, *proxytestdata.PingRequest) (*proxytestdata.PingResponse, error) PingStreamMethod func(stream proxytestdata.TestService_PingStreamServer) error } diff --git a/cmd/gitaly-hooks/hooks_test.go b/cmd/gitaly-hooks/hooks_test.go index a25837a6a..f74ce2107 100644 --- a/cmd/gitaly-hooks/hooks_test.go +++ b/cmd/gitaly-hooks/hooks_test.go @@ -578,6 +578,7 @@ func runHookServiceServer(t *testing.T, cfg config.Cfg) { } type featureFlagAsserter struct { + gitalypb.UnimplementedHookServiceServer t testing.TB wrapped gitalypb.HookServiceServer } diff --git a/internal/gitaly/service/blob/server.go b/internal/gitaly/service/blob/server.go index 4567d2ff2..df7612501 100644 --- a/internal/gitaly/service/blob/server.go +++ b/internal/gitaly/service/blob/server.go @@ -8,6 +8,7 @@ import ( ) type server struct { + gitalypb.UnimplementedBlobServiceServer cfg config.Cfg locator storage.Locator gitCmdFactory git.CommandFactory diff --git a/internal/gitaly/service/cleanup/server.go b/internal/gitaly/service/cleanup/server.go index 7d58ad4b1..7125d8a3d 100644 --- a/internal/gitaly/service/cleanup/server.go +++ b/internal/gitaly/service/cleanup/server.go @@ -7,6 +7,7 @@ import ( ) type server struct { + gitalypb.UnimplementedCleanupServiceServer cfg config.Cfg gitCmdFactory git.CommandFactory } diff --git a/internal/gitaly/service/commit/server.go b/internal/gitaly/service/commit/server.go index 77d25709d..a967c1c5d 100644 --- a/internal/gitaly/service/commit/server.go +++ b/internal/gitaly/service/commit/server.go @@ -10,6 +10,7 @@ import ( ) type server struct { + gitalypb.UnimplementedCommitServiceServer cfg config.Cfg locator storage.Locator gitCmdFactory git.CommandFactory diff --git a/internal/gitaly/service/conflicts/server.go b/internal/gitaly/service/conflicts/server.go index e87ba6c14..b3aba2aa4 100644 --- a/internal/gitaly/service/conflicts/server.go +++ b/internal/gitaly/service/conflicts/server.go @@ -9,6 +9,7 @@ import ( ) type server struct { + gitalypb.UnimplementedConflictsServiceServer cfg config.Cfg locator storage.Locator gitCmdFactory git.CommandFactory diff --git a/internal/gitaly/service/diff/server.go b/internal/gitaly/service/diff/server.go index 48faf8db1..f133fa721 100644 --- a/internal/gitaly/service/diff/server.go +++ b/internal/gitaly/service/diff/server.go @@ -10,6 +10,7 @@ import ( const msgSizeThreshold = 5 * 1024 type server struct { + gitalypb.UnimplementedDiffServiceServer MsgSizeThreshold int cfg config.Cfg locator storage.Locator diff --git a/internal/gitaly/service/hook/server.go b/internal/gitaly/service/hook/server.go index bc3b739d6..4e04b3809 100644 --- a/internal/gitaly/service/hook/server.go +++ b/internal/gitaly/service/hook/server.go @@ -24,6 +24,7 @@ var ( ) type server struct { + gitalypb.UnimplementedHookServiceServer cfg config.Cfg manager gitalyhook.Manager gitCmdFactory git.CommandFactory diff --git a/internal/gitaly/service/internalgitaly/server.go b/internal/gitaly/service/internalgitaly/server.go index 743aa79a6..4d64ed2d2 100644 --- a/internal/gitaly/service/internalgitaly/server.go +++ b/internal/gitaly/service/internalgitaly/server.go @@ -6,6 +6,7 @@ import ( ) type server struct { + gitalypb.UnimplementedInternalGitalyServer storages []config.Storage } diff --git a/internal/gitaly/service/namespace/server.go b/internal/gitaly/service/namespace/server.go index c7708c2a2..27010370a 100644 --- a/internal/gitaly/service/namespace/server.go +++ b/internal/gitaly/service/namespace/server.go @@ -6,6 +6,7 @@ import ( ) type server struct { + gitalypb.UnimplementedNamespaceServiceServer locator storage.Locator } diff --git a/internal/gitaly/service/objectpool/server.go b/internal/gitaly/service/objectpool/server.go index e281b3335..3f0d12dd8 100644 --- a/internal/gitaly/service/objectpool/server.go +++ b/internal/gitaly/service/objectpool/server.go @@ -8,6 +8,7 @@ import ( ) type server struct { + gitalypb.UnimplementedObjectPoolServiceServer cfg config.Cfg locator storage.Locator gitCmdFactory git.CommandFactory diff --git a/internal/gitaly/service/operations/server.go b/internal/gitaly/service/operations/server.go index cef135c76..89db64374 100644 --- a/internal/gitaly/service/operations/server.go +++ b/internal/gitaly/service/operations/server.go @@ -10,9 +10,11 @@ import ( "gitlab.com/gitlab-org/gitaly/internal/gitaly/hook" "gitlab.com/gitlab-org/gitaly/internal/gitaly/rubyserver" "gitlab.com/gitlab-org/gitaly/internal/storage" + "gitlab.com/gitlab-org/gitaly/proto/go/gitalypb" ) type Server struct { + gitalypb.UnimplementedOperationServiceServer cfg config.Cfg ruby *rubyserver.Server hookManager hook.Manager diff --git a/internal/gitaly/service/ref/server.go b/internal/gitaly/service/ref/server.go index 7c0da1771..48bfc176b 100644 --- a/internal/gitaly/service/ref/server.go +++ b/internal/gitaly/service/ref/server.go @@ -9,6 +9,7 @@ import ( ) type server struct { + gitalypb.UnimplementedRefServiceServer cfg config.Cfg txManager transaction.Manager locator storage.Locator diff --git a/internal/gitaly/service/remote/server.go b/internal/gitaly/service/remote/server.go index 05ddd7122..39fb461ad 100644 --- a/internal/gitaly/service/remote/server.go +++ b/internal/gitaly/service/remote/server.go @@ -10,6 +10,7 @@ import ( ) type server struct { + gitalypb.UnimplementedRemoteServiceServer cfg config.Cfg ruby *rubyserver.Server locator storage.Locator diff --git a/internal/gitaly/service/repository/server.go b/internal/gitaly/service/repository/server.go index b73e29047..009c27536 100644 --- a/internal/gitaly/service/repository/server.go +++ b/internal/gitaly/service/repository/server.go @@ -11,6 +11,7 @@ import ( ) type server struct { + gitalypb.UnimplementedRepositoryServiceServer ruby *rubyserver.Server conns *client.Pool locator storage.Locator diff --git a/internal/gitaly/service/server/server.go b/internal/gitaly/service/server/server.go index 73dd1db95..d46635c05 100644 --- a/internal/gitaly/service/server/server.go +++ b/internal/gitaly/service/server/server.go @@ -7,6 +7,7 @@ import ( ) type server struct { + gitalypb.UnimplementedServerServiceServer gitCmdFactory git.CommandFactory storages []config.Storage } diff --git a/internal/gitaly/service/smarthttp/server.go b/internal/gitaly/service/smarthttp/server.go index 443dda253..b3c3102e3 100644 --- a/internal/gitaly/service/smarthttp/server.go +++ b/internal/gitaly/service/smarthttp/server.go @@ -10,6 +10,7 @@ import ( ) type server struct { + gitalypb.UnimplementedSmartHTTPServiceServer cfg config.Cfg locator storage.Locator gitCmdFactory git.CommandFactory diff --git a/internal/gitaly/service/ssh/server.go b/internal/gitaly/service/ssh/server.go index 9e1cf3306..560b89612 100644 --- a/internal/gitaly/service/ssh/server.go +++ b/internal/gitaly/service/ssh/server.go @@ -16,6 +16,7 @@ var ( ) type server struct { + gitalypb.UnimplementedSSHServiceServer cfg config.Cfg locator storage.Locator gitCmdFactory git.CommandFactory diff --git a/internal/gitaly/service/wiki/server.go b/internal/gitaly/service/wiki/server.go index b43e07749..edb305daa 100644 --- a/internal/gitaly/service/wiki/server.go +++ b/internal/gitaly/service/wiki/server.go @@ -7,6 +7,7 @@ import ( ) type server struct { + gitalypb.UnimplementedWikiServiceServer ruby *rubyserver.Server locator storage.Locator } diff --git a/internal/gitaly/transaction/manager_test.go b/internal/gitaly/transaction/manager_test.go index 2599fa2d4..05dc5fe11 100644 --- a/internal/gitaly/transaction/manager_test.go +++ b/internal/gitaly/transaction/manager_test.go @@ -23,6 +23,7 @@ import ( ) type testTransactionServer struct { + gitalypb.UnimplementedRefTransactionServer vote func(*gitalypb.VoteTransactionRequest) (*gitalypb.VoteTransactionResponse, error) stop func(*gitalypb.StopTransactionRequest) (*gitalypb.StopTransactionResponse, error) } diff --git a/internal/helper/chunk/chunker_test.go b/internal/helper/chunk/chunker_test.go index 9f5bfc422..8a931111f 100644 --- a/internal/helper/chunk/chunker_test.go +++ b/internal/helper/chunk/chunker_test.go @@ -64,7 +64,9 @@ func TestChunker(t *testing.T) { } } -type server struct{} +type server struct { + test.UnimplementedTestServer +} func (s *server) StreamOutput(req *test.StreamOutputRequest, srv test.Test_StreamOutputServer) error { const kilobyte = 1024 diff --git a/internal/middleware/cache/cache_test.go b/internal/middleware/cache/cache_test.go index 2ef7635ce..ad0c8648b 100644 --- a/internal/middleware/cache/cache_test.go +++ b/internal/middleware/cache/cache_test.go @@ -201,6 +201,7 @@ func newTestSvc(t testing.TB, ctx context.Context, srvr *grpc.Server, svc testda } type testSvc struct { + testdata.UnimplementedTestServiceServer repoRequests []gitalypb.Repository } diff --git a/internal/middleware/limithandler/testhelper_test.go b/internal/middleware/limithandler/testhelper_test.go index 3dd576fb0..8322b4610 100644 --- a/internal/middleware/limithandler/testhelper_test.go +++ b/internal/middleware/limithandler/testhelper_test.go @@ -8,8 +8,9 @@ import ( ) type server struct { + pb.UnimplementedTestServer requestCount uint64 - blockCh chan (struct{}) + blockCh chan struct{} } func (s *server) registerRequest() { diff --git a/internal/praefect/grpc-proxy/proxy/handler_test.go b/internal/praefect/grpc-proxy/proxy/handler_test.go index e20678708..f472090a4 100644 --- a/internal/praefect/grpc-proxy/proxy/handler_test.go +++ b/internal/praefect/grpc-proxy/proxy/handler_test.go @@ -58,6 +58,7 @@ func TestMain(m *testing.M) { // asserting service is implemented on the server side and serves as a handler for stuff type assertingService struct { + pb.UnimplementedTestServiceServer t *testing.T } diff --git a/internal/praefect/grpc-proxy/proxy/helper_test.go b/internal/praefect/grpc-proxy/proxy/helper_test.go index c240f8d71..0f14fb1be 100644 --- a/internal/praefect/grpc-proxy/proxy/helper_test.go +++ b/internal/praefect/grpc-proxy/proxy/helper_test.go @@ -88,6 +88,7 @@ func newProxy(tb testing.TB, ctx context.Context, director proxy.StreamDirector, // interceptPinger allows an RPC to be intercepted with a custom // function defined in each unit test type interceptPinger struct { + testservice.UnimplementedTestServiceServer pingStream func(testservice.TestService_PingStreamServer) error pingEmpty func(context.Context, *testservice.Empty) (*testservice.PingResponse, error) ping func(context.Context, *testservice.PingRequest) (*testservice.PingResponse, error) diff --git a/internal/praefect/middleware/errorhandler_test.go b/internal/praefect/middleware/errorhandler_test.go index 72e969f5c..1f0081cff 100644 --- a/internal/praefect/middleware/errorhandler_test.go +++ b/internal/praefect/middleware/errorhandler_test.go @@ -20,7 +20,9 @@ import ( "google.golang.org/grpc" ) -type simpleService struct{} +type simpleService struct { + mock.UnimplementedSimpleServiceServer +} func (s *simpleService) RepoAccessorUnary(ctx context.Context, in *mock.RepoRequest) (*empty.Empty, error) { if in.GetRepo() == nil { diff --git a/internal/praefect/mocksvc_test.go b/internal/praefect/mocksvc_test.go index 0a7a4e091..a60bd58e8 100644 --- a/internal/praefect/mocksvc_test.go +++ b/internal/praefect/mocksvc_test.go @@ -15,6 +15,7 @@ type ( // mockSvc is an implementation of mock.SimpleServer for testing purposes. The // gRPC stub can be updated by running `make proto`. type mockSvc struct { + mock.UnimplementedSimpleServiceServer repoAccessorUnary repoAccessorUnaryFunc repoMutatorUnary repoMutatorUnaryFunc } diff --git a/internal/praefect/server_test.go b/internal/praefect/server_test.go index 7726fd544..c7dba6eb3 100644 --- a/internal/praefect/server_test.go +++ b/internal/praefect/server_test.go @@ -609,6 +609,7 @@ func TestRenameRepository(t *testing.T) { } type mockSmartHTTP struct { + gitalypb.UnimplementedSmartHTTPServiceServer txMgr *transactions.Manager m sync.Mutex methodsCalled map[string]int diff --git a/internal/praefect/service/info/server.go b/internal/praefect/service/info/server.go index e54ea267a..48c580c0e 100644 --- a/internal/praefect/service/info/server.go +++ b/internal/praefect/service/info/server.go @@ -34,6 +34,7 @@ type PrimaryGetter interface { // Server is a InfoService server type Server struct { + gitalypb.UnimplementedPraefectInfoServiceServer nodeMgr nodes.Manager conf config.Config queue datastore.ReplicationEventQueue diff --git a/internal/praefect/service/server/server.go b/internal/praefect/service/server/server.go index 69381f6f1..703363608 100644 --- a/internal/praefect/service/server/server.go +++ b/internal/praefect/service/server/server.go @@ -8,6 +8,7 @@ import ( // Server is a ServerService server type Server struct { + gitalypb.UnimplementedServerServiceServer conf config.Config conns service.Connections } diff --git a/internal/praefect/service/transaction/server.go b/internal/praefect/service/transaction/server.go index ceabc2282..30b40a66c 100644 --- a/internal/praefect/service/transaction/server.go +++ b/internal/praefect/service/transaction/server.go @@ -11,6 +11,7 @@ import ( ) type Server struct { + gitalypb.UnimplementedRefTransactionServer txMgr *transactions.Manager } |