From 5f804ca0ef0b61ed1299476ab432382b60c80476 Mon Sep 17 00:00:00 2001 From: Sami Hiltunen Date: Thu, 10 Sep 2020 17:45:21 +0200 Subject: [PATCH 1/5] remove server scoped handling from coordinator This commit removes server scoped request handling from the coordinator as there are no server scoped RPCs Praefect should direct to Gitaly nodes. --- .../unreleased/smh-remove-server-scope.yml | 5 + internal/praefect/coordinator.go | 17 ---- internal/praefect/coordinator_test.go | 98 ------------------- internal/praefect/helper_test.go | 9 -- internal/praefect/server_test.go | 47 --------- 5 files changed, 5 insertions(+), 171 deletions(-) create mode 100644 changelogs/unreleased/smh-remove-server-scope.yml diff --git a/changelogs/unreleased/smh-remove-server-scope.yml b/changelogs/unreleased/smh-remove-server-scope.yml new file mode 100644 index 0000000000..4208143524 --- /dev/null +++ b/changelogs/unreleased/smh-remove-server-scope.yml @@ -0,0 +1,5 @@ +--- +title: Remove server scoped handling from coordinator +merge_request: 2546 +author: +type: removed diff --git a/internal/praefect/coordinator.go b/internal/praefect/coordinator.go index 4769c73e97..6a193f5142 100644 --- a/internal/praefect/coordinator.go +++ b/internal/praefect/coordinator.go @@ -447,23 +447,6 @@ func (c *Coordinator) StreamDirector(ctx context.Context, fullMethodName string, return c.directStorageScopedMessage(ctx, mi, m) } - // TODO: please refer to https://gitlab.com/gitlab-org/gitaly/-/issues/2974 - if mi.Scope == protoregistry.ScopeServer { - shard, err := c.nodeMgr.GetShard(c.conf.VirtualStorages[0].Name) - if err != nil { - if errors.Is(err, nodes.ErrVirtualStorageNotExist) { - return nil, helper.ErrInvalidArgument(err) - } - return nil, err - } - - return proxy.NewStreamParameters(proxy.Destination{ - Ctx: helper.IncomingToOutgoing(ctx), - Conn: shard.Primary.GetConnection(), - Msg: payload, - }, nil, func() error { return nil }, nil), nil - } - return nil, helper.ErrInternalf("rpc with undefined scope %q", mi.Scope) } diff --git a/internal/praefect/coordinator_test.go b/internal/praefect/coordinator_test.go index c01e0ac3ed..a229a69a87 100644 --- a/internal/praefect/coordinator_test.go +++ b/internal/praefect/coordinator_test.go @@ -898,104 +898,6 @@ func TestCoordinatorEnqueueFailure(t *testing.T) { require.Equal(t, err.Error(), "rpc error: code = Unknown desc = enqueue replication event: "+expectErrMsg) } -func TestStreamDirectorServerScope(t *testing.T) { - gz := proto.FileDescriptor("mock.proto") - fd, err := protoregistry.ExtractFileDescriptor(gz) - require.NoError(t, err) - - registry, err := protoregistry.New(fd) - require.NoError(t, err) - - conf := config.Config{VirtualStorages: []*config.VirtualStorage{{Name: "praefect"}, {Name: "another"}}} - mgr := &nodes.MockManager{GetShardFunc: func(s string) (nodes.Shard, error) { - require.Equal(t, "praefect", s) - return nodes.Shard{Primary: &nodes.MockNode{}}, nil - }} - coordinator := NewCoordinator( - nil, - datastore.NewMemoryRepositoryStore(conf.StorageNames()), - mgr, - nil, - conf, - registry, - ) - - fullMethod := "/mock.SimpleService/ServerAccessor" - requireScopeOperation(t, coordinator.registry, fullMethod, protoregistry.ScopeServer, protoregistry.OpAccessor) - - frame, err := proto.Marshal(&mock.SimpleRequest{}) - require.NoError(t, err) - - ctx, cancel := testhelper.Context() - defer cancel() - - sp, err := coordinator.StreamDirector(ctx, fullMethod, &mockPeeker{frame}) - require.NoError(t, err) - require.NotNil(t, sp.Primary()) - require.Empty(t, sp.Secondaries()) -} - -func TestStreamDirectorServerScope_Error(t *testing.T) { - gz := proto.FileDescriptor("mock.proto") - fd, err := protoregistry.ExtractFileDescriptor(gz) - require.NoError(t, err) - - registry, err := protoregistry.New(fd) - require.NoError(t, err) - - conf := config.Config{VirtualStorages: []*config.VirtualStorage{{Name: "fake"}, {Name: "another"}}} - rs := datastore.NewMemoryRepositoryStore(conf.StorageNames()) - - t.Run("unknown storage provided", func(t *testing.T) { - mgr := &nodes.MockManager{ - GetShardFunc: func(s string) (nodes.Shard, error) { - require.Equal(t, "fake", s) - return nodes.Shard{}, nodes.ErrVirtualStorageNotExist - }, - } - coordinator := NewCoordinator(nil, rs, mgr, nil, conf, registry) - - fullMethod := "/mock.SimpleService/ServerAccessor" - requireScopeOperation(t, coordinator.registry, fullMethod, protoregistry.ScopeServer, protoregistry.OpAccessor) - - frame, err := proto.Marshal(&mock.SimpleRequest{}) - require.NoError(t, err) - - ctx, cancel := testhelper.Context() - defer cancel() - - _, err = coordinator.StreamDirector(ctx, fullMethod, &mockPeeker{frame}) - require.Error(t, err) - result, ok := status.FromError(err) - require.True(t, ok) - require.Equal(t, codes.InvalidArgument, result.Code()) - require.Equal(t, "virtual storage does not exist", result.Message()) - }) - - t.Run("primary not healthy", func(t *testing.T) { - mgr := &nodes.MockManager{ - GetShardFunc: func(s string) (nodes.Shard, error) { - require.Equal(t, "fake", s) - return nodes.Shard{}, nodes.ErrPrimaryNotHealthy - }, - } - coordinator := NewCoordinator(nil, rs, mgr, nil, conf, registry) - - fullMethod := "/mock.SimpleService/ServerAccessor" - requireScopeOperation(t, coordinator.registry, fullMethod, protoregistry.ScopeServer, protoregistry.OpAccessor) - - frame, err := proto.Marshal(&mock.SimpleRequest{}) - require.NoError(t, err) - - ctx, cancel := testhelper.Context() - defer cancel() - - _, err = coordinator.StreamDirector(ctx, fullMethod, &mockPeeker{frame}) - require.Error(t, err) - require.Equal(t, nodes.ErrPrimaryNotHealthy, err) - }) -} - func TestStreamDirectorStorageScope(t *testing.T) { // stubs health-check requests because nodes.NewManager establishes connection on creation gitalySocket0, gitalySocket1 := testhelper.GetTemporaryGitalySocketFileName(), testhelper.GetTemporaryGitalySocketFileName() diff --git a/internal/praefect/helper_test.go b/internal/praefect/helper_test.go index 8a5e301e2f..3ca5c02212 100644 --- a/internal/praefect/helper_test.go +++ b/internal/praefect/helper_test.go @@ -34,15 +34,6 @@ import ( healthpb "google.golang.org/grpc/health/grpc_health_v1" ) -func waitUntil(t *testing.T, ch <-chan struct{}, timeout time.Duration) { - select { - case <-ch: - break - case <-time.After(timeout): - t.Errorf("timed out waiting for channel after %s", timeout) - } -} - // generates a praefect configuration with the specified number of backend // nodes func testConfig(backends int) config.Config { diff --git a/internal/praefect/server_test.go b/internal/praefect/server_test.go index 6e5f7704bd..6aee6fd991 100644 --- a/internal/praefect/server_test.go +++ b/internal/praefect/server_test.go @@ -46,53 +46,6 @@ import ( "google.golang.org/grpc/status" ) -func TestServerRouteServerAccessor(t *testing.T) { - var ( - conf = testConfig(1) - reqQ = make(chan *mock.SimpleRequest) - - expectResp = &mock.SimpleResponse{Value: 2} - - // note: a server scoped RPC will be randomly routed - // to an available backend server. To simplify our - // test, a single backend server is used. - backends = map[string]mock.SimpleServiceServer{ - conf.VirtualStorages[0].Nodes[0].Storage: &mockSvc{ - serverAccessor: func(_ context.Context, req *mock.SimpleRequest) (*mock.SimpleResponse, error) { - reqQ <- req - return expectResp, nil - }, - }, - } - ) - - cc, _, cleanup := runPraefectServerWithMock(t, conf, nil, backends) - defer cleanup() - - cli := mock.NewSimpleServiceClient(cc) - - expectReq := &mock.SimpleRequest{Value: 1} - - done := make(chan struct{}) - go func() { - defer close(done) - - actualReq := <-reqQ - assert.True(t, proto.Equal(expectReq, actualReq), - "received unexpected request value: %+v instead of %+v", actualReq, expectReq) - }() - - ctx, cancel := testhelper.Context(testhelper.ContextWithTimeout(time.Second)) - defer cancel() - - actualResp, err := cli.ServerAccessor(ctx, expectReq) - require.NoError(t, err) - require.True(t, proto.Equal(expectResp, actualResp), - "expected response was not routed back") - - waitUntil(t, done, time.Second) -} - func TestGitalyServerInfo(t *testing.T) { gitVersion, err := git.Version() require.NoError(t, err) -- GitLab From 9890ee47f48f56b7e70bfa9b4a054bca394e467c Mon Sep 17 00:00:00 2001 From: Sami Hiltunen Date: Tue, 15 Sep 2020 16:49:24 +0200 Subject: [PATCH 2/5] fix linter test proto generation Linter's test protos were not generated by the Makefile. This commit generates them via the usual 'proto' target. --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index dada7da278..b66d0d2d72 100644 --- a/Makefile +++ b/Makefile @@ -319,6 +319,7 @@ proto: ${PROTOC_GEN_GITALY} ${SOURCE_DIR}/.ruby-bundle ${SOURCE_DIR}/_support/generate-proto-ruby ${Q}# this part is related to the generation of sources from testing proto files ${PROTOC} --plugin=${PROTOC_GEN_GO} --go_out=plugins=grpc:. internal/praefect/grpc-proxy/testdata/test.proto + ${PROTOC} -I proto --plugin=${PROTOC_GEN_GO} --go_out=plugins=grpc:proto proto/go/internal/linter/testdata/*.proto .PHONY: proto-lint proto-lint: ${PROTOC} ${PROTOC_GEN_GO} -- GitLab From c4287b1cd2c478ab12f84963f26c3a40d2dd3038 Mon Sep 17 00:00:00 2001 From: Sami Hiltunen Date: Tue, 15 Sep 2020 16:56:52 +0200 Subject: [PATCH 3/5] add intercepted option to mark a service handled by praefect Adds an option for marking a gRPC service as handled by Praefect. Services handled by Praefect do not need operation or scope annotations as they are only used for proxying logic. --- .../praefect/protoregistry/protoregistry.go | 37 +- proto/go/gitalypb/lint.pb.go | 62 +- proto/go/gitalypb/praefect.pb.go | 97 ++- proto/go/gitalypb/server.pb.go | 60 +- proto/go/internal/extension.go | 39 - proto/go/internal/linter/lint.go | 8 + proto/go/internal/linter/method.go | 8 +- .../go/internal/linter/testdata/invalid.pb.go | 705 ++++++++++++++++-- .../go/internal/linter/testdata/invalid.proto | 1 + proto/go/internal/linter/testdata/valid.pb.go | 685 ++++++++++------- proto/go/internal/linter/testdata/valid.proto | 8 + proto/lint.proto | 7 + proto/praefect.proto | 36 +- proto/server.proto | 16 +- 14 files changed, 1272 insertions(+), 497 deletions(-) diff --git a/internal/praefect/protoregistry/protoregistry.go b/internal/praefect/protoregistry/protoregistry.go index 7acc94d035..0ded5fad84 100644 --- a/internal/praefect/protoregistry/protoregistry.go +++ b/internal/praefect/protoregistry/protoregistry.go @@ -179,6 +179,12 @@ func New(protos ...*descriptor.FileDescriptorProto) (*Registry, error) { for _, p := range protos { for _, svc := range p.GetService() { + if intercepted, err := IsIntercepted(svc); err != nil { + return nil, fmt.Errorf("is intercepted: %w", err) + } else if intercepted { + continue + } + for _, method := range svc.GetMethod() { mi, err := parseMethodInfo(p, method) if err != nil { @@ -201,7 +207,7 @@ func getOpExtension(m *descriptor.MethodDescriptorProto) (*gitalypb.OperationMsg options := m.GetOptions() if !proto.HasExtension(options, gitalypb.E_OpType) { - return nil, fmt.Errorf("method %s missing op_type option", m.GetName()) + return &gitalypb.OperationMsg{}, fmt.Errorf("method %s missing op_type option", m.GetName()) } ext, err := proto.GetExtension(options, gitalypb.E_OpType) @@ -295,8 +301,8 @@ func parseMethodInfo(p *descriptor.FileDescriptorProto, methodDesc *descriptor.M if scope == ScopeRepository { m := matcher{ - match: getTargetRepositoryExtension, - subMatch: getRepositoryExtension, + match: GetTargetRepositoryExtension, + subMatch: GetRepositoryExtension, expectedType: ".gitaly.Repository", topLevelMsgs: topLevelMsgs, } @@ -318,7 +324,7 @@ func parseMethodInfo(p *descriptor.FileDescriptorProto, methodDesc *descriptor.M mi.additionalRepo = additionalRepo } else if scope == ScopeStorage { m := matcher{ - match: getStorageExtension, + match: GetStorageExtension, topLevelMsgs: topLevelMsgs, } storage, err := m.findField(topLevelMsgs[typeName]) @@ -365,25 +371,30 @@ func getTopLevelMsgs(p *descriptor.FileDescriptorProto) (map[string]*descriptor. return topLevelMsgs, nil } -func getStorageExtension(m *descriptor.FieldDescriptorProto) (bool, error) { - return getBoolExtension(m, gitalypb.E_Storage) +func IsIntercepted(s *descriptor.ServiceDescriptorProto) (bool, error) { + return getBoolExtension(s.GetOptions(), gitalypb.E_Intercepted) +} + +// GetStorageExtension gets the storage extension from a field descriptor +func GetStorageExtension(m *descriptor.FieldDescriptorProto) (bool, error) { + return getBoolExtension(m.GetOptions(), gitalypb.E_Storage) } -func getTargetRepositoryExtension(m *descriptor.FieldDescriptorProto) (bool, error) { - return getBoolExtension(m, gitalypb.E_TargetRepository) +// GetTargetRepositoryExtension gets the target_repository extension from a field descriptor +func GetTargetRepositoryExtension(m *descriptor.FieldDescriptorProto) (bool, error) { + return getBoolExtension(m.GetOptions(), gitalypb.E_TargetRepository) } func getAdditionalRepositoryExtension(m *descriptor.FieldDescriptorProto) (bool, error) { return getBoolExtension(m, gitalypb.E_AdditionalRepository) } -func getRepositoryExtension(m *descriptor.FieldDescriptorProto) (bool, error) { - return getBoolExtension(m, gitalypb.E_Repository) +// GetRepositoryExtension gets the repository extension from a field descriptor +func GetRepositoryExtension(m *descriptor.FieldDescriptorProto) (bool, error) { + return getBoolExtension(m.GetOptions(), gitalypb.E_Repository) } -func getBoolExtension(m *descriptor.FieldDescriptorProto, extension *proto.ExtensionDesc) (bool, error) { - options := m.GetOptions() - +func getBoolExtension(options proto.Message, extension *proto.ExtensionDesc) (bool, error) { if !proto.HasExtension(options, extension) { return false, nil } diff --git a/proto/go/gitalypb/lint.pb.go b/proto/go/gitalypb/lint.pb.go index cf0b4e678e..8b843cf22e 100644 --- a/proto/go/gitalypb/lint.pb.go +++ b/proto/go/gitalypb/lint.pb.go @@ -128,6 +128,15 @@ func (m *OperationMsg) GetScopeLevel() OperationMsg_Scope { return OperationMsg_REPOSITORY } +var E_Intercepted = &proto.ExtensionDesc{ + ExtendedType: (*descriptor.ServiceOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 82302, + Name: "gitaly.intercepted", + Tag: "varint,82302,opt,name=intercepted", + Filename: "lint.proto", +} + var E_OpType = &proto.ExtensionDesc{ ExtendedType: (*descriptor.MethodOptions)(nil), ExtensionType: (*OperationMsg)(nil), @@ -177,6 +186,7 @@ func init() { proto.RegisterEnum("gitaly.OperationMsg_Operation", OperationMsg_Operation_name, OperationMsg_Operation_value) proto.RegisterEnum("gitaly.OperationMsg_Scope", OperationMsg_Scope_name, OperationMsg_Scope_value) proto.RegisterType((*OperationMsg)(nil), "gitaly.OperationMsg") + proto.RegisterExtension(E_Intercepted) proto.RegisterExtension(E_OpType) proto.RegisterExtension(E_Storage) proto.RegisterExtension(E_Repository) @@ -187,30 +197,32 @@ func init() { func init() { proto.RegisterFile("lint.proto", fileDescriptor_1612d42a10b555ca) } var fileDescriptor_1612d42a10b555ca = []byte{ - // 397 bytes of a gzipped FileDescriptorProto + // 425 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0x41, 0x6b, 0xd4, 0x40, - 0x14, 0x80, 0x9b, 0x40, 0x37, 0xf5, 0xa5, 0x94, 0x38, 0x54, 0x58, 0x0a, 0x96, 0x65, 0x4f, 0xbd, - 0x38, 0x29, 0xed, 0xc9, 0x78, 0x90, 0xb5, 0x44, 0x11, 0xbb, 0x3b, 0x32, 0x49, 0x15, 0xbd, 0x2c, - 0xc9, 0x66, 0x1c, 0x03, 0x63, 0xdf, 0x30, 0x19, 0x85, 0x5c, 0xfd, 0x75, 0xfe, 0x0d, 0xab, 0xff, - 0x43, 0x99, 0x24, 0x6d, 0x0a, 0x16, 0xd4, 0x5b, 0xde, 0xe3, 0xfb, 0x3e, 0x92, 0x47, 0x00, 0x54, - 0x7d, 0x69, 0xa9, 0x36, 0x68, 0x91, 0x4c, 0x64, 0x6d, 0x0b, 0xd5, 0x1e, 0xcc, 0x24, 0xa2, 0x54, - 0x22, 0xee, 0xb6, 0xe5, 0xe7, 0x0f, 0x71, 0x25, 0x9a, 0x8d, 0xa9, 0xb5, 0x45, 0xd3, 0x93, 0xf3, - 0x2b, 0x0f, 0x76, 0x99, 0x16, 0xa6, 0xb0, 0x35, 0x5e, 0x2e, 0x1b, 0x49, 0x28, 0xf8, 0xa8, 0xa7, - 0xde, 0xcc, 0x3b, 0xda, 0x3b, 0x39, 0xa4, 0x7d, 0x87, 0xde, 0x26, 0xc6, 0x81, 0xfb, 0xa8, 0xc9, - 0x13, 0x08, 0x9b, 0x0d, 0x6a, 0xb1, 0x56, 0xe2, 0x8b, 0x50, 0x53, 0xbf, 0x13, 0x0f, 0xee, 0x14, - 0x33, 0xc7, 0x71, 0xe8, 0xf0, 0x73, 0x47, 0xcf, 0x4f, 0xe1, 0xde, 0x0d, 0x41, 0x42, 0x08, 0x2e, - 0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 0x6f, 0xf4, 0xf5, 0x9a, 0xde, 0x42, 0xa2, 0x0b, 0xb8, 0x6f, 0x32, 0x5d, 0xa2, + 0x99, 0xff, 0xbb, 0xe7, 0xc7, 0xda, 0xe3, 0x5b, 0x52, 0x74, 0xb6, 0x14, 0x1e, 0x64, 0x45, 0x21, + 0x9b, 0x58, 0x56, 0xfd, 0x87, 0xf1, 0xe7, 0xda, 0x78, 0xd8, 0xd1, 0x9d, 0xf5, 0xf9, 0xe9, 0x87, + 0xa6, 0xbe, 0x2a, 0x5b, 0x04, 0x39, 0x7d, 0x0e, 0xed, 0xf3, 0x31, 0xe9, 0x32, 0xb4, 0xa5, 0xda, + 0x4f, 0x1d, 0x96, 0xb4, 0x9e, 0xd5, 0x62, 0xd1, 0x6b, 0x57, 0xe7, 0x7f, 0x02, 0x00, 0x00, 0xff, + 0xff, 0xb2, 0x98, 0xf0, 0x1b, 0x0b, 0x03, 0x00, 0x00, } diff --git a/proto/go/gitalypb/praefect.pb.go b/proto/go/gitalypb/praefect.pb.go index e674376e76..8c19aba37a 100644 --- a/proto/go/gitalypb/praefect.pb.go +++ b/proto/go/gitalypb/praefect.pb.go @@ -617,55 +617,54 @@ func init() { func init() { proto.RegisterFile("praefect.proto", fileDescriptor_d32bf44842ead735) } var fileDescriptor_d32bf44842ead735 = []byte{ - // 765 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcd, 0x6e, 0xd3, 0x4c, - 0x14, 0x95, 0x93, 0x7c, 0xad, 0x7b, 0xd3, 0x9f, 0x74, 0xbe, 0x96, 0x06, 0x53, 0xfa, 0x63, 0x04, - 0x8d, 0x44, 0x9b, 0x54, 0x29, 0x12, 0x12, 0x2b, 0x68, 0xbb, 0x29, 0xaa, 0x68, 0xe4, 0x4a, 0x2c, - 0xd8, 0x58, 0x63, 0x7b, 0x9a, 0x0c, 0x4c, 0x3c, 0x66, 0x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 0xac, 0x53, 0xdf, 0x65, 0x03, 0x2f, 0xee, 0x41, 0x48, 0x8a, 0x19, 0x8b, 0x6c, 0x41, 0x02, 0x46, - 0x5d, 0x2c, 0x89, 0x97, 0xf4, 0xa4, 0x5b, 0x86, 0xc2, 0x74, 0x32, 0x88, 0x95, 0x23, 0xcc, 0x9f, - 0x25, 0x58, 0x1d, 0xdb, 0x49, 0xba, 0x47, 0x54, 0x87, 0xd9, 0x40, 0xd0, 0x3e, 0x16, 0x51, 0xba, - 0x05, 0x2b, 0xfb, 0x45, 0xa7, 0x30, 0x2f, 0x48, 0xc0, 0x43, 0x2a, 0xb9, 0xa0, 0x24, 0xac, 0x97, - 0xb6, 0xca, 0x8d, 0x6a, 0xbb, 0xd1, 0x4c, 0x5d, 0x6c, 0x16, 0xd2, 0x35, 0xad, 0xac, 0x22, 0xb2, - 0x46, 0xaa, 0x8d, 0x1f, 0x1a, 0xc0, 0x55, 0x72, 0xd2, 0x17, 0xad, 0xc0, 0x97, 0x53, 0xd0, 0x95, - 0x3c, 0xd9, 0xea, 0xfb, 0x7f, 0xbb, 0x7a, 0x33, 0xf3, 0x22, 0x67, 0x40, 0xf7, 0x60, 0x4e, 0x10, - 0xec, 0xd9, 0xdc, 0x67, 0x51, 0xe2, 0xac, 0x6e, 0xe9, 0x71, 0xe0, 0xcc, 0x67, 0x91, 0xf1, 0x0c, - 0x66, 0x33, 0xb5, 0x11, 0x54, 0x7c, 0xdc, 0x57, 0x8e, 0x58, 0xc9, 0x77, 0x5c, 0xeb, 0x90, 0x1e, - 0xf5, 0x3d, 0xdb, 0x89, 0x12, 0xb9, 0xcb, 0x96, 0x9e, 0x06, 0x0e, 0x23, 0xf3, 0x0c, 0xee, 0x0e, - 0xb5, 0x9d, 0x8a, 0x1e, 0x66, 0x56, 0xb7, 0x01, 0x72, 0x1d, 0x52, 0x89, 0xab, 0x6d, 0x94, 0x75, - 0x31, 0x54, 0x36, 0x84, 0x32, 0x3f, 0x97, 0xc0, 0x28, 0x62, 0x54, 0x96, 0xbd, 0x1a, 0xb5, 0xac, - 0xda, 0x7e, 0x52, 0xc0, 0x37, 0x56, 0x34, 0x94, 0x3a, 0x26, 0x12, 0x53, 0x16, 0x5e, 0x19, 0xdd, - 0x01, 0x5d, 0x0d, 0x53, 0x26, 0xf3, 0xed, 0x08, 0x73, 0x16, 0xc3, 0x85, 0xe5, 0x89, 0xf4, 0x6d, - 0x94, 0x40, 0x06, 0xe8, 0x6e, 0xec, 0x70, 0x38, 0xe8, 0xab, 0x93, 0x9b, 0xff, 0x9b, 0xdf, 0x35, - 0x58, 0x3b, 0xe2, 0x7e, 0x48, 0x43, 0x49, 0x7c, 0x37, 0xfa, 0x97, 0x03, 0xf6, 0x10, 0x16, 0x25, - 0x16, 0x5d, 0x22, 0x73, 0x74, 0xba, 0xd8, 0x42, 0x1a, 0xcd, 0x60, 0x8f, 0x61, 0x59, 0x90, 0x0b, - 0x22, 0x88, 0xef, 0x8e, 0xdf, 0x11, 0xb5, 0x3c, 0x91, 0x81, 0x9f, 0xc2, 0x9a, 0x47, 0x43, 0xec, - 0x30, 0x62, 0x0b, 0xe2, 0x72, 0xdf, 0xa5, 0x8c, 0x51, 0x2c, 0x29, 0xf7, 0xeb, 0x95, 0x64, 0xf8, - 0xee, 0xa8, 0xb4, 0x35, 0x9a, 0x35, 0x7f, 0x69, 0x50, 0x9f, 0xec, 0x4b, 0x79, 0xbf, 0x0b, 0x28, - 0x96, 0xc7, 0x2e, 0x3a, 0x3c, 0xb5, 0x38, 0x63, 0x0d, 0x1f, 0xa0, 0x1d, 0x58, 0x52, 0x7d, 0x8d, - 0xa9, 0xa8, 0xda, 0x3d, 0x52, 0x51, 0xb4, 0x17, 0xd3, 0x66, 0x9d, 0xe5, 0xd8, 0xb4, 0xb5, 0xab, - 0x9e, 0x73, 0xf8, 0x06, 0x54, 0x63, 0xaf, 0xed, 0xb7, 0xdc, 0xb1, 0xa9, 0x97, 0xf4, 0x53, 0xb1, - 0xe6, 0xe2, 0xd0, 0x4b, 0xee, 0x9c, 0x78, 0xc5, 0x42, 0xfd, 0x57, 0x2c, 0x54, 0xfb, 0x6b, 0x19, - 0xfe, 0xef, 0xa8, 0x97, 0xe2, 0xc4, 0xbf, 0xe0, 0xe7, 0x44, 0x5c, 0x52, 0x97, 0x20, 0x02, 0x68, - 0x72, 0xfc, 0xd0, 0xf6, 0x75, 0xa3, 0x99, 0x98, 0x6f, 0x98, 0x37, 0x4f, 0xaf, 0xa9, 0xff, 0xfe, - 0xd4, 0xa8, 0xe8, 0xa5, 0x9a, 0x86, 0x30, 0xd4, 0xc6, 0xd5, 0x46, 0x9b, 0x19, 0xc3, 0x94, 0xf9, - 0x32, 0xb6, 0xa6, 0x03, 0xc6, 0x16, 0x28, 0xed, 0x6b, 0xe8, 0x35, 0x2c, 0x8c, 0xdc, 0x57, 0x68, - 0x7d, 0xca, 0x35, 0x96, 0x92, 0xdf, 0xbf, 0xf6, 0x92, 0x1b, 0xda, 0xba, 0x84, 0xb5, 0x29, 0x4f, - 0x10, 0x7a, 0x94, 0x71, 0x5c, 0xff, 0x9c, 0x1a, 0x3b, 0x37, 0xe2, 0x46, 0x56, 0xd5, 0x6a, 0xa5, - 0xc3, 0xfd, 0x37, 0x71, 0x0d, 0xc3, 0x4e, 0xd3, 0xe5, 0xfd, 0x56, 0xfa, 0xb9, 0xc7, 0x45, 0xb7, - 0x95, 0x32, 0xb5, 0x92, 0xa7, 0xbc, 0xd5, 0xe5, 0xea, 0x3f, 0x70, 0x9c, 0x99, 0x24, 0x74, 0xf0, - 0x27, 0x00, 0x00, 0xff, 0xff, 0x95, 0xbb, 0xed, 0x49, 0x11, 0x08, 0x00, 0x00, + // 745 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0xcd, 0x6e, 0xd3, 0x4a, + 0x14, 0x96, 0x93, 0xdc, 0x36, 0x3d, 0xe9, 0xef, 0xdc, 0xf6, 0x36, 0xd7, 0x94, 0xfe, 0x18, 0x41, + 0x23, 0x41, 0x93, 0x2a, 0x45, 0x42, 0x62, 0x05, 0x6d, 0x37, 0x45, 0x15, 0x8d, 0xdc, 0x05, 0x12, + 0x2c, 0xac, 0xb1, 0x3d, 0x4d, 0xa6, 0x4c, 0x3c, 0x66, 0x3c, 0xa9, 0xe4, 0x25, 0x6b, 0x1e, 0x80, + 0x07, 0xe8, 0x03, 0xb1, 0x45, 0xbc, 0x03, 0x12, 0x8f, 0x80, 0x6c, 0xcf, 0xb8, 0xf9, 0x71, 0x5a, + 0xe8, 0xce, 0x3e, 0xe7, 0x3b, 0xdf, 0xcc, 0xf9, 0xbe, 0x33, 0x33, 0xb0, 0x18, 0x0a, 0x4c, 0x2e, + 0x88, 0x27, 0x9b, 0xa1, 0xe0, 0x92, 0xa3, 0x99, 0x2e, 0x95, 0x98, 0xc5, 0x26, 0x30, 0x1a, 0xa8, + 0x98, 0x39, 0x1f, 0xf5, 0xb0, 0x20, 0x7e, 0xf6, 0x67, 0x5d, 0x1b, 0xb0, 0x79, 0x4e, 0xe4, 0xeb, + 0x81, 0xec, 0x71, 0x41, 0x25, 0x96, 0xf4, 0x8a, 0x9c, 0x4b, 0x2e, 0x70, 0x97, 0xd8, 0xe4, 0xd3, + 0x80, 0x44, 0x12, 0xed, 0xc2, 0xd2, 0x15, 0x15, 0x72, 0x80, 0x99, 0x13, 0x65, 0x99, 0xba, 0xb1, + 0x6d, 0x34, 0xe6, 0xec, 0x45, 0x15, 0x56, 0x78, 0xf4, 0x08, 0x16, 0x04, 0x61, 0x29, 0x85, 0x13, + 0x62, 0xd9, 0xab, 0x97, 0x52, 0xd8, 0xbc, 0x0e, 0x76, 0xb0, 0xec, 0xa1, 0x03, 0x58, 0xc3, 0xc3, + 0x8b, 0xe5, 0x9c, 0xe5, 0x14, 0xbc, 0x8a, 0x0b, 0x76, 0x62, 0xed, 0xc0, 0xd6, 0xd4, 0x4d, 0x46, +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 0xd5, 0x9d, 0xe5, + 0xd8, 0xac, 0xb5, 0x9b, 0x9e, 0x73, 0xf8, 0x26, 0xd4, 0x12, 0x97, 0x9d, 0x4b, 0xee, 0x3a, 0xd4, + 0x4f, 0xfb, 0xa9, 0xd8, 0x73, 0x49, 0xe8, 0x0d, 0x77, 0x4f, 0xfc, 0x62, 0xa1, 0xfe, 0x29, 0x16, + 0xaa, 0xfd, 0xa5, 0x0c, 0xff, 0x76, 0xd4, 0xbb, 0x70, 0x12, 0x5c, 0xf0, 0x73, 0x22, 0xae, 0xa8, + 0x47, 0xd0, 0x07, 0x40, 0x93, 0x83, 0x87, 0x76, 0x6e, 0x1b, 0xca, 0xd4, 0x76, 0xd3, 0xba, 0x7b, + 0x6e, 0xd1, 0x3b, 0x58, 0x1e, 0xd7, 0x18, 0x6d, 0xe9, 0xba, 0x29, 0xf3, 0x64, 0x6e, 0x4f, 0x07, + 0x64, 0xb4, 0xfb, 0x06, 0x3a, 0x85, 0x85, 0x91, 0x5b, 0x09, 0x6d, 0x4c, 0xb9, 0xac, 0x32, 0xca, + 0x87, 0xb7, 0x5e, 0x65, 0xe8, 0x12, 0xd6, 0xa7, 0x3c, 0x2c, 0xe8, 0x89, 0xae, 0xbc, 0xfd, 0x79, + 0x34, 0x77, 0xef, 0xc4, 0x65, 0x6b, 0x99, 0x95, 0x5f, 0x5f, 0x1b, 0xc6, 0xe1, 0xfe, 0xfb, 0x04, + 0xcf, 0xb0, 0xdb, 0xf4, 0x78, 0xbf, 0x95, 0x7d, 0xee, 0x71, 0xd1, 0x6d, 0x65, 0x2c, 0xad, 0xf4, + 0x59, 0x6e, 0x75, 0xb9, 0xfa, 0x0f, 0x5d, 0x77, 0x26, 0x0d, 0x1d, 0xfc, 0x0e, 0x00, 0x00, 0xff, + 0xff, 0xaf, 0x1f, 0xf3, 0xad, 0xdd, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/proto/go/gitalypb/server.pb.go b/proto/go/gitalypb/server.pb.go index 1c5f6ec5a7..6765996a62 100644 --- a/proto/go/gitalypb/server.pb.go +++ b/proto/go/gitalypb/server.pb.go @@ -328,36 +328,36 @@ func init() { func init() { proto.RegisterFile("server.proto", fileDescriptor_ad098daeda4239f7) } var fileDescriptor_ad098daeda4239f7 = []byte{ - // 460 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x53, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0x95, 0xeb, 0x10, 0x92, 0x49, 0x52, 0xda, 0x41, 0x50, 0x63, 0x15, 0x08, 0x41, 0x48, 0x3e, - 0x50, 0x07, 0x95, 0x3f, 0x40, 0x08, 0xa9, 0x07, 0x38, 0x38, 0x08, 0x04, 0x17, 0x6b, 0x63, 0x8f, - 0xad, 0x15, 0x8e, 0xd7, 0xec, 0x6c, 0x82, 0xf2, 0x11, 0x9c, 0xf9, 0x16, 0xbe, 0x04, 0xf1, 0x2b, - 0x9c, 0x50, 0xd6, 0x49, 0x9c, 0x42, 0x0a, 0x52, 0x2f, 0xd6, 0xce, 0x7b, 0x6f, 0x66, 0x67, 0xdf, - 0x8c, 0xa1, 0xcf, 0xa4, 0x17, 0xa4, 0xc3, 0x4a, 0x2b, 0xa3, 0xb0, 0x9d, 0x4b, 0x23, 0x8a, 0xa5, - 0x0f, 0x85, 0x2c, 0x4d, 0x8d, 0x8d, 0x6e, 0xc3, 0xf1, 0xc4, 0x6a, 0x2e, 0xca, 0x4c, 0x45, 0xf4, - 0x79, 0x4e, 0x6c, 0x46, 0x5f, 0x5d, 0xc0, 0x5d, 0x94, 0x2b, 0x55, 0x32, 0xe1, 0x13, 0x38, 0xac, - 0xeb, 0xc5, 0x0b, 0xd2, 0x2c, 0x55, 0xe9, 0x39, 0x43, 0x27, 0xe8, 0x46, 0x83, 0x1a, 0x7d, 0x57, - 0x83, 0xf8, 0x10, 0x7a, 0xb9, 0x34, 0x5b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 0xcf, 0xfc, - 0x9f, 0xd1, 0xe9, 0x35, 0x7c, 0x3e, 0x85, 0xae, 0x58, 0x08, 0x59, 0x6c, 0x8d, 0x76, 0xa3, 0x06, - 0x40, 0x84, 0xd6, 0x9c, 0x29, 0xb5, 0x26, 0xbb, 0x91, 0x3d, 0x9f, 0x7f, 0x5f, 0x8d, 0xd3, 0x2e, - 0xc1, 0xea, 0x2b, 0x13, 0xc2, 0xd7, 0x00, 0xcd, 0x56, 0xe0, 0xbd, 0x7d, 0x9b, 0x62, 0x4d, 0xf1, - 0xfd, 0xab, 0x97, 0x68, 0xd4, 0xf9, 0xf5, 0x2d, 0x68, 0x75, 0x0e, 0x8e, 0x1c, 0xfc, 0x00, 0x87, - 0x97, 0xdf, 0x8f, 0xf7, 0xaf, 0xf2, 0xa5, 0x2e, 0xfb, 0xe0, 0xdf, 0xb6, 0x35, 0xa5, 0x5f, 0x3c, - 0xfb, 0xb8, 0x92, 0x16, 0x62, 0x1a, 0x26, 0x6a, 0x36, 0xae, 0x8f, 0x67, 0x4a, 0xe7, 0xe3, 0xba, - 0xc0, 0xd8, 0xfe, 0x79, 0xe3, 0x5c, 0xad, 0xe3, 0x6a, 0x3a, 0x6d, 0x5b, 0xe8, 0xf9, 0xef, 0x00, - 0x00, 0x00, 0xff, 0xff, 0x7c, 0x52, 0xb9, 0x17, 0xb0, 0x03, 0x00, 0x00, + // 454 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x53, 0x5d, 0x6e, 0xd3, 0x40, + 0x10, 0x96, 0x71, 0x08, 0xcd, 0x24, 0x29, 0x74, 0x10, 0xd4, 0x58, 0x05, 0x42, 0x10, 0x92, 0x1f, + 0xa8, 0x83, 0xca, 0x0d, 0x00, 0x21, 0xf5, 0x05, 0x24, 0x07, 0x81, 0xc4, 0x8b, 0xb5, 0xb1, 0xc7, + 0xd6, 0x0a, 0xc7, 0x6b,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+ 0xe2, 0x4c, 0x4d, 0x47, 0xee, 0x78, 0xaa, 0x74, 0x39, 0x72, 0xc9, 0x23, 0xfb, 0xaf, 0x8d, 0x4a, + 0xb5, 0x8a, 0x9b, 0xc9, 0xa4, 0x6d, 0xa1, 0xe7, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x0e, 0x49, + 0xe0, 0x72, 0xa2, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/proto/go/internal/extension.go b/proto/go/internal/extension.go index 10b3cb4a36..1918cd9494 100644 --- a/proto/go/internal/extension.go +++ b/proto/go/internal/extension.go @@ -29,42 +29,3 @@ func GetOpExtension(m *descriptor.MethodDescriptorProto) (*gitalypb.OperationMsg return opMsg, nil } - -// GetStorageExtension gets the storage extension from a field descriptor -func GetStorageExtension(m *descriptor.FieldDescriptorProto) (bool, error) { - return getBoolExtension(m, gitalypb.E_Storage) -} - -// GetTargetRepositoryExtension gets the target_repository extension from a field descriptor -func GetTargetRepositoryExtension(m *descriptor.FieldDescriptorProto) (bool, error) { - return getBoolExtension(m, gitalypb.E_TargetRepository) -} - -// GetRepositoryExtension gets the repository extension from a field descriptor -func GetRepositoryExtension(m *descriptor.FieldDescriptorProto) (bool, error) { - return getBoolExtension(m, gitalypb.E_Repository) -} - -func getBoolExtension(m *descriptor.FieldDescriptorProto, extension *proto.ExtensionDesc) (bool, error) { - options := m.GetOptions() - - if !proto.HasExtension(options, extension) { - return false, nil - } - - ext, err := proto.GetExtension(options, extension) - if err != nil { - return false, err - } - - storageMsg, ok := ext.(*bool) - if !ok { - return false, fmt.Errorf("unable to obtain bool from %#v", ext) - } - - if storageMsg == nil { - return false, nil - } - - return *storageMsg, nil -} diff --git a/proto/go/internal/linter/lint.go b/proto/go/internal/linter/lint.go index fe5266cb8e..ff6bc476ad 100644 --- a/proto/go/internal/linter/lint.go +++ b/proto/go/internal/linter/lint.go @@ -6,6 +6,7 @@ import ( "github.com/golang/protobuf/protoc-gen-go/descriptor" plugin "github.com/golang/protobuf/protoc-gen-go/plugin" + "gitlab.com/gitlab-org/gitaly/internal/praefect/protoregistry" "gitlab.com/gitlab-org/gitaly/proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/proto/go/internal" ) @@ -53,6 +54,13 @@ func LintFile(file *descriptor.FileDescriptorProto, req *plugin.CodeGeneratorReq var errs []error for _, serviceDescriptorProto := range file.GetService() { + if intercepted, err := protoregistry.IsIntercepted(serviceDescriptorProto); err != nil { + errs = append(errs, fmt.Errorf("%s: Service %q: %s", file.GetName(), serviceDescriptorProto.GetName(), err)) + continue + } else if intercepted { + continue + } + for _, methodDescriptorProto := range serviceDescriptorProto.GetMethod() { err := ensureMethodOpType(file, methodDescriptorProto, req) if err != nil { diff --git a/proto/go/internal/linter/method.go b/proto/go/internal/linter/method.go index 0c695e0cf9..8c5ffadccd 100644 --- a/proto/go/internal/linter/method.go +++ b/proto/go/internal/linter/method.go @@ -7,8 +7,8 @@ import ( "github.com/golang/protobuf/protoc-gen-go/descriptor" plugin "github.com/golang/protobuf/protoc-gen-go/plugin" + "gitlab.com/gitlab-org/gitaly/internal/praefect/protoregistry" "gitlab.com/gitlab-org/gitaly/proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/proto/go/internal" ) type methodLinter struct { @@ -88,7 +88,7 @@ func (ml methodLinter) ensureValidStorage(expected int) error { msgT := topLevelMsgs[reqMsgName] m := matcher{ - match: internal.GetStorageExtension, + match: protoregistry.GetStorageExtension, subMatch: nil, expectedType: "", topLevelMsgs: topLevelMsgs, @@ -120,8 +120,8 @@ func (ml methodLinter) ensureValidTargetRepository(expected int) error { msgT := topLevelMsgs[reqMsgName] m := matcher{ - match: internal.GetTargetRepositoryExtension, - subMatch: internal.GetRepositoryExtension, + match: protoregistry.GetTargetRepositoryExtension, + subMatch: protoregistry.GetRepositoryExtension, expectedType: ".gitaly.Repository", topLevelMsgs: topLevelMsgs, } diff --git a/proto/go/internal/linter/testdata/invalid.pb.go b/proto/go/internal/linter/testdata/invalid.pb.go index 397a30b873..e30bec0b9d 100644 --- a/proto/go/internal/linter/testdata/invalid.pb.go +++ b/proto/go/internal/linter/testdata/invalid.pb.go @@ -4,9 +4,13 @@ package test import ( + context "context" fmt "fmt" proto "github.com/golang/protobuf/proto" gitalypb "gitlab.com/gitlab-org/gitaly/proto/go/gitalypb" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" math "math" ) @@ -639,48 +643,663 @@ func init() { } var fileDescriptor_506a53e91b227711 = []byte{ - // 688 bytes of a gzipped FileDescriptorProto + // 693 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0x5d, 0x4f, 0x13, 0x4d, - 0x14, 0xc7, 0x9f, 0x69, 0xfa, 0x34, 0x30, 0xe0, 0xdb, 0x44, 0x05, 0xeb, 0x0b, 0x64, 0xf1, 0x05, - 0x95, 0x6c, 0xa1, 0xa0, 0x22, 0xc1, 0x0b, 0x1a, 0x63, 0x44, 0x42, 0x13, 0x0b, 0x49, 0x13, 0x5f, - 0x52, 0x47, 0xf7, 0x64, 0xbb, 0xc9, 0x76, 0x77, 0xdd, 0x19, 0x30, 0xbd, 0xf3, 0xd2, 0x78, 0xe5, - 0x95, 0xf8, 0x1d, 0xfc, 0x02, 0xc6, 0x0f, 0xe0, 0x87, 0xe2, 0xca, 0xec, 0x4b, 0xcb, 0xee, 0xcc, - 0x2c, 0x8e, 0xc5, 0xbb, 0xcd, 0xf4, 0x9c, 0xff, 0xf9, 0xcd, 0x7f, 0xce, 0xc9, 0x29, 0xbe, 0x6d, - 0xfb, 0x35, 0xc7, 0xe3, 0x10, 0x7a, 0xd4, 0xad, 0xb9, 0xf1, 0x57, 0x8d, 0x03, 0xe3, 0x16, 0xe5, - 0xb4, 0xe6, 0x78, 0xfb, 0xd4, 0x75, 0x2c, 0x33, 0x08, 0x7d, 0xee, 0x93, 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, 0xa4, 0x4a, 0x36, 0x4e, 0x2a, 0x59, 0xa2, 0x2f, 0x25, 0xc9, 0x79, 0x6a, 0x15, 0x4b, 0xf6, + 0x17, 0xc2, 0xd1, 0xd2, 0x43, 0x07, 0xfb, 0xd3, 0xe5, 0x21, 0x72, 0x96, 0x28, 0xbc, 0x0b, 0x27, + 0xe5, 0x25, 0x0a, 0xef, 0x3d, 0x7a, 0xdd, 0xa4, 0xfb, 0xcd, 0xc4, 0x5f, 0x49, 0xe2, 0xf7, 0xe9, + 0x0d, 0xa3, 0xf6, 0x34, 0x53, 0x6f, 0x49, 0xea, 0x0f, 0x68, 0xd1, 0x66, 0x32, 0xd3, 0x93, 0xdd, + 0x5d, 0x94, 0xdc, 0xcd, 0x2d, 0xc7, 0xe3, 0xb9, 0xfb, 0xf0, 0xdf, 0x75, 0x43, 0x89, 0x6e, 0xc1, + 0x99, 0xfc, 0x40, 0xcc, 0xd2, 0x3f, 0x6d, 0x10, 0xb3, 0x1e, 0x7e, 0x2d, 0x0b, 0xcf, 0x15, 0xbe, + 0xdb, 0xdf, 0xcb, 0x13, 0x55, 0xbe, 0x41, 0xa7, 0x0c, 0x76, 0x81, 0xf9, 0x90, 0x48, 0xf2, 0xf3, + 0xc7, 0xec, 0x8b, 0x43, 0xa7, 0xdf, 0xc8, 0x92, 0x0b, 0xf4, 0xa6, 0x42, 0xac, 0xdd, 0xbf, 0x86, + 0x15, 0xde, 0x56, 0xe2, 0x3f, 0x94, 0xf3, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0xb6, 0xa4, 0xe9, + 0x68, 0x9d, 0x0a, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// InvalidServiceClient is the client API for InvalidService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type InvalidServiceClient interface { + // should fail if op_type extension is missing + InvalidMethod0(ctx context.Context, in *InvalidMethodRequest, opts ...grpc.CallOption) (*InvalidMethodResponse, error) + // should fail if op type is unknown + InvalidMethod1(ctx context.Context, in *InvalidMethodRequest, opts ...grpc.CallOption) (*InvalidMethodResponse, error) + // should fail if target repo is not provided for accessor + InvalidMethod2(ctx context.Context, in *InvalidMethodRequest, opts ...grpc.CallOption) (*InvalidMethodResponse, error) + // should fail if target repo is provided for server-scoped mutator + InvalidMethod3(ctx context.Context, in *InvalidMethodRequestWithRepo, opts ...grpc.CallOption) (*InvalidMethodResponse, error) + // should fail if missing either target repo or non-repo-scope for mutator + InvalidMethod4(ctx context.Context, in *InvalidMethodRequest, opts ...grpc.CallOption) (*InvalidMethodResponse, error) + // should fail if repository is not of type Repository + InvalidMethod5(ctx context.Context, in *RequestWithWrongTypeRepository, opts ...grpc.CallOption) (*InvalidMethodResponse, error) + // should fail if nested repository isn't flagged + InvalidMethod6(ctx context.Context, in *RequestWithNestedRepoNotFlagged, opts ...grpc.CallOption) (*InvalidMethodResponse, error) + // should fail if target field type is not of type Repository + InvalidMethod7(ctx context.Context, in *InvalidTargetType, opts ...grpc.CallOption) (*InvalidMethodResponse, error) + // should fail if nested target field type is not of type Repository + InvalidMethod8(ctx context.Context, in *InvalidNestedRequest, opts ...grpc.CallOption) (*InvalidMethodResponse, error) + // should fail if target repo is specified for storage scoped RPC + InvalidMethod9(ctx context.Context, in *InvalidMethodRequestWithRepo, opts ...grpc.CallOption) (*InvalidMethodResponse, error) + // should fail if storage is specified for implicit repository scoped RPC + InvalidMethod10(ctx context.Context, in *RequestWithStorageAndRepo, opts ...grpc.CallOption) (*InvalidMethodResponse, error) + // should fail if storage is specified for repository scoped RPC + InvalidMethod11(ctx context.Context, in *RequestWithNestedStorageAndRepo, opts ...grpc.CallOption) (*InvalidMethodResponse, error) + // should fail if storage is specified for server scoped RPC + InvalidMethod12(ctx context.Context, in *RequestWithInnerNestedStorage, opts ...grpc.CallOption) (*InvalidMethodResponse, error) + // should fail if storage isn't specified for storage scoped RPC + InvalidMethod13(ctx context.Context, in *InvalidTargetType, opts ...grpc.CallOption) (*InvalidMethodResponse, error) + // should fail if multiple storage is specified for storage scoped RPC + InvalidMethod14(ctx context.Context, in *RequestWithMultipleNestedStorage, opts ...grpc.CallOption) (*InvalidMethodResponse, error) +} + +type invalidServiceClient struct { + cc *grpc.ClientConn +} + +func NewInvalidServiceClient(cc *grpc.ClientConn) InvalidServiceClient { + return &invalidServiceClient{cc} +} + +func (c *invalidServiceClient) InvalidMethod0(ctx context.Context, in *InvalidMethodRequest, opts ...grpc.CallOption) (*InvalidMethodResponse, error) { + out := new(InvalidMethodResponse) + err := c.cc.Invoke(ctx, "/test.InvalidService/InvalidMethod0", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *invalidServiceClient) InvalidMethod1(ctx context.Context, in *InvalidMethodRequest, opts ...grpc.CallOption) (*InvalidMethodResponse, error) { + out := new(InvalidMethodResponse) + err := c.cc.Invoke(ctx, "/test.InvalidService/InvalidMethod1", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *invalidServiceClient) InvalidMethod2(ctx context.Context, in *InvalidMethodRequest, opts ...grpc.CallOption) (*InvalidMethodResponse, error) { + out := new(InvalidMethodResponse) + err := c.cc.Invoke(ctx, "/test.InvalidService/InvalidMethod2", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *invalidServiceClient) InvalidMethod3(ctx context.Context, in *InvalidMethodRequestWithRepo, opts ...grpc.CallOption) (*InvalidMethodResponse, error) { + out := new(InvalidMethodResponse) + err := c.cc.Invoke(ctx, "/test.InvalidService/InvalidMethod3", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *invalidServiceClient) InvalidMethod4(ctx context.Context, in *InvalidMethodRequest, opts ...grpc.CallOption) (*InvalidMethodResponse, error) { + out := new(InvalidMethodResponse) + err := c.cc.Invoke(ctx, "/test.InvalidService/InvalidMethod4", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *invalidServiceClient) InvalidMethod5(ctx context.Context, in *RequestWithWrongTypeRepository, opts ...grpc.CallOption) (*InvalidMethodResponse, error) { + out := new(InvalidMethodResponse) + err := c.cc.Invoke(ctx, "/test.InvalidService/InvalidMethod5", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *invalidServiceClient) InvalidMethod6(ctx context.Context, in *RequestWithNestedRepoNotFlagged, opts ...grpc.CallOption) (*InvalidMethodResponse, error) { + out := new(InvalidMethodResponse) + err := c.cc.Invoke(ctx, "/test.InvalidService/InvalidMethod6", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *invalidServiceClient) InvalidMethod7(ctx context.Context, in *InvalidTargetType, opts ...grpc.CallOption) (*InvalidMethodResponse, error) { + out := new(InvalidMethodResponse) + err := c.cc.Invoke(ctx, "/test.InvalidService/InvalidMethod7", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *invalidServiceClient) InvalidMethod8(ctx context.Context, in *InvalidNestedRequest, opts ...grpc.CallOption) (*InvalidMethodResponse, error) { + out := new(InvalidMethodResponse) + err := c.cc.Invoke(ctx, "/test.InvalidService/InvalidMethod8", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *invalidServiceClient) InvalidMethod9(ctx context.Context, in *InvalidMethodRequestWithRepo, opts ...grpc.CallOption) (*InvalidMethodResponse, error) { + out := new(InvalidMethodResponse) + err := c.cc.Invoke(ctx, "/test.InvalidService/InvalidMethod9", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *invalidServiceClient) InvalidMethod10(ctx context.Context, in *RequestWithStorageAndRepo, opts ...grpc.CallOption) (*InvalidMethodResponse, error) { + out := new(InvalidMethodResponse) + err := c.cc.Invoke(ctx, "/test.InvalidService/InvalidMethod10", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *invalidServiceClient) InvalidMethod11(ctx context.Context, in *RequestWithNestedStorageAndRepo, opts ...grpc.CallOption) (*InvalidMethodResponse, error) { + out := new(InvalidMethodResponse) + err := c.cc.Invoke(ctx, "/test.InvalidService/InvalidMethod11", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *invalidServiceClient) InvalidMethod12(ctx context.Context, in *RequestWithInnerNestedStorage, opts ...grpc.CallOption) (*InvalidMethodResponse, error) { + out := new(InvalidMethodResponse) + err := c.cc.Invoke(ctx, "/test.InvalidService/InvalidMethod12", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *invalidServiceClient) InvalidMethod13(ctx context.Context, in *InvalidTargetType, opts ...grpc.CallOption) (*InvalidMethodResponse, error) { + out := new(InvalidMethodResponse) + err := c.cc.Invoke(ctx, "/test.InvalidService/InvalidMethod13", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *invalidServiceClient) InvalidMethod14(ctx context.Context, in *RequestWithMultipleNestedStorage, opts ...grpc.CallOption) (*InvalidMethodResponse, error) { + out := new(InvalidMethodResponse) + err := c.cc.Invoke(ctx, "/test.InvalidService/InvalidMethod14", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// InvalidServiceServer is the server API for InvalidService service. +type InvalidServiceServer interface { + // should fail if op_type extension is missing + InvalidMethod0(context.Context, *InvalidMethodRequest) (*InvalidMethodResponse, error) + // should fail if op type is unknown + InvalidMethod1(context.Context, *InvalidMethodRequest) (*InvalidMethodResponse, error) + // should fail if target repo is not provided for accessor + InvalidMethod2(context.Context, *InvalidMethodRequest) (*InvalidMethodResponse, error) + // should fail if target repo is provided for server-scoped mutator + InvalidMethod3(context.Context, *InvalidMethodRequestWithRepo) (*InvalidMethodResponse, error) + // should fail if missing either target repo or non-repo-scope for mutator + InvalidMethod4(context.Context, *InvalidMethodRequest) (*InvalidMethodResponse, error) + // should fail if repository is not of type Repository + InvalidMethod5(context.Context, *RequestWithWrongTypeRepository) (*InvalidMethodResponse, error) + // should fail if nested repository isn't flagged + InvalidMethod6(context.Context, *RequestWithNestedRepoNotFlagged) (*InvalidMethodResponse, error) + // should fail if target field type is not of type Repository + InvalidMethod7(context.Context, *InvalidTargetType) (*InvalidMethodResponse, error) + // should fail if nested target field type is not of type Repository + InvalidMethod8(context.Context, *InvalidNestedRequest) (*InvalidMethodResponse, error) + // should fail if target repo is specified for storage scoped RPC + InvalidMethod9(context.Context, *InvalidMethodRequestWithRepo) (*InvalidMethodResponse, error) + // should fail if storage is specified for implicit repository scoped RPC + InvalidMethod10(context.Context, *RequestWithStorageAndRepo) (*InvalidMethodResponse, error) + // should fail if storage is specified for repository scoped RPC + InvalidMethod11(context.Context, *RequestWithNestedStorageAndRepo) (*InvalidMethodResponse, error) + // should fail if storage is specified for server scoped RPC + InvalidMethod12(context.Context, *RequestWithInnerNestedStorage) (*InvalidMethodResponse, error) + // should fail if storage isn't specified for storage scoped RPC + InvalidMethod13(context.Context, *InvalidTargetType) (*InvalidMethodResponse, error) + // should fail if multiple storage is specified for storage scoped RPC + InvalidMethod14(context.Context, *RequestWithMultipleNestedStorage) (*InvalidMethodResponse, error) +} + +// UnimplementedInvalidServiceServer can be embedded to have forward compatible implementations. +type UnimplementedInvalidServiceServer struct { +} + +func (*UnimplementedInvalidServiceServer) InvalidMethod0(ctx context.Context, req *InvalidMethodRequest) (*InvalidMethodResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InvalidMethod0 not implemented") +} +func (*UnimplementedInvalidServiceServer) InvalidMethod1(ctx context.Context, req *InvalidMethodRequest) (*InvalidMethodResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InvalidMethod1 not implemented") +} +func (*UnimplementedInvalidServiceServer) InvalidMethod2(ctx context.Context, req *InvalidMethodRequest) (*InvalidMethodResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InvalidMethod2 not implemented") +} +func (*UnimplementedInvalidServiceServer) InvalidMethod3(ctx context.Context, req *InvalidMethodRequestWithRepo) (*InvalidMethodResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InvalidMethod3 not implemented") +} +func (*UnimplementedInvalidServiceServer) InvalidMethod4(ctx context.Context, req *InvalidMethodRequest) (*InvalidMethodResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InvalidMethod4 not implemented") +} +func (*UnimplementedInvalidServiceServer) InvalidMethod5(ctx context.Context, req *RequestWithWrongTypeRepository) (*InvalidMethodResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InvalidMethod5 not implemented") +} +func (*UnimplementedInvalidServiceServer) InvalidMethod6(ctx context.Context, req *RequestWithNestedRepoNotFlagged) (*InvalidMethodResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InvalidMethod6 not implemented") +} +func (*UnimplementedInvalidServiceServer) InvalidMethod7(ctx context.Context, req *InvalidTargetType) (*InvalidMethodResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InvalidMethod7 not implemented") +} +func (*UnimplementedInvalidServiceServer) InvalidMethod8(ctx context.Context, req *InvalidNestedRequest) (*InvalidMethodResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InvalidMethod8 not implemented") +} +func (*UnimplementedInvalidServiceServer) InvalidMethod9(ctx context.Context, req *InvalidMethodRequestWithRepo) (*InvalidMethodResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InvalidMethod9 not implemented") +} +func (*UnimplementedInvalidServiceServer) InvalidMethod10(ctx context.Context, req *RequestWithStorageAndRepo) (*InvalidMethodResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InvalidMethod10 not implemented") +} +func (*UnimplementedInvalidServiceServer) InvalidMethod11(ctx context.Context, req *RequestWithNestedStorageAndRepo) (*InvalidMethodResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InvalidMethod11 not implemented") +} +func (*UnimplementedInvalidServiceServer) InvalidMethod12(ctx context.Context, req *RequestWithInnerNestedStorage) (*InvalidMethodResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InvalidMethod12 not implemented") +} +func (*UnimplementedInvalidServiceServer) InvalidMethod13(ctx context.Context, req *InvalidTargetType) (*InvalidMethodResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InvalidMethod13 not implemented") +} +func (*UnimplementedInvalidServiceServer) InvalidMethod14(ctx context.Context, req *RequestWithMultipleNestedStorage) (*InvalidMethodResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InvalidMethod14 not implemented") +} + +func RegisterInvalidServiceServer(s *grpc.Server, srv InvalidServiceServer) { + s.RegisterService(&_InvalidService_serviceDesc, srv) +} + +func _InvalidService_InvalidMethod0_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InvalidMethodRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InvalidServiceServer).InvalidMethod0(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/test.InvalidService/InvalidMethod0", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InvalidServiceServer).InvalidMethod0(ctx, req.(*InvalidMethodRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _InvalidService_InvalidMethod1_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InvalidMethodRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InvalidServiceServer).InvalidMethod1(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/test.InvalidService/InvalidMethod1", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InvalidServiceServer).InvalidMethod1(ctx, req.(*InvalidMethodRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _InvalidService_InvalidMethod2_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InvalidMethodRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InvalidServiceServer).InvalidMethod2(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/test.InvalidService/InvalidMethod2", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InvalidServiceServer).InvalidMethod2(ctx, req.(*InvalidMethodRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _InvalidService_InvalidMethod3_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InvalidMethodRequestWithRepo) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InvalidServiceServer).InvalidMethod3(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/test.InvalidService/InvalidMethod3", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InvalidServiceServer).InvalidMethod3(ctx, req.(*InvalidMethodRequestWithRepo)) + } + return interceptor(ctx, in, info, handler) +} + +func _InvalidService_InvalidMethod4_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InvalidMethodRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InvalidServiceServer).InvalidMethod4(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/test.InvalidService/InvalidMethod4", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InvalidServiceServer).InvalidMethod4(ctx, req.(*InvalidMethodRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _InvalidService_InvalidMethod5_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RequestWithWrongTypeRepository) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InvalidServiceServer).InvalidMethod5(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/test.InvalidService/InvalidMethod5", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InvalidServiceServer).InvalidMethod5(ctx, req.(*RequestWithWrongTypeRepository)) + } + return interceptor(ctx, in, info, handler) +} + +func _InvalidService_InvalidMethod6_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RequestWithNestedRepoNotFlagged) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InvalidServiceServer).InvalidMethod6(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/test.InvalidService/InvalidMethod6", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InvalidServiceServer).InvalidMethod6(ctx, req.(*RequestWithNestedRepoNotFlagged)) + } + return interceptor(ctx, in, info, handler) +} + +func _InvalidService_InvalidMethod7_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InvalidTargetType) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InvalidServiceServer).InvalidMethod7(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/test.InvalidService/InvalidMethod7", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InvalidServiceServer).InvalidMethod7(ctx, req.(*InvalidTargetType)) + } + return interceptor(ctx, in, info, handler) +} + +func _InvalidService_InvalidMethod8_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InvalidNestedRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InvalidServiceServer).InvalidMethod8(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/test.InvalidService/InvalidMethod8", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InvalidServiceServer).InvalidMethod8(ctx, req.(*InvalidNestedRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _InvalidService_InvalidMethod9_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InvalidMethodRequestWithRepo) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InvalidServiceServer).InvalidMethod9(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/test.InvalidService/InvalidMethod9", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InvalidServiceServer).InvalidMethod9(ctx, req.(*InvalidMethodRequestWithRepo)) + } + return interceptor(ctx, in, info, handler) +} + +func _InvalidService_InvalidMethod10_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RequestWithStorageAndRepo) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InvalidServiceServer).InvalidMethod10(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/test.InvalidService/InvalidMethod10", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InvalidServiceServer).InvalidMethod10(ctx, req.(*RequestWithStorageAndRepo)) + } + return interceptor(ctx, in, info, handler) +} + +func _InvalidService_InvalidMethod11_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RequestWithNestedStorageAndRepo) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InvalidServiceServer).InvalidMethod11(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/test.InvalidService/InvalidMethod11", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InvalidServiceServer).InvalidMethod11(ctx, req.(*RequestWithNestedStorageAndRepo)) + } + return interceptor(ctx, in, info, handler) +} + +func _InvalidService_InvalidMethod12_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RequestWithInnerNestedStorage) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InvalidServiceServer).InvalidMethod12(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/test.InvalidService/InvalidMethod12", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InvalidServiceServer).InvalidMethod12(ctx, req.(*RequestWithInnerNestedStorage)) + } + return interceptor(ctx, in, info, handler) +} + +func _InvalidService_InvalidMethod13_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InvalidTargetType) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InvalidServiceServer).InvalidMethod13(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/test.InvalidService/InvalidMethod13", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InvalidServiceServer).InvalidMethod13(ctx, req.(*InvalidTargetType)) + } + return interceptor(ctx, in, info, handler) +} + +func _InvalidService_InvalidMethod14_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RequestWithMultipleNestedStorage) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InvalidServiceServer).InvalidMethod14(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/test.InvalidService/InvalidMethod14", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InvalidServiceServer).InvalidMethod14(ctx, req.(*RequestWithMultipleNestedStorage)) + } + return interceptor(ctx, in, info, handler) +} + +var _InvalidService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "test.InvalidService", + HandlerType: (*InvalidServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "InvalidMethod0", + Handler: _InvalidService_InvalidMethod0_Handler, + }, + { + MethodName: "InvalidMethod1", + Handler: _InvalidService_InvalidMethod1_Handler, + }, + { + MethodName: "InvalidMethod2", + Handler: _InvalidService_InvalidMethod2_Handler, + }, + { + MethodName: "InvalidMethod3", + Handler: _InvalidService_InvalidMethod3_Handler, + }, + { + MethodName: "InvalidMethod4", + Handler: _InvalidService_InvalidMethod4_Handler, + }, + { + MethodName: "InvalidMethod5", + Handler: _InvalidService_InvalidMethod5_Handler, + }, + { + MethodName: "InvalidMethod6", + Handler: _InvalidService_InvalidMethod6_Handler, + }, + { + MethodName: "InvalidMethod7", + Handler: _InvalidService_InvalidMethod7_Handler, + }, + { + MethodName: "InvalidMethod8", + Handler: _InvalidService_InvalidMethod8_Handler, + }, + { + MethodName: "InvalidMethod9", + Handler: _InvalidService_InvalidMethod9_Handler, + }, + { + MethodName: "InvalidMethod10", + Handler: _InvalidService_InvalidMethod10_Handler, + }, + { + MethodName: "InvalidMethod11", + Handler: _InvalidService_InvalidMethod11_Handler, + }, + { + MethodName: "InvalidMethod12", + Handler: _InvalidService_InvalidMethod12_Handler, + }, + { + MethodName: "InvalidMethod13", + Handler: _InvalidService_InvalidMethod13_Handler, + }, + { + MethodName: "InvalidMethod14", + Handler: _InvalidService_InvalidMethod14_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "go/internal/linter/testdata/invalid.proto", } diff --git a/proto/go/internal/linter/testdata/invalid.proto b/proto/go/internal/linter/testdata/invalid.proto index 4721b70baf..cd446ee749 100644 --- a/proto/go/internal/linter/testdata/invalid.proto +++ b/proto/go/internal/linter/testdata/invalid.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package test; +import "lint.proto"; import "shared.proto"; message InvalidMethodRequest {} diff --git a/proto/go/internal/linter/testdata/valid.pb.go b/proto/go/internal/linter/testdata/valid.pb.go index f9ed52c7f1..2402fa89f4 100644 --- a/proto/go/internal/linter/testdata/valid.pb.go +++ b/proto/go/internal/linter/testdata/valid.pb.go @@ -4,9 +4,13 @@ package test import ( + context "context" fmt "fmt" proto "github.com/golang/protobuf/proto" gitalypb "gitlab.com/gitlab-org/gitaly/proto/go/gitalypb" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" math "math" ) @@ -21,34 +25,6 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package -type UserRevertResponse_CreateTreeError int32 - -const ( - UserRevertResponse_NONE UserRevertResponse_CreateTreeError = 0 - UserRevertResponse_EMPTY UserRevertResponse_CreateTreeError = 1 - UserRevertResponse_CONFLICT UserRevertResponse_CreateTreeError = 2 -) - -var UserRevertResponse_CreateTreeError_name = map[int32]string{ - 0: "NONE", - 1: "EMPTY", - 2: "CONFLICT", -} - -var UserRevertResponse_CreateTreeError_value = map[string]int32{ - "NONE": 0, - "EMPTY": 1, - "CONFLICT": 2, -} - -func (x UserRevertResponse_CreateTreeError) String() string { - return proto.EnumName(UserRevertResponse_CreateTreeError_name, int32(x)) -} - -func (UserRevertResponse_CreateTreeError) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_7058768ff0db2cf7, []int{10, 0} -} - type ValidRequest struct { Destination *gitalypb.Repository `protobuf:"bytes,1,opt,name=destination,proto3" json:"destination,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -462,300 +438,499 @@ func (m *ValidStorageInnerNestedRequest_Header) GetStorageName() string { return "" } -type UserRevertRequest struct { - Repository *gitalypb.Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` - User *gitalypb.User `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"` - Commit *gitalypb.GitCommit `protobuf:"bytes,3,opt,name=commit,proto3" json:"commit,omitempty"` - BranchName []byte `protobuf:"bytes,4,opt,name=branch_name,json=branchName,proto3" json:"branch_name,omitempty"` - Message []byte `protobuf:"bytes,5,opt,name=message,proto3" json:"message,omitempty"` - StartBranchName []byte `protobuf:"bytes,6,opt,name=start_branch_name,json=startBranchName,proto3" json:"start_branch_name,omitempty"` - StartRepository *gitalypb.Repository `protobuf:"bytes,7,opt,name=start_repository,json=startRepository,proto3" json:"start_repository,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func init() { + proto.RegisterType((*ValidRequest)(nil), "test.ValidRequest") + proto.RegisterType((*ValidRequestWithoutRepo)(nil), "test.ValidRequestWithoutRepo") + proto.RegisterType((*ValidStorageRequest)(nil), "test.ValidStorageRequest") + proto.RegisterType((*ValidResponse)(nil), "test.ValidResponse") + proto.RegisterType((*ValidNestedRequest)(nil), "test.ValidNestedRequest") + proto.RegisterType((*ValidStorageNestedRequest)(nil), "test.ValidStorageNestedRequest") + proto.RegisterType((*ValidNestedSharedRequest)(nil), "test.ValidNestedSharedRequest") + proto.RegisterType((*ValidInnerNestedRequest)(nil), "test.ValidInnerNestedRequest") + proto.RegisterType((*ValidInnerNestedRequest_Header)(nil), "test.ValidInnerNestedRequest.Header") + proto.RegisterType((*ValidStorageInnerNestedRequest)(nil), "test.ValidStorageInnerNestedRequest") + proto.RegisterType((*ValidStorageInnerNestedRequest_Header)(nil), "test.ValidStorageInnerNestedRequest.Header") } -func (m *UserRevertRequest) Reset() { *m = UserRevertRequest{} } -func (m *UserRevertRequest) String() string { return proto.CompactTextString(m) } -func (*UserRevertRequest) ProtoMessage() {} -func (*UserRevertRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_7058768ff0db2cf7, []int{9} +func init() { + proto.RegisterFile("go/internal/linter/testdata/valid.proto", fileDescriptor_7058768ff0db2cf7) } -func (m *UserRevertRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UserRevertRequest.Unmarshal(m, b) -} -func (m *UserRevertRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UserRevertRequest.Marshal(b, m, deterministic) -} -func (m *UserRevertRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_UserRevertRequest.Merge(m, src) -} -func (m *UserRevertRequest) XXX_Size() int { - return xxx_messageInfo_UserRevertRequest.Size(m) -} -func (m *UserRevertRequest) XXX_DiscardUnknown() { - xxx_messageInfo_UserRevertRequest.DiscardUnknown(m) +var fileDescriptor_7058768ff0db2cf7 = []byte{ + // 545 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x94, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0x86, 0xe5, 0x28, 0x44, 0x61, 0x92, 0x8a, 0x6a, 0x7b, 0x20, 0x89, 0x44, 0x41, 0x16, 0x52, + 0x23, 0x81, 0x12, 0x91, 0x52, 0x0a, 0x08, 0x72, 0x28, 0x15, 0x90, 0xa2, 0x14, 0x70, 0x2b, 0x38, + 0x70, 0x88, 0x36, 0xf1, 0xc8, 0x31, 0x72, 0xbc, 0x66, 0x77, 0x5a, 0xa9, 0x6f, 0xc0, 0x8d, 0x63, + 0x7a, 0xe1, 0x75, 0x78, 0x1e, 0xce, 0x3d, 0x21, 0xaf, 0x9d, 0xb0, 0x8e, 0x43, 0x68, 0xe1, 0x66, + 0xcd, 0xce, 0xff, 0xed, 0xef, 0xdf, 0x33, 0x86, 0x2d, 0x4f, 0xb4, 0xfd, 0x90, 0x50, 0x86, 0x3c, + 0x68, 0x07, 0xfa, 0xa9, 0x4d, 0xa8, 0xc8, 0xe5, 0xc4, 0xdb, 0xa7, 0x3c, 0xf0, 0xdd, 0x56, 0x24, + 0x05, 0x09, 0x56, 0x8c, 0xab, 0x0d, 0x88, 0x5b, 0x92, 0x4a, 0xa3, 0xaa, 0xc6, 0x5c, 0x62, 0x7a, + 0x6e, 0x1f, 0x40, 0xf5, 0x43, 0xdc, 0xee, 0xe0, 0x97, 0x13, 0x54, 0xc4, 0x9e, 0x42, 0xc5, 0x45, + 0x45, 0x7e, 0xc8, 0xc9, 0x17, 0x61, 0xcd, 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7, + 0x54, 0x60, 0x7d, 0x13, 0xf4, 0x84, 0xdd, 0xce, 0x83, 0x2e, 0xe1, 0x6a, 0x8e, 0x1b, 0x96, 0xf4, + 0xef, 0x7e, 0xfb, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3f, 0x24, 0x44, 0x9b, 0x39, 0x06, 0x00, + 0x00, } -var xxx_messageInfo_UserRevertRequest proto.InternalMessageInfo +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn -func (m *UserRevertRequest) GetRepository() *gitalypb.Repository { - if m != nil { - return m.Repository - } - return nil -} +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 -func (m *UserRevertRequest) GetUser() *gitalypb.User { - if m != nil { - return m.User - } - return nil +// InterceptedServiceClient is the client API for InterceptedService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type InterceptedServiceClient interface { + TestMethod(ctx context.Context, in *ValidRequest, opts ...grpc.CallOption) (*ValidResponse, error) } -func (m *UserRevertRequest) GetCommit() *gitalypb.GitCommit { - if m != nil { - return m.Commit - } - return nil +type interceptedServiceClient struct { + cc *grpc.ClientConn } -func (m *UserRevertRequest) GetBranchName() []byte { - if m != nil { - return m.BranchName - } - return nil +func NewInterceptedServiceClient(cc *grpc.ClientConn) InterceptedServiceClient { + return &interceptedServiceClient{cc} } -func (m *UserRevertRequest) GetMessage() []byte { - if m != nil { - return m.Message +func (c *interceptedServiceClient) TestMethod(ctx context.Context, in *ValidRequest, opts ...grpc.CallOption) (*ValidResponse, error) { + out := new(ValidResponse) + err := c.cc.Invoke(ctx, "/test.InterceptedService/TestMethod", in, out, opts...) + if err != nil { + return nil, err } - return nil + return out, nil } -func (m *UserRevertRequest) GetStartBranchName() []byte { - if m != nil { - return m.StartBranchName - } - return nil +// InterceptedServiceServer is the server API for InterceptedService service. +type InterceptedServiceServer interface { + TestMethod(context.Context, *ValidRequest) (*ValidResponse, error) } -func (m *UserRevertRequest) GetStartRepository() *gitalypb.Repository { - if m != nil { - return m.StartRepository - } - return nil +// UnimplementedInterceptedServiceServer can be embedded to have forward compatible implementations. +type UnimplementedInterceptedServiceServer struct { } -type UserRevertResponse struct { - BranchUpdate *OperationBranchUpdate `protobuf:"bytes,1,opt,name=branch_update,json=branchUpdate,proto3" json:"branch_update,omitempty"` - CreateTreeError string `protobuf:"bytes,2,opt,name=create_tree_error,json=createTreeError,proto3" json:"create_tree_error,omitempty"` - CommitError string `protobuf:"bytes,3,opt,name=commit_error,json=commitError,proto3" json:"commit_error,omitempty"` - PreReceiveError string `protobuf:"bytes,4,opt,name=pre_receive_error,json=preReceiveError,proto3" json:"pre_receive_error,omitempty"` - CreateTreeErrorCode UserRevertResponse_CreateTreeError `protobuf:"varint,5,opt,name=create_tree_error_code,json=createTreeErrorCode,proto3,enum=test.UserRevertResponse_CreateTreeError" json:"create_tree_error_code,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (*UnimplementedInterceptedServiceServer) TestMethod(ctx context.Context, req *ValidRequest) (*ValidResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TestMethod not implemented") } -func (m *UserRevertResponse) Reset() { *m = UserRevertResponse{} } -func (m *UserRevertResponse) String() string { return proto.CompactTextString(m) } -func (*UserRevertResponse) ProtoMessage() {} -func (*UserRevertResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_7058768ff0db2cf7, []int{10} +func RegisterInterceptedServiceServer(s *grpc.Server, srv InterceptedServiceServer) { + s.RegisterService(&_InterceptedService_serviceDesc, srv) } -func (m *UserRevertResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UserRevertResponse.Unmarshal(m, b) -} -func (m *UserRevertResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UserRevertResponse.Marshal(b, m, deterministic) -} -func (m *UserRevertResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_UserRevertResponse.Merge(m, src) +func _InterceptedService_TestMethod_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ValidRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InterceptedServiceServer).TestMethod(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/test.InterceptedService/TestMethod", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InterceptedServiceServer).TestMethod(ctx, req.(*ValidRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _InterceptedService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "test.InterceptedService", + HandlerType: (*InterceptedServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "TestMethod", + Handler: _InterceptedService_TestMethod_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "go/internal/linter/testdata/valid.proto", +} + +// ValidServiceClient is the client API for ValidService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type ValidServiceClient interface { + TestMethod(ctx context.Context, in *ValidRequest, opts ...grpc.CallOption) (*ValidResponse, error) + TestMethod2(ctx context.Context, in *ValidRequest, opts ...grpc.CallOption) (*ValidResponse, error) + TestMethod3(ctx context.Context, in *ValidRequest, opts ...grpc.CallOption) (*ValidResponse, error) + TestMethod4(ctx context.Context, in *ValidRequestWithoutRepo, opts ...grpc.CallOption) (*ValidResponse, error) + TestMethod5(ctx context.Context, in *ValidNestedRequest, opts ...grpc.CallOption) (*ValidResponse, error) + TestMethod6(ctx context.Context, in *ValidNestedSharedRequest, opts ...grpc.CallOption) (*ValidResponse, error) + TestMethod7(ctx context.Context, in *ValidInnerNestedRequest, opts ...grpc.CallOption) (*ValidResponse, error) + TestMethod8(ctx context.Context, in *ValidStorageRequest, opts ...grpc.CallOption) (*ValidResponse, error) + TestMethod9(ctx context.Context, in *ValidStorageNestedRequest, opts ...grpc.CallOption) (*ValidResponse, error) +} + +type validServiceClient struct { + cc *grpc.ClientConn +} + +func NewValidServiceClient(cc *grpc.ClientConn) ValidServiceClient { + return &validServiceClient{cc} +} + +func (c *validServiceClient) TestMethod(ctx context.Context, in *ValidRequest, opts ...grpc.CallOption) (*ValidResponse, error) { + out := new(ValidResponse) + err := c.cc.Invoke(ctx, "/test.ValidService/TestMethod", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil } -func (m *UserRevertResponse) XXX_Size() int { - return xxx_messageInfo_UserRevertResponse.Size(m) + +func (c *validServiceClient) TestMethod2(ctx context.Context, in *ValidRequest, opts ...grpc.CallOption) (*ValidResponse, error) { + out := new(ValidResponse) + err := c.cc.Invoke(ctx, "/test.ValidService/TestMethod2", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil } -func (m *UserRevertResponse) XXX_DiscardUnknown() { - xxx_messageInfo_UserRevertResponse.DiscardUnknown(m) + +func (c *validServiceClient) TestMethod3(ctx context.Context, in *ValidRequest, opts ...grpc.CallOption) (*ValidResponse, error) { + out := new(ValidResponse) + err := c.cc.Invoke(ctx, "/test.ValidService/TestMethod3", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil } -var xxx_messageInfo_UserRevertResponse proto.InternalMessageInfo +func (c *validServiceClient) TestMethod4(ctx context.Context, in *ValidRequestWithoutRepo, opts ...grpc.CallOption) (*ValidResponse, error) { + out := new(ValidResponse) + err := c.cc.Invoke(ctx, "/test.ValidService/TestMethod4", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} -func (m *UserRevertResponse) GetBranchUpdate() *OperationBranchUpdate { - if m != nil { - return m.BranchUpdate +func (c *validServiceClient) TestMethod5(ctx context.Context, in *ValidNestedRequest, opts ...grpc.CallOption) (*ValidResponse, error) { + out := new(ValidResponse) + err := c.cc.Invoke(ctx, "/test.ValidService/TestMethod5", in, out, opts...) + if err != nil { + return nil, err } - return nil + return out, nil } -func (m *UserRevertResponse) GetCreateTreeError() string { - if m != nil { - return m.CreateTreeError +func (c *validServiceClient) TestMethod6(ctx context.Context, in *ValidNestedSharedRequest, opts ...grpc.CallOption) (*ValidResponse, error) { + out := new(ValidResponse) + err := c.cc.Invoke(ctx, "/test.ValidService/TestMethod6", in, out, opts...) + if err != nil { + return nil, err } - return "" + return out, nil } -func (m *UserRevertResponse) GetCommitError() string { - if m != nil { - return m.CommitError +func (c *validServiceClient) TestMethod7(ctx context.Context, in *ValidInnerNestedRequest, opts ...grpc.CallOption) (*ValidResponse, error) { + out := new(ValidResponse) + err := c.cc.Invoke(ctx, "/test.ValidService/TestMethod7", in, out, opts...) + if err != nil { + return nil, err } - return "" + return out, nil } -func (m *UserRevertResponse) GetPreReceiveError() string { - if m != nil { - return m.PreReceiveError +func (c *validServiceClient) TestMethod8(ctx context.Context, in *ValidStorageRequest, opts ...grpc.CallOption) (*ValidResponse, error) { + out := new(ValidResponse) + err := c.cc.Invoke(ctx, "/test.ValidService/TestMethod8", in, out, opts...) + if err != nil { + return nil, err } - return "" + return out, nil } -func (m *UserRevertResponse) GetCreateTreeErrorCode() UserRevertResponse_CreateTreeError { - if m != nil { - return m.CreateTreeErrorCode +func (c *validServiceClient) TestMethod9(ctx context.Context, in *ValidStorageNestedRequest, opts ...grpc.CallOption) (*ValidResponse, error) { + out := new(ValidResponse) + err := c.cc.Invoke(ctx, "/test.ValidService/TestMethod9", in, out, opts...) + if err != nil { + return nil, err } - return UserRevertResponse_NONE + return out, nil } -type OperationBranchUpdate struct { - // If this string is non-empty the branch has been updated. - CommitId string `protobuf:"bytes,1,opt,name=commit_id,json=commitId,proto3" json:"commit_id,omitempty"` - // Used for cache invalidation in GitLab - RepoCreated bool `protobuf:"varint,2,opt,name=repo_created,json=repoCreated,proto3" json:"repo_created,omitempty"` - // Used for cache invalidation in GitLab - BranchCreated bool `protobuf:"varint,3,opt,name=branch_created,json=branchCreated,proto3" json:"branch_created,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +// ValidServiceServer is the server API for ValidService service. +type ValidServiceServer interface { + TestMethod(context.Context, *ValidRequest) (*ValidResponse, error) + TestMethod2(context.Context, *ValidRequest) (*ValidResponse, error) + TestMethod3(context.Context, *ValidRequest) (*ValidResponse, error) + TestMethod4(context.Context, *ValidRequestWithoutRepo) (*ValidResponse, error) + TestMethod5(context.Context, *ValidNestedRequest) (*ValidResponse, error) + TestMethod6(context.Context, *ValidNestedSharedRequest) (*ValidResponse, error) + TestMethod7(context.Context, *ValidInnerNestedRequest) (*ValidResponse, error) + TestMethod8(context.Context, *ValidStorageRequest) (*ValidResponse, error) + TestMethod9(context.Context, *ValidStorageNestedRequest) (*ValidResponse, error) } -func (m *OperationBranchUpdate) Reset() { *m = OperationBranchUpdate{} } -func (m *OperationBranchUpdate) String() string { return proto.CompactTextString(m) } -func (*OperationBranchUpdate) ProtoMessage() {} -func (*OperationBranchUpdate) Descriptor() ([]byte, []int) { - return fileDescriptor_7058768ff0db2cf7, []int{11} +// UnimplementedValidServiceServer can be embedded to have forward compatible implementations. +type UnimplementedValidServiceServer struct { } -func (m *OperationBranchUpdate) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_OperationBranchUpdate.Unmarshal(m, b) +func (*UnimplementedValidServiceServer) TestMethod(ctx context.Context, req *ValidRequest) (*ValidResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TestMethod not implemented") } -func (m *OperationBranchUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_OperationBranchUpdate.Marshal(b, m, deterministic) +func (*UnimplementedValidServiceServer) TestMethod2(ctx context.Context, req *ValidRequest) (*ValidResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TestMethod2 not implemented") } -func (m *OperationBranchUpdate) XXX_Merge(src proto.Message) { - xxx_messageInfo_OperationBranchUpdate.Merge(m, src) +func (*UnimplementedValidServiceServer) TestMethod3(ctx context.Context, req *ValidRequest) (*ValidResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TestMethod3 not implemented") } -func (m *OperationBranchUpdate) XXX_Size() int { - return xxx_messageInfo_OperationBranchUpdate.Size(m) +func (*UnimplementedValidServiceServer) TestMethod4(ctx context.Context, req *ValidRequestWithoutRepo) (*ValidResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TestMethod4 not implemented") } -func (m *OperationBranchUpdate) XXX_DiscardUnknown() { - xxx_messageInfo_OperationBranchUpdate.DiscardUnknown(m) +func (*UnimplementedValidServiceServer) TestMethod5(ctx context.Context, req *ValidNestedRequest) (*ValidResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TestMethod5 not implemented") +} +func (*UnimplementedValidServiceServer) TestMethod6(ctx context.Context, req *ValidNestedSharedRequest) (*ValidResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TestMethod6 not implemented") +} +func (*UnimplementedValidServiceServer) TestMethod7(ctx context.Context, req *ValidInnerNestedRequest) (*ValidResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TestMethod7 not implemented") +} +func (*UnimplementedValidServiceServer) TestMethod8(ctx context.Context, req *ValidStorageRequest) (*ValidResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TestMethod8 not implemented") +} +func (*UnimplementedValidServiceServer) TestMethod9(ctx context.Context, req *ValidStorageNestedRequest) (*ValidResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TestMethod9 not implemented") } -var xxx_messageInfo_OperationBranchUpdate proto.InternalMessageInfo +func RegisterValidServiceServer(s *grpc.Server, srv ValidServiceServer) { + s.RegisterService(&_ValidService_serviceDesc, srv) +} -func (m *OperationBranchUpdate) GetCommitId() string { - if m != nil { - return m.CommitId +func _ValidService_TestMethod_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ValidRequest) + if err := dec(in); err != nil { + return nil, err } - return "" + if interceptor == nil { + return srv.(ValidServiceServer).TestMethod(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/test.ValidService/TestMethod", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ValidServiceServer).TestMethod(ctx, req.(*ValidRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *OperationBranchUpdate) GetRepoCreated() bool { - if m != nil { - return m.RepoCreated +func _ValidService_TestMethod2_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ValidRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ValidServiceServer).TestMethod2(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/test.ValidService/TestMethod2", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ValidServiceServer).TestMethod2(ctx, req.(*ValidRequest)) } - return false + return interceptor(ctx, in, info, handler) } -func (m *OperationBranchUpdate) GetBranchCreated() bool { - if m != nil { - return m.BranchCreated +func _ValidService_TestMethod3_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ValidRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ValidServiceServer).TestMethod3(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/test.ValidService/TestMethod3", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ValidServiceServer).TestMethod3(ctx, req.(*ValidRequest)) } - return false + return interceptor(ctx, in, info, handler) } -func init() { - proto.RegisterEnum("test.UserRevertResponse_CreateTreeError", UserRevertResponse_CreateTreeError_name, UserRevertResponse_CreateTreeError_value) - proto.RegisterType((*ValidRequest)(nil), "test.ValidRequest") - proto.RegisterType((*ValidRequestWithoutRepo)(nil), "test.ValidRequestWithoutRepo") - proto.RegisterType((*ValidStorageRequest)(nil), "test.ValidStorageRequest") - proto.RegisterType((*ValidResponse)(nil), "test.ValidResponse") - proto.RegisterType((*ValidNestedRequest)(nil), "test.ValidNestedRequest") - proto.RegisterType((*ValidStorageNestedRequest)(nil), "test.ValidStorageNestedRequest") - proto.RegisterType((*ValidNestedSharedRequest)(nil), "test.ValidNestedSharedRequest") - proto.RegisterType((*ValidInnerNestedRequest)(nil), "test.ValidInnerNestedRequest") - proto.RegisterType((*ValidInnerNestedRequest_Header)(nil), "test.ValidInnerNestedRequest.Header") - proto.RegisterType((*ValidStorageInnerNestedRequest)(nil), "test.ValidStorageInnerNestedRequest") - proto.RegisterType((*ValidStorageInnerNestedRequest_Header)(nil), "test.ValidStorageInnerNestedRequest.Header") - proto.RegisterType((*UserRevertRequest)(nil), "test.UserRevertRequest") - proto.RegisterType((*UserRevertResponse)(nil), "test.UserRevertResponse") - proto.RegisterType((*OperationBranchUpdate)(nil), "test.OperationBranchUpdate") +func _ValidService_TestMethod4_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ValidRequestWithoutRepo) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ValidServiceServer).TestMethod4(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/test.ValidService/TestMethod4", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ValidServiceServer).TestMethod4(ctx, req.(*ValidRequestWithoutRepo)) + } + return interceptor(ctx, in, info, handler) } -func init() { - proto.RegisterFile("go/internal/linter/testdata/valid.proto", fileDescriptor_7058768ff0db2cf7) +func _ValidService_TestMethod5_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ValidNestedRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ValidServiceServer).TestMethod5(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/test.ValidService/TestMethod5", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ValidServiceServer).TestMethod5(ctx, req.(*ValidNestedRequest)) + } + return interceptor(ctx, in, info, handler) } -var fileDescriptor_7058768ff0db2cf7 = []byte{ - // 887 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xdd, 0x6e, 0x1b, 0x45, - 0x18, 0x65, 0x9d, 0xad, 0xeb, 0x7c, 0xde, 0x34, 0xce, 0x44, 0x50, 0x27, 0x15, 0x6d, 0x58, 0x15, - 0xd5, 0x14, 0xe4, 0xd0, 0xb4, 0xd0, 0x82, 0x20, 0x42, 0x71, 0xd3, 0x90, 0x82, 0x9d, 0x6a, 0xe3, - 0x82, 0x10, 0x42, 0xab, 0xb1, 0xf7, 0x93, 0xbd, 0xc8, 0xde, 0x59, 0x66, 0x27, 0x96, 0x7a, 0xc3, - 0x35, 0x6f, 0xd0, 0xde, 0xf0, 0x08, 0xbc, 0x03, 0x57, 0x3c, 0x0a, 0x0f, 0xd1, 0x2b, 0xb4, 0x33, - 0xb3, 0xf6, 0xac, 0xd7, 0x71, 0x12, 0x71, 0xe7, 0x3d, 0x73, 0xbe, 0x33, 0xe7, 0x3b, 0xf3, 0x67, - 0xb8, 0x37, 0x60, 0xbb, 0x61, 0x24, 0x90, 0x47, 0x74, 0xb4, 0x3b, 0x92, 0xbf, 0x76, 0x05, 0x26, - 0x22, 0xa0, 0x82, 0xee, 0x4e, 0xe8, 0x28, 0x0c, 0x9a, 0x31, 0x67, 0x82, 0x11, 0x3b, 0x45, 0xb7, - 0x9d, 0x64, 0x48, 0x39, 0x6a, 0xcc, 0x7d, 0x0e, 0xce, 0x0f, 0x29, 0xc5, 0xc3, 0xdf, 0xce, 0x30, - 0x11, 0xe4, 0x4b, 0xa8, 0x06, 0x98, 0x88, 0x30, 0xa2, 0x22, 0x64, 0x51, 0xdd, 0xda, 0xb1, 0x1a, - 0xd5, 0x3d, 0xd2, 0x1c, 0x84, 0x82, 0x8e, 0x5e, 0x35, 0x3d, 0x8c, 0x59, 0x12, 0x0a, 0xc6, 0x5f, - 0x1d, 0xd8, 0x6f, 0xfe, 0xf9, 0xc4, 0xf2, 0x4c, 0xb2, 0xbb, 0x05, 0x37, 0x4d, 0xad, 0x1f, 0x43, - 0x31, 0x64, 0x67, 0x22, 0xad, 0x71, 0xf7, 0x61, 0x53, 0x0e, 0x9d, 0x0a, 0xc6, 0xe9, 0x00, 0xb3, - 0xd9, 0xee, 0x81, 0x93, 0x28, 0xc4, 0x8f, 0xe8, 0x18, 0xe5, 0x74, 0xab, 0x07, 0xf6, 0x1f, 0x52, - 0x5a, 0x8f, 0x74, 0xe8, 0x18, 0xdd, 0x75, 0x58, 0xd3, 0xd2, 0x49, 0xcc, 0xa2, 0x04, 0xdd, 0x36, - 0x10, 0x09, 0x74, 0x30, 0x11, 0x38, 0x75, 0xff, 0x18, 0xd6, 0xc2, 0x28, 0x42, 0xee, 0x8f, 0x31, - 0x49, 0xe8, 0x00, 0xa7, 0xfe, 0xd3, 0xce, 0x9b, 0xa6, 0x39, 0xcf, 0x91, 0xc4, 0xb6, 0xe2, 0xb9, - 0x3f, 0xc3, 0x96, 0xe9, 0x2f, 0xaf, 0xba, 0xbf, 0x58, 0x75, 0xcb, 0x50, 0xcd, 0xf7, 0x35, 0x27, - 0xde, 0x83, 0xba, 0xe1, 0xf5, 0x54, 0xc6, 0x9f, 0x69, 0x3f, 0x03, 0x12, 0x49, 0xd8, 0x17, 0x94, - 0x0f, 0x50, 0xf8, 0x1c, 0x63, 0x36, 0x1f, 0xfb, 0x49, 0xef, 0x57, 0xec, 0x8b, 0x17, 0x8c, 0x8d, - 0x74, 0xec, 0x35, 0x55, 0xd3, 0x95, 0x25, 0x32, 0xe0, 0x3f, 0x2d, 0x1d, 0xfe, 0x71, 0x3a, 0x73, - 0xde, 0xff, 0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0xa4, 0x09, 0x00, 0x00, +func _ValidService_TestMethod6_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ValidNestedSharedRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ValidServiceServer).TestMethod6(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/test.ValidService/TestMethod6", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ValidServiceServer).TestMethod6(ctx, req.(*ValidNestedSharedRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ValidService_TestMethod7_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ValidInnerNestedRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ValidServiceServer).TestMethod7(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/test.ValidService/TestMethod7", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ValidServiceServer).TestMethod7(ctx, req.(*ValidInnerNestedRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ValidService_TestMethod8_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ValidStorageRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ValidServiceServer).TestMethod8(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/test.ValidService/TestMethod8", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ValidServiceServer).TestMethod8(ctx, req.(*ValidStorageRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ValidService_TestMethod9_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ValidStorageNestedRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ValidServiceServer).TestMethod9(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/test.ValidService/TestMethod9", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ValidServiceServer).TestMethod9(ctx, req.(*ValidStorageNestedRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ValidService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "test.ValidService", + HandlerType: (*ValidServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "TestMethod", + Handler: _ValidService_TestMethod_Handler, + }, + { + MethodName: "TestMethod2", + Handler: _ValidService_TestMethod2_Handler, + }, + { + MethodName: "TestMethod3", + Handler: _ValidService_TestMethod3_Handler, + }, + { + MethodName: "TestMethod4", + Handler: _ValidService_TestMethod4_Handler, + }, + { + MethodName: "TestMethod5", + Handler: _ValidService_TestMethod5_Handler, + }, + { + MethodName: "TestMethod6", + Handler: _ValidService_TestMethod6_Handler, + }, + { + MethodName: "TestMethod7", + Handler: _ValidService_TestMethod7_Handler, + }, + { + MethodName: "TestMethod8", + Handler: _ValidService_TestMethod8_Handler, + }, + { + MethodName: "TestMethod9", + Handler: _ValidService_TestMethod9_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "go/internal/linter/testdata/valid.proto", } diff --git a/proto/go/internal/linter/testdata/valid.proto b/proto/go/internal/linter/testdata/valid.proto index 7dcad082f4..0f209aca6a 100644 --- a/proto/go/internal/linter/testdata/valid.proto +++ b/proto/go/internal/linter/testdata/valid.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package test; +import "lint.proto"; import "shared.proto"; message ValidRequest { @@ -45,6 +46,13 @@ message ValidStorageInnerNestedRequest { Header header = 1; } +service InterceptedService { + // intercepted services do not need method operation and scope + // annotations. + option (gitaly.intercepted) = true; + rpc TestMethod(ValidRequest) returns (ValidResponse); +} + service ValidService { rpc TestMethod(ValidRequest) returns (ValidResponse) { option (gitaly.op_type) = { diff --git a/proto/lint.proto b/proto/lint.proto index 09acbae585..94395a94c1 100644 --- a/proto/lint.proto +++ b/proto/lint.proto @@ -28,6 +28,13 @@ message OperationMsg { Scope scope_level = 2; } +extend google.protobuf.ServiceOptions { + // intercepted indicates whether the proxy intercepts and handles the call + // instead of proxying. Intercepted services do not require scope or operation + // annotations. + bool intercepted = 82302; +} + extend google.protobuf.MethodOptions { // Random high number.. OperationMsg op_type = 82303; diff --git a/proto/praefect.proto b/proto/praefect.proto index 18db7f6f9e..92994a58d1 100644 --- a/proto/praefect.proto +++ b/proto/praefect.proto @@ -8,44 +8,26 @@ import "lint.proto"; import "shared.proto"; service PraefectInfoService { - rpc RepositoryReplicas(RepositoryReplicasRequest) returns (RepositoryReplicasResponse) { - option (op_type) = { - op: ACCESSOR - scope_level: SERVER - }; - } + option (intercepted) = true; + + rpc RepositoryReplicas(RepositoryReplicasRequest) returns (RepositoryReplicasResponse); // ConsistencyCheck will perform a consistency check on the requested // virtual storage backend. A stream of repository statuses will be sent // back indicating which repos are consistent with the primary and which ones // need repair. - rpc ConsistencyCheck(ConsistencyCheckRequest) returns (stream ConsistencyCheckResponse) { - option (op_type) = { - op: ACCESSOR - scope_level: STORAGE - }; - } + rpc ConsistencyCheck(ConsistencyCheckRequest) returns (stream ConsistencyCheckResponse); // DatalossCheck checks for outdated repository replicas. - rpc DatalossCheck(DatalossCheckRequest) returns (DatalossCheckResponse) { - option (op_type) = { - op: ACCESSOR - scope_level: SERVER - }; - } + rpc DatalossCheck(DatalossCheckRequest) returns (DatalossCheckResponse); // SetAuthoritativeStorage sets the authoritative storage for a repository on a given virtual storage. // This causes the current version of the repository on the authoritative storage to be considered the // latest and overwrite any other version on the virtual storage. - rpc SetAuthoritativeStorage(SetAuthoritativeStorageRequest) returns (SetAuthoritativeStorageResponse) { - option (op_type) = { - op: MUTATOR - scope_level: STORAGE - }; - } + rpc SetAuthoritativeStorage(SetAuthoritativeStorageRequest) returns (SetAuthoritativeStorageResponse); } message SetAuthoritativeStorageRequest { - string virtual_storage = 1 [(storage)=true]; + string virtual_storage = 1; string relative_path = 2; string authoritative_storage = 3; } @@ -53,7 +35,7 @@ message SetAuthoritativeStorageRequest { message SetAuthoritativeStorageResponse {} message DatalossCheckRequest { - string virtual_storage = 1 [(storage)=true]; + string virtual_storage = 1; // include_partially_replicated decides whether to include repositories which are fully up to date // on the primary but are outdated on some secondaries. Such repositories are still writable and do // not suffer from data loss. The data on the primary is not fully replicated which increases the @@ -100,7 +82,7 @@ message RepositoryReplicasResponse{ } message ConsistencyCheckRequest { - string virtual_storage = 1 [(storage)=true]; + string virtual_storage = 1; // The target storage is the storage you wish to check for inconsistencies // against a reference storage (typically the current primary). string target_storage = 2; diff --git a/proto/server.proto b/proto/server.proto index 29fbc55ffe..5c93563cb6 100644 --- a/proto/server.proto +++ b/proto/server.proto @@ -7,18 +7,10 @@ option go_package = "gitlab.com/gitlab-org/gitaly/proto/go/gitalypb"; import "lint.proto"; service ServerService { - rpc ServerInfo(ServerInfoRequest) returns (ServerInfoResponse) { - option (op_type) = { - op: ACCESSOR - scope_level: SERVER - }; - } - rpc DiskStatistics(DiskStatisticsRequest) returns (DiskStatisticsResponse) { - option (op_type) = { - op: ACCESSOR - scope_level: SERVER - }; - } + option (intercepted) = true; + + rpc ServerInfo(ServerInfoRequest) returns (ServerInfoResponse); + rpc DiskStatistics(DiskStatisticsRequest) returns (DiskStatisticsResponse); } message ServerInfoRequest {} -- GitLab From 64868a537bcdc870eeabb3f3288ee8657d009980 Mon Sep 17 00:00:00 2001 From: Sami Hiltunen Date: Tue, 15 Sep 2020 17:02:56 +0200 Subject: [PATCH 4/5] remove server scope from protos and linter Removes server scope from protos and linter as no proxied service uses them anymore. --- .../praefect/protoregistry/protoregistry.go | 5 - .../protoregistry/protoregistry_test.go | 4 - proto/go/gitalypb/lint.pb.go | 60 +++---- proto/go/internal/linter/lint_test.go | 2 - proto/go/internal/linter/method.go | 18 +- .../go/internal/linter/testdata/invalid.pb.go | 165 +++++------------- .../go/internal/linter/testdata/invalid.proto | 15 -- proto/go/internal/linter/testdata/valid.pb.go | 107 ++++-------- proto/go/internal/linter/testdata/valid.proto | 7 - proto/lint.proto | 5 +- ruby/proto/gitaly/lint_pb.rb | 1 - 11 files changed, 112 insertions(+), 277 deletions(-) diff --git a/internal/praefect/protoregistry/protoregistry.go b/internal/praefect/protoregistry/protoregistry.go index 0ded5fad84..646cf2f311 100644 --- a/internal/praefect/protoregistry/protoregistry.go +++ b/internal/praefect/protoregistry/protoregistry.go @@ -63,14 +63,10 @@ const ( ScopeRepository Scope = iota // ScopeStorage indicates an RPC is scoped to an entire storage location ScopeStorage - // ScopeServer indicates an RPC is scoped to an entire server - ScopeServer ) func (s Scope) String() string { switch s { - case ScopeServer: - return "server" case ScopeStorage: return "storage" case ScopeRepository: @@ -81,7 +77,6 @@ func (s Scope) String() string { } var protoScope = map[gitalypb.OperationMsg_Scope]Scope{ - gitalypb.OperationMsg_SERVER: ScopeServer, gitalypb.OperationMsg_REPOSITORY: ScopeRepository, gitalypb.OperationMsg_STORAGE: ScopeStorage, } diff --git a/internal/praefect/protoregistry/protoregistry_test.go b/internal/praefect/protoregistry/protoregistry_test.go index 030c971c16..b9e8e8174c 100644 --- a/internal/praefect/protoregistry/protoregistry_test.go +++ b/internal/praefect/protoregistry/protoregistry_test.go @@ -205,10 +205,6 @@ func TestMethodInfoScope(t *testing.T) { method: "/gitaly.RepositoryService/RepositoryExists", scope: protoregistry.ScopeRepository, }, - { - method: "/gitaly.ServerService/ServerInfo", - scope: protoregistry.ScopeServer, - }, } { t.Run(tt.method, func(t *testing.T) { mInfo, err := protoregistry.GitalyProtoPreregistered.LookupMethod(tt.method) diff --git a/proto/go/gitalypb/lint.pb.go b/proto/go/gitalypb/lint.pb.go index 8b843cf22e..e5329fad7f 100644 --- a/proto/go/gitalypb/lint.pb.go +++ b/proto/go/gitalypb/lint.pb.go @@ -53,19 +53,16 @@ type OperationMsg_Scope int32 const ( OperationMsg_REPOSITORY OperationMsg_Scope = 0 - OperationMsg_SERVER OperationMsg_Scope = 1 OperationMsg_STORAGE OperationMsg_Scope = 2 ) var OperationMsg_Scope_name = map[int32]string{ 0: "REPOSITORY", - 1: "SERVER", 2: "STORAGE", } var OperationMsg_Scope_value = map[string]int32{ "REPOSITORY": 0, - "SERVER": 1, "STORAGE": 2, } @@ -81,7 +78,6 @@ type OperationMsg struct { Op OperationMsg_Operation `protobuf:"varint,1,opt,name=op,proto3,enum=gitaly.OperationMsg_Operation" json:"op,omitempty"` // Scope level indicates what level an RPC interacts with a server: // - REPOSITORY: scoped to only a single repo - // - SERVER: affects the entire server and potentially all repos // - STORAGE: scoped to a specific storage location and all repos within ScopeLevel OperationMsg_Scope `protobuf:"varint,2,opt,name=scope_level,json=scopeLevel,proto3,enum=gitaly.OperationMsg_Scope" json:"scope_level,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -197,32 +193,32 @@ func init() { func init() { proto.RegisterFile("lint.proto", fileDescriptor_1612d42a10b555ca) } var fileDescriptor_1612d42a10b555ca = []byte{ - // 425 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0x41, 0x6b, 0xd4, 0x40, - 0x14, 0xc7, 0x9b, 0x40, 0x77, 0xeb, 0x4b, 0x29, 0x71, 0xa8, 0xb0, 0x14, 0xac, 0xcb, 0x9e, 0x7a, - 0x31, 0x29, 0xed, 0xc9, 0x78, 0x90, 0x75, 0x89, 0x22, 0x76, 0x77, 0x64, 0x92, 0x2a, 0x7a, 0x59, - 0xb2, 0xc9, 0x33, 0x0e, 0xc4, 0x7d, 0xc3, 0x64, 0x2c, 0xec, 0xd5, 0x4f, 0xe7, 0xd7, 0xb0, 0xfa, - 0x39, 0x54, 0x92, 0xd9, 0x6d, 0x16, 0x5a, 0x50, 0x6f, 0xf3, 0x1e, 0xff, 0xdf, 0x8f, 0xc7, 0x9f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 0x57, 0x32, 0x47, 0xae, 0x9a, 0x43, 0xea, 0xc1, 0xaf, 0xaf, 0xbb, 0x43, - 0xe7, 0x64, 0x4f, 0x6c, 0x53, 0x11, 0x87, 0x3e, 0xa9, 0xb9, 0x59, 0x29, 0x64, 0xc7, 0xb7, 0x04, - 0x53, 0x34, 0x9f, 0xa8, 0xd8, 0xf0, 0xbf, 0x5b, 0xde, 0x3b, 0x3b, 0xbc, 0xab, 0x06, 0xd1, 0x23, - 0x95, 0xae, 0x14, 0x46, 0x4f, 0xa0, 0x5f, 0x1b, 0xd2, 0x59, 0x89, 0xec, 0xe1, 0x2d, 0xe1, 0x0b, - 0x89, 0xd5, 0x8d, 0xef, 0xfb, 0x37, 0x7b, 0xcf, 0x26, 0x1f, 0x3d, 0x03, 0xd0, 0xa8, 0xa8, 0x96, - 0x86, 0xf4, 0xea, 0x6f, 0xf4, 0xf5, 0x9a, 0xde, 0x42, 0xa2, 0x0b, 0xb8, 0x6f, 0x32, 0x5d, 0xa2, - 0x99, 0xff, 0xbb, 0xe7, 0xc7, 0xda, 0xe3, 0x5b, 0x52, 0x74, 0xb6, 0x14, 0x1e, 0x64, 0x45, 0x21, - 0x9b, 0x58, 0x56, 0xfd, 0x87, 0xf1, 0xe7, 0xda, 0x78, 0xd8, 0xd1, 0x9d, 0xf5, 0xf9, 0xe9, 0x87, - 0xa6, 0xbe, 0x2a, 0x5b, 0x04, 0x39, 0x7d, 0x0e, 0xed, 0xf3, 0x31, 0xe9, 0x32, 0xb4, 0xa5, 0xda, - 0x4f, 0x1d, 0x96, 0xb4, 0x9e, 0xd5, 0x62, 0xd1, 0x6b, 0x57, 0xe7, 0x7f, 0x02, 0x00, 0x00, 0xff, - 0xff, 0xb2, 0x98, 0xf0, 0x1b, 0x0b, 0x03, 0x00, 0x00, + // 426 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xd1, 0x8a, 0xd3, 0x40, + 0x14, 0x86, 0x4d, 0x70, 0xdb, 0x7a, 0xba, 0x2c, 0x71, 0x58, 0xa1, 0x2c, 0xb8, 0x96, 0x5e, 0x2d, + 0x82, 0x89, 0x74, 0xaf, 0x8c, 0x17, 0x52, 0x4b, 0x14, 0x71, 0xdb, 0x91, 0x49, 0x56, 0xd1, 0x9b, + 0x92, 0x26, 0xc7, 0x38, 0x10, 0x7b, 0x86, 0xc9, 0xb8, 0xd0, 0x5b, 0x9f, 0xce, 0xd7, 0x50, 0xf7, + 0x39, 0x54, 0x92, 0x69, 0x37, 0x85, 0x5d, 0x50, 0xef, 0xe6, 0x1c, 0xfe, 0xef, 0xe3, 0xf0, 0x33, + 0x00, 0xa5, 0x5c, 0x19, 0x5f, 0x69, 0x32, 0xc4, 0x3a, 0x85, 0x34, 0x69, 0xb9, 0x3e, 0x1a, 0x16, + 0x44, 0x45, 0x89, 0x41, 0xb3, 0x5d, 0x7e, 0xf9, 0x18, 0xe4, 0x58, 0x65, 0x5a, 0x2a, 0x43, 0xda, + 0x26, 0x47, 0x97, 0x0e, 0xec, 0x73, 0x85, 0x3a, 0x35, 0x92, 0x56, 0xb3, 0xaa, 0x60, 0x3e, 0xb8, + 0xa4, 0x06, 0xce, 0xd0, 0x39, 0x39, 0x18, 0x1f, 0xfb, 0xd6, 0xe3, 0xef, 0x26, 0xda, 0x41, 0xb8, + 0xa4, 0xd8, 0x53, 0xe8, 0x57, 0x19, 0x29, 0x5c, 0x94, 0x78, 0x81, 0xe5, 0xc0, 0x6d, 0xc0, 0xa3, + 0x1b, 0xc1, 0xb8, 0xce, 0x09, 0x68, 0xe2, 0x67, 0x75, 0x7a, 0x74, 0x0a, 0x77, 0xae, 0x12, 0xac, + 0x0f, 0xdd, 0xf3, 0xf9, 0xeb, 0x39, 0x7f, 0x37, 0xf7, 0x6e, 0xd5, 0xc3, 0xec, 0x3c, 0x99, 0x24, + 0x5c, 0x78, 0x0e, 0xdb, 0x87, 0xde, 0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0xd6, 0xfa, 0xfc, 0xf1, + 0x87, 0xba, 0xbe, 0x32, 0x5d, 0xfa, 0x19, 0x7d, 0x0e, 0xec, 0xf3, 0x11, 0xe9, 0x22, 0xb0, 0xa5, + 0xda, 0x6f, 0x1d, 0x14, 0xb4, 0x99, 0xd5, 0x72, 0xd9, 0x69, 0x56, 0xa7, 0x7f, 0x02, 0x00, 0x00, + 0xff, 0xff, 0x80, 0x8b, 0x42, 0x14, 0x0d, 0x03, 0x00, 0x00, } diff --git a/proto/go/internal/linter/lint_test.go b/proto/go/internal/linter/lint_test.go index 2f12badb01..cd38fe81c1 100644 --- a/proto/go/internal/linter/lint_test.go +++ b/proto/go/internal/linter/lint_test.go @@ -29,7 +29,6 @@ func TestLintFile(t *testing.T) { errors.New(`go/internal/linter/testdata/invalid.proto: Method "InvalidMethod0": missing op_type option`), errors.New(`go/internal/linter/testdata/invalid.proto: Method "InvalidMethod1": op set to UNKNOWN`), errors.New(`go/internal/linter/testdata/invalid.proto: Method "InvalidMethod2": unexpected count of target_repository fields 0, expected 1, found target_repository label at: []`), - errors.New(`go/internal/linter/testdata/invalid.proto: Method "InvalidMethod3": unexpected count of target_repository fields 1, expected 0, found target_repository label at: [InvalidMethodRequestWithRepo.destination]`), errors.New(`go/internal/linter/testdata/invalid.proto: Method "InvalidMethod4": unexpected count of target_repository fields 0, expected 1, found target_repository label at: []`), errors.New(`go/internal/linter/testdata/invalid.proto: Method "InvalidMethod5": wrong type of field RequestWithWrongTypeRepository.header.repository, expected .gitaly.Repository, got .test.InvalidMethodResponse`), errors.New(`go/internal/linter/testdata/invalid.proto: Method "InvalidMethod6": unexpected count of target_repository fields 0, expected 1, found target_repository label at: []`), @@ -38,7 +37,6 @@ func TestLintFile(t *testing.T) { errors.New(`go/internal/linter/testdata/invalid.proto: Method "InvalidMethod9": unexpected count of target_repository fields 1, expected 0, found target_repository label at: [InvalidMethodRequestWithRepo.destination]`), errors.New(`go/internal/linter/testdata/invalid.proto: Method "InvalidMethod10": unexpected count of storage field 1, expected 0, found storage label at: [RequestWithStorageAndRepo.storage_name]`), errors.New(`go/internal/linter/testdata/invalid.proto: Method "InvalidMethod11": unexpected count of storage field 1, expected 0, found storage label at: [RequestWithNestedStorageAndRepo.inner_message.storage_name]`), - errors.New(`go/internal/linter/testdata/invalid.proto: Method "InvalidMethod12": unexpected count of storage field 1, expected 0, found storage label at: [RequestWithInnerNestedStorage.header.storage_name]`), errors.New(`go/internal/linter/testdata/invalid.proto: Method "InvalidMethod13": unexpected count of storage field 0, expected 1, found storage label at: []`), errors.New(`go/internal/linter/testdata/invalid.proto: Method "InvalidMethod14": unexpected count of storage field 2, expected 1, found storage label at: [RequestWithMultipleNestedStorage.inner_message.storage_name RequestWithMultipleNestedStorage.storage_name]`), }, diff --git a/proto/go/internal/linter/method.go b/proto/go/internal/linter/method.go index 8c5ffadccd..bff9846895 100644 --- a/proto/go/internal/linter/method.go +++ b/proto/go/internal/linter/method.go @@ -26,9 +26,9 @@ func (ml methodLinter) validateAccessor() error { return ml.ensureValidRepoScope() case gitalypb.OperationMsg_STORAGE: return ml.ensureValidStorageScope() + default: + return nil } - - return nil } // validateMutator will ensure the following rules: @@ -36,19 +36,12 @@ func (ml methodLinter) validateAccessor() error { // - Mutator RPC's without target repo must not be scoped at repo level func (ml methodLinter) validateMutator() error { switch scope := ml.opMsg.GetScopeLevel(); scope { - case gitalypb.OperationMsg_REPOSITORY: return ml.ensureValidRepoScope() - - case gitalypb.OperationMsg_SERVER: - return ml.ensureValidServerScope() - case gitalypb.OperationMsg_STORAGE: return ml.ensureValidStorageScope() - default: return fmt.Errorf("unknown operation scope level %d", scope) - } } @@ -60,13 +53,6 @@ func (ml methodLinter) ensureValidStorageScope() error { return ml.ensureValidStorage(1) } -func (ml methodLinter) ensureValidServerScope() error { - if err := ml.ensureValidTargetRepository(0); err != nil { - return err - } - return ml.ensureValidStorage(0) -} - func (ml methodLinter) ensureValidRepoScope() error { if err := ml.ensureValidTargetRepository(1); err != nil { return err diff --git a/proto/go/internal/linter/testdata/invalid.pb.go b/proto/go/internal/linter/testdata/invalid.pb.go index e30bec0b9d..ea0922a565 100644 --- a/proto/go/internal/linter/testdata/invalid.pb.go +++ b/proto/go/internal/linter/testdata/invalid.pb.go @@ -643,51 +643,50 @@ func init() { } var fileDescriptor_506a53e91b227711 = []byte{ - // 693 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0x5d, 0x4f, 0x13, 0x4d, - 0x14, 0xc7, 0x9f, 0x69, 0xfa, 0x34, 0x70, 0xc0, 0xb7, 0x89, 0x0a, 0xd6, 0x17, 0xc8, 0xe2, 0x0b, - 0x2a, 0x69, 0xa1, 0xa0, 0x22, 0xc1, 0x0b, 0x1a, 0x63, 0x44, 0x42, 0x13, 0x0b, 0x09, 0x89, 0x2f, - 0xc1, 0xd1, 0x3d, 0xd9, 0x6e, 0xb2, 0xec, 0xd6, 0x9d, 0x01, 0xd3, 0x3b, 0x2f, 0x8d, 0x57, 0x5e, - 0x89, 0xdf, 0xc1, 0x2f, 0x60, 0xfc, 0x00, 0x7e, 0x28, 0xae, 0xcc, 0xbe, 0xb4, 0xec, 0xce, 0xcc, - 0xe2, 0x08, 0xde, 0x35, 0xb3, 0xe7, 0xfc, 0xcf, 0x6f, 0xfe, 0x73, 0x4e, 0x4e, 0xe1, 0xb6, 0x13, - 0xd4, 0x5d, 0x5f, 0x60, 0xe8, 0x33, 0xaf, 0xee, 0xc5, 0xbf, 0xea, 0x02, 0xb9, 0xb0, 0x99, 0x60, - 0x75, 0xd7, 0xdf, 0x63, 0x9e, 0x6b, 0xd7, 0xba, 0x61, 0x20, 0x02, 0x5a, 0x8e, 0xce, 0xab, 0x10, - 0x05, 0x25, 0x27, 0xd5, 0x51, 0xde, 0x61, 0x21, 0xa6, 0xdf, 0xad, 0x8b, 0x70, 0x7e, 0x35, 0x49, - 0x58, 0x47, 0xd1, 0x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a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x96, 0xdb, 0x6e, 0xd3, 0x4c, + 0x10, 0xc7, 0x3f, 0x47, 0xf9, 0xa2, 0x74, 0x5a, 0x4e, 0x2b, 0xa0, 0x25, 0x1c, 0x5a, 0x99, 0x53, + 0x81, 0xca, 0x69, 0xd3, 0x00, 0xa5, 0x2a, 0x17, 0x8d, 0x10, 0x22, 0x54, 0x89, 0x44, 0x1a, 0x29, + 0x12, 0x07, 0x85, 0x05, 0x8f, 0x1c, 0x4b, 0x8e, 0x6d, 0xbc, 0xdb, 0xa2, 0xdc, 0x71, 0x89, 0xb8, + 0xe2, 0x8a, 0xf2, 0x0e, 0xbc, 0x00, 0x4f, 0xc0, 0x43, 0xf5, 0x02, 0x21, 0x1f, 0x92, 0xda, 0xeb, + 0x75, 0x31, 0xe9, 0x5d, 0x34, 0x9e, 0xf9, 0xcd, 0x7f, 0xff, 0x33, 0xdb, 0x2d, 0xdc, 0x31, 0x9c, + 0xaa, 0x69, 0x73, 0xf4, 0x6c, 0x6a, 0x55, 0xad, 0xe0, 0x57, 0x95, 0x23, 0xe3, 0x3a, 0xe5, 0xb4, + 0x6a, 0xda, 0xfb, 0xd4, 0x32, 0x75, 0xcd, 0xf5, 0x1c, 0xee, 0x90, 0xa2, 0x1f, 0xaf, 0x80, 0x9f, + 0x14, 0x46, 0x2a, 0x73, 0x6c, 0x40, 0x3d, 0x8c, 0xbe, 0xab, 0x17, 0xe1, 0x7c, 0x33, 0x2c, 0x68, + 0x21, 0x1f, 0x38, 0x7a, 0x07, 0x3f, 0xec, 0x21, 0xe3, 0xea, 0x4b, 0xb8, 0x22, 0x8b, 0xf7, 0x4c, + 0x3e, 0xe8, 0xa0, 0xeb, 0x90, 0x4d, 0x98, 0xd5, 0x91, 0x71, 0xd3, 0xa6, 0xdc, 0x74, 0xec, 0x05, + 0x65, 0x49, 0x59, 0x9e,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0xb2, 0x76, 0x52, 0x64, 0x21, 0x85, 0xac, 0x9f, 0x14, 0xa9, 0x90, 0x57, 0x02, 0xf2, + 0x3e, 0xb9, 0x91, 0x67, 0x41, 0xf3, 0xc1, 0x5f, 0x0b, 0xf0, 0x07, 0xe4, 0x66, 0xae, 0x0d, 0xca, + 0x47, 0x6f, 0x0b, 0xf4, 0x87, 0x24, 0xeb, 0xf1, 0xc8, 0xc7, 0x13, 0xdd, 0xdd, 0x10, 0xdc, 0x4d, + 0xbc, 0x5f, 0xd3, 0xb9, 0xfb, 0x88, 0xa8, 0xd9, 0x03, 0x1b, 0xbf, 0xe0, 0xc7, 0xa3, 0xcb, 0x87, + 0x07, 0xcb, 0xc5, 0xb2, 0x72, 0xb6, 0x40, 0x7a, 0x70, 0x26, 0xb9, 0xb3, 0xab, 0xe4, 0x6f, 0x7f, + 0xe4, 0xf3, 0xad, 0xd9, 0x1b, 0x11, 0xbc, 0x96, 0x39, 0xb7, 0x7f, 0xc7, 0xfb, 0x3e, 0x0b, 0xf8, + 0xf5, 0x29, 0x07, 0x77, 0x64, 0xc5, 0x5b, 0x11, 0x59, 0x27, 0xb7, 0x52, 0x8a, 0xa5, 0x6f, 0x58, + 0xce, 0x0e, 0xef, 0x4a, 0xc1, 0x3f, 0x65, 0xeb, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x67, 0x39, + 0xda, 0x66, 0xe1, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -708,8 +707,6 @@ type InvalidServiceClient interface { InvalidMethod1(ctx context.Context, in *InvalidMethodRequest, opts ...grpc.CallOption) (*InvalidMethodResponse, error) // should fail if target repo is not provided for accessor InvalidMethod2(ctx context.Context, in *InvalidMethodRequest, opts ...grpc.CallOption) (*InvalidMethodResponse, error) - // should fail if target repo is provided for server-scoped mutator - InvalidMethod3(ctx context.Context, in *InvalidMethodRequestWithRepo, opts ...grpc.CallOption) (*InvalidMethodResponse, error) // should fail if missing either target repo or non-repo-scope for mutator InvalidMethod4(ctx context.Context, in *InvalidMethodRequest, opts ...grpc.CallOption) (*InvalidMethodResponse, error) // should fail if repository is not of type Repository @@ -726,8 +723,6 @@ type InvalidServiceClient interface { InvalidMethod10(ctx context.Context, in *RequestWithStorageAndRepo, opts ...grpc.CallOption) (*InvalidMethodResponse, error) // should fail if storage is specified for repository scoped RPC InvalidMethod11(ctx context.Context, in *RequestWithNestedStorageAndRepo, opts ...grpc.CallOption) (*InvalidMethodResponse, error) - // should fail if storage is specified for server scoped RPC - InvalidMethod12(ctx context.Context, in *RequestWithInnerNestedStorage, opts ...grpc.CallOption) (*InvalidMethodResponse, error) // should fail if storage isn't specified for storage scoped RPC InvalidMethod13(ctx context.Context, in *InvalidTargetType, opts ...grpc.CallOption) (*InvalidMethodResponse, error) // should fail if multiple storage is specified for storage scoped RPC @@ -769,15 +764,6 @@ func (c *invalidServiceClient) InvalidMethod2(ctx context.Context, in *InvalidMe return out, nil } -func (c *invalidServiceClient) InvalidMethod3(ctx context.Context, in *InvalidMethodRequestWithRepo, opts ...grpc.CallOption) (*InvalidMethodResponse, error) { - out := new(InvalidMethodResponse) - err := c.cc.Invoke(ctx, "/test.InvalidService/InvalidMethod3", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *invalidServiceClient) InvalidMethod4(ctx context.Context, in *InvalidMethodRequest, opts ...grpc.CallOption) (*InvalidMethodResponse, error) { out := new(InvalidMethodResponse) err := c.cc.Invoke(ctx, "/test.InvalidService/InvalidMethod4", in, out, opts...) @@ -850,15 +836,6 @@ func (c *invalidServiceClient) InvalidMethod11(ctx context.Context, in *RequestW return out, nil } -func (c *invalidServiceClient) InvalidMethod12(ctx context.Context, in *RequestWithInnerNestedStorage, opts ...grpc.CallOption) (*InvalidMethodResponse, error) { - out := new(InvalidMethodResponse) - err := c.cc.Invoke(ctx, "/test.InvalidService/InvalidMethod12", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *invalidServiceClient) InvalidMethod13(ctx context.Context, in *InvalidTargetType, opts ...grpc.CallOption) (*InvalidMethodResponse, error) { out := new(InvalidMethodResponse) err := c.cc.Invoke(ctx, "/test.InvalidService/InvalidMethod13", in, out, opts...) @@ -885,8 +862,6 @@ type InvalidServiceServer interface { InvalidMethod1(context.Context, *InvalidMethodRequest) (*InvalidMethodResponse, error) // should fail if target repo is not provided for accessor InvalidMethod2(context.Context, *InvalidMethodRequest) (*InvalidMethodResponse, error) - // should fail if target repo is provided for server-scoped mutator - InvalidMethod3(context.Context, *InvalidMethodRequestWithRepo) (*InvalidMethodResponse, error) // should fail if missing either target repo or non-repo-scope for mutator InvalidMethod4(context.Context, *InvalidMethodRequest) (*InvalidMethodResponse, error) // should fail if repository is not of type Repository @@ -903,8 +878,6 @@ type InvalidServiceServer interface { InvalidMethod10(context.Context, *RequestWithStorageAndRepo) (*InvalidMethodResponse, error) // should fail if storage is specified for repository scoped RPC InvalidMethod11(context.Context, *RequestWithNestedStorageAndRepo) (*InvalidMethodResponse, error) - // should fail if storage is specified for server scoped RPC - InvalidMethod12(context.Context, *RequestWithInnerNestedStorage) (*InvalidMethodResponse, error) // should fail if storage isn't specified for storage scoped RPC InvalidMethod13(context.Context, *InvalidTargetType) (*InvalidMethodResponse, error) // should fail if multiple storage is specified for storage scoped RPC @@ -924,9 +897,6 @@ func (*UnimplementedInvalidServiceServer) InvalidMethod1(ctx context.Context, re func (*UnimplementedInvalidServiceServer) InvalidMethod2(ctx context.Context, req *InvalidMethodRequest) (*InvalidMethodResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method InvalidMethod2 not implemented") } -func (*UnimplementedInvalidServiceServer) InvalidMethod3(ctx context.Context, req *InvalidMethodRequestWithRepo) (*InvalidMethodResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method InvalidMethod3 not implemented") -} func (*UnimplementedInvalidServiceServer) InvalidMethod4(ctx context.Context, req *InvalidMethodRequest) (*InvalidMethodResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method InvalidMethod4 not implemented") } @@ -951,9 +921,6 @@ func (*UnimplementedInvalidServiceServer) InvalidMethod10(ctx context.Context, r func (*UnimplementedInvalidServiceServer) InvalidMethod11(ctx context.Context, req *RequestWithNestedStorageAndRepo) (*InvalidMethodResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method InvalidMethod11 not implemented") } -func (*UnimplementedInvalidServiceServer) InvalidMethod12(ctx context.Context, req *RequestWithInnerNestedStorage) (*InvalidMethodResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method InvalidMethod12 not implemented") -} func (*UnimplementedInvalidServiceServer) InvalidMethod13(ctx context.Context, req *InvalidTargetType) (*InvalidMethodResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method InvalidMethod13 not implemented") } @@ -1019,24 +986,6 @@ func _InvalidService_InvalidMethod2_Handler(srv interface{}, ctx context.Context return interceptor(ctx, in, info, handler) } -func _InvalidService_InvalidMethod3_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(InvalidMethodRequestWithRepo) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(InvalidServiceServer).InvalidMethod3(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/test.InvalidService/InvalidMethod3", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(InvalidServiceServer).InvalidMethod3(ctx, req.(*InvalidMethodRequestWithRepo)) - } - return interceptor(ctx, in, info, handler) -} - func _InvalidService_InvalidMethod4_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(InvalidMethodRequest) if err := dec(in); err != nil { @@ -1181,24 +1130,6 @@ func _InvalidService_InvalidMethod11_Handler(srv interface{}, ctx context.Contex return interceptor(ctx, in, info, handler) } -func _InvalidService_InvalidMethod12_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RequestWithInnerNestedStorage) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(InvalidServiceServer).InvalidMethod12(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/test.InvalidService/InvalidMethod12", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(InvalidServiceServer).InvalidMethod12(ctx, req.(*RequestWithInnerNestedStorage)) - } - return interceptor(ctx, in, info, handler) -} - func _InvalidService_InvalidMethod13_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(InvalidTargetType) if err := dec(in); err != nil { @@ -1251,10 +1182,6 @@ var _InvalidService_serviceDesc = grpc.ServiceDesc{ MethodName: "InvalidMethod2", Handler: _InvalidService_InvalidMethod2_Handler, }, - { - MethodName: "InvalidMethod3", - Handler: _InvalidService_InvalidMethod3_Handler, - }, { MethodName: "InvalidMethod4", Handler: _InvalidService_InvalidMethod4_Handler, @@ -1287,10 +1214,6 @@ var _InvalidService_serviceDesc = grpc.ServiceDesc{ MethodName: "InvalidMethod11", Handler: _InvalidService_InvalidMethod11_Handler, }, - { - MethodName: "InvalidMethod12", - Handler: _InvalidService_InvalidMethod12_Handler, - }, { MethodName: "InvalidMethod13", Handler: _InvalidService_InvalidMethod13_Handler, diff --git a/proto/go/internal/linter/testdata/invalid.proto b/proto/go/internal/linter/testdata/invalid.proto index cd446ee749..6d4f40927c 100644 --- a/proto/go/internal/linter/testdata/invalid.proto +++ b/proto/go/internal/linter/testdata/invalid.proto @@ -78,13 +78,6 @@ service InvalidService { op: ACCESSOR }; } - // should fail if target repo is provided for server-scoped mutator - rpc InvalidMethod3(InvalidMethodRequestWithRepo) returns (InvalidMethodResponse) { - option (gitaly.op_type) = { - op: MUTATOR - scope_level: SERVER - }; - } // should fail if missing either target repo or non-repo-scope for mutator rpc InvalidMethod4(InvalidMethodRequest) returns (InvalidMethodResponse) { option (gitaly.op_type).op = MUTATOR; @@ -135,14 +128,6 @@ service InvalidService { }; } - // should fail if storage is specified for server scoped RPC - rpc InvalidMethod12(RequestWithInnerNestedStorage) returns (InvalidMethodResponse) { - option (gitaly.op_type) = { - op: MUTATOR - scope_level: SERVER - }; - } - // should fail if storage isn't specified for storage scoped RPC rpc InvalidMethod13(InvalidTargetType) returns (InvalidMethodResponse) { option (gitaly.op_type) = { diff --git a/proto/go/internal/linter/testdata/valid.pb.go b/proto/go/internal/linter/testdata/valid.pb.go index 2402fa89f4..371b007b2b 100644 --- a/proto/go/internal/linter/testdata/valid.pb.go +++ b/proto/go/internal/linter/testdata/valid.pb.go @@ -457,42 +457,41 @@ func init() { } var fileDescriptor_7058768ff0db2cf7 = []byte{ - // 545 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x94, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0x86, 0xe5, 0x28, 0x44, 0x61, 0x92, 0x8a, 0x6a, 0x7b, 0x20, 0x89, 0x44, 0x41, 0x16, 0x52, - 0x23, 0x81, 0x12, 0x91, 0x52, 0x0a, 0x08, 0x72, 0x28, 0x15, 0x90, 0xa2, 0x14, 0x70, 0x2b, 0x38, - 0x70, 0x88, 0x36, 0xf1, 0xc8, 0x31, 0x72, 0xbc, 0x66, 0x77, 0x5a, 0xa9, 0x6f, 0xc0, 0x8d, 0x63, - 0x7a, 0xe1, 0x75, 0x78, 0x1e, 0xce, 0x3d, 0x21, 0xaf, 0x9d, 0xb0, 0x8e, 0x43, 0x68, 0xe1, 0x66, - 0xcd, 0xce, 0xff, 0xed, 0xef, 0xdf, 0x33, 0x86, 0x2d, 0x4f, 0xb4, 0xfd, 0x90, 0x50, 0x86, 0x3c, - 0x68, 0x07, 0xfa, 0xa9, 0x4d, 0xa8, 0xc8, 0xe5, 0xc4, 0xdb, 0xa7, 0x3c, 0xf0, 0xdd, 0x56, 0x24, - 0x05, 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8c, 0xee, 0xcc, 0xa7, 0x5d, 0x6d, - 0xe9, 0xc0, 0xa4, 0x3c, 0x62, 0x9b, 0x39, 0x4a, 0x66, 0xcf, 0x56, 0xb3, 0x7a, 0x26, 0x6b, 0x37, - 0xf3, 0x7a, 0xf9, 0x89, 0x5b, 0x8d, 0x7a, 0x65, 0xa2, 0x1e, 0xb3, 0x3f, 0xff, 0x23, 0x56, 0xa7, - 0x54, 0x60, 0x7d, 0x13, 0xf4, 0x84, 0xdd, 0xce, 0x83, 0x2e, 0xe1, 0x6a, 0x8e, 0x1b, 0x96, 0xf4, - 0xef, 0x7e, 0xfb, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3f, 0x24, 0x44, 0x9b, 0x39, 0x06, 0x00, - 0x00, + // 532 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x94, 0xc1, 0x6e, 0xd3, 0x4e, + 0x10, 0xc6, 0xe5, 0xc8, 0x8a, 0xf2, 0x9f, 0xa4, 0xfa, 0x57, 0xdb, 0x03, 0x49, 0x24, 0x0a, 0xb2, + 0x90, 0x1a, 0x09, 0xe4, 0x88, 0x54, 0xa5, 0x80, 0x20, 0x87, 0x52, 0x01, 0xa9, 0x94, 0x02, 0x6e, + 0x05, 0x07, 0x0e, 0xd1, 0x26, 0x1e, 0x39, 0x46, 0x8e, 0xd7, 0xec, 0x4e, 0x2b, 0xf5, 0x0d, 0x78, + 0x83, 0xf4, 0xc2, 0xcb, 0x70, 0xe0, 0x79, 0x38, 0xf7, 0x84, 0xbc, 0x76, 0xc2, 0x3a, 0x09, 0xa1, + 0x85, 0x5b, 0x34, 0x3b, 0xdf, 0x6f, 0xbf, 0x7c, 0x3b, 0x63, 0xd8, 0x09, 0x44, 0x3b, 0x8c, 0x09, + 0x65, 0xcc, 0xa3, 0x76, 0xa4, 0x7f, 0xb5, 0x09, 0x15, 0xf9, 0x9c, 0x78,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xea, 0x99, 0xac, 0x7d, 0x76, 0x7b, 0xed, + 0x48, 0xaf, 0x47, 0xbd, 0x32, 0x51, 0x8f, 0xd9, 0xef, 0xd7, 0x7a, 0x35, 0xa6, 0x72, 0x35, 0x6d, + 0xd9, 0x15, 0x6b, 0xb3, 0xc4, 0xfa, 0x26, 0xe8, 0x09, 0xbb, 0xb3, 0x0c, 0xba, 0x86, 0xab, 0x39, + 0x6e, 0x58, 0xd6, 0x5f, 0xe8, 0xdd, 0x9f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x23, 0x7b, 0xb9, 0x87, + 0xec, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -582,7 +581,6 @@ type ValidServiceClient interface { TestMethod(ctx context.Context, in *ValidRequest, opts ...grpc.CallOption) (*ValidResponse, error) TestMethod2(ctx context.Context, in *ValidRequest, opts ...grpc.CallOption) (*ValidResponse, error) TestMethod3(ctx context.Context, in *ValidRequest, opts ...grpc.CallOption) (*ValidResponse, error) - TestMethod4(ctx context.Context, in *ValidRequestWithoutRepo, opts ...grpc.CallOption) (*ValidResponse, error) TestMethod5(ctx context.Context, in *ValidNestedRequest, opts ...grpc.CallOption) (*ValidResponse, error) TestMethod6(ctx context.Context, in *ValidNestedSharedRequest, opts ...grpc.CallOption) (*ValidResponse, error) TestMethod7(ctx context.Context, in *ValidInnerNestedRequest, opts ...grpc.CallOption) (*ValidResponse, error) @@ -625,15 +623,6 @@ func (c *validServiceClient) TestMethod3(ctx context.Context, in *ValidRequest, return out, nil } -func (c *validServiceClient) TestMethod4(ctx context.Context, in *ValidRequestWithoutRepo, opts ...grpc.CallOption) (*ValidResponse, error) { - out := new(ValidResponse) - err := c.cc.Invoke(ctx, "/test.ValidService/TestMethod4", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *validServiceClient) TestMethod5(ctx context.Context, in *ValidNestedRequest, opts ...grpc.CallOption) (*ValidResponse, error) { out := new(ValidResponse) err := c.cc.Invoke(ctx, "/test.ValidService/TestMethod5", in, out, opts...) @@ -684,7 +673,6 @@ type ValidServiceServer interface { TestMethod(context.Context, *ValidRequest) (*ValidResponse, error) TestMethod2(context.Context, *ValidRequest) (*ValidResponse, error) TestMethod3(context.Context, *ValidRequest) (*ValidResponse, error) - TestMethod4(context.Context, *ValidRequestWithoutRepo) (*ValidResponse, error) TestMethod5(context.Context, *ValidNestedRequest) (*ValidResponse, error) TestMethod6(context.Context, *ValidNestedSharedRequest) (*ValidResponse, error) TestMethod7(context.Context, *ValidInnerNestedRequest) (*ValidResponse, error) @@ -705,9 +693,6 @@ func (*UnimplementedValidServiceServer) TestMethod2(ctx context.Context, req *Va func (*UnimplementedValidServiceServer) TestMethod3(ctx context.Context, req *ValidRequest) (*ValidResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method TestMethod3 not implemented") } -func (*UnimplementedValidServiceServer) TestMethod4(ctx context.Context, req *ValidRequestWithoutRepo) (*ValidResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method TestMethod4 not implemented") -} func (*UnimplementedValidServiceServer) TestMethod5(ctx context.Context, req *ValidNestedRequest) (*ValidResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method TestMethod5 not implemented") } @@ -782,24 +767,6 @@ func _ValidService_TestMethod3_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } -func _ValidService_TestMethod4_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ValidRequestWithoutRepo) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ValidServiceServer).TestMethod4(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/test.ValidService/TestMethod4", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ValidServiceServer).TestMethod4(ctx, req.(*ValidRequestWithoutRepo)) - } - return interceptor(ctx, in, info, handler) -} - func _ValidService_TestMethod5_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ValidNestedRequest) if err := dec(in); err != nil { @@ -906,10 +873,6 @@ var _ValidService_serviceDesc = grpc.ServiceDesc{ MethodName: "TestMethod3", Handler: _ValidService_TestMethod3_Handler, }, - { - MethodName: "TestMethod4", - Handler: _ValidService_TestMethod4_Handler, - }, { MethodName: "TestMethod5", Handler: _ValidService_TestMethod5_Handler, diff --git a/proto/go/internal/linter/testdata/valid.proto b/proto/go/internal/linter/testdata/valid.proto index 0f209aca6a..e8bae72299 100644 --- a/proto/go/internal/linter/testdata/valid.proto +++ b/proto/go/internal/linter/testdata/valid.proto @@ -73,13 +73,6 @@ service ValidService { }; } - rpc TestMethod4(ValidRequestWithoutRepo) returns (ValidResponse) { - option (gitaly.op_type) = { - op: MUTATOR - scope_level: SERVER - }; - } - rpc TestMethod5(ValidNestedRequest) returns (ValidResponse) { option (gitaly.op_type) = { op: MUTATOR diff --git a/proto/lint.proto b/proto/lint.proto index 94395a94c1..b6688e2ca9 100644 --- a/proto/lint.proto +++ b/proto/lint.proto @@ -17,13 +17,14 @@ message OperationMsg { enum Scope { REPOSITORY = 0; - SERVER = 1; STORAGE = 2; + + reserved 1; + reserved "SERVER"; } // Scope level indicates what level an RPC interacts with a server: // - REPOSITORY: scoped to only a single repo - // - SERVER: affects the entire server and potentially all repos // - STORAGE: scoped to a specific storage location and all repos within Scope scope_level = 2; } diff --git a/ruby/proto/gitaly/lint_pb.rb b/ruby/proto/gitaly/lint_pb.rb index 3d922340d3..8963e53408 100644 --- a/ruby/proto/gitaly/lint_pb.rb +++ b/ruby/proto/gitaly/lint_pb.rb @@ -16,7 +16,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do end add_enum "gitaly.OperationMsg.Scope" do value :REPOSITORY, 0 - value :SERVER, 1 value :STORAGE, 2 end end -- GitLab From 803a573c6a80d27a05512ec12a37a9fb9218adf7 Mon Sep 17 00:00:00 2001 From: Sami Hiltunen Date: Tue, 15 Sep 2020 18:35:00 +0200 Subject: [PATCH 5/5] temp --- go.mod | 5 +- go.sum | 27 ++ internal/praefect/auth_test.go | 11 +- internal/praefect/mock/mock.pb.go | 326 ++++++++---------- internal/praefect/mock/mock.proto | 17 +- .../praefect/protoregistry/protoregistry.go | 52 +-- .../protoregistry/protoregistry_test.go | 3 - .../praefect/protoregistry/protoutil/util.go | 54 +++ proto/go/internal/linter/lint.go | 4 +- proto/go/internal/linter/method.go | 8 +- 10 files changed, 247 insertions(+), 260 deletions(-) create mode 100644 internal/praefect/protoregistry/protoutil/util.go diff --git a/go.mod b/go.mod index 44f7cd29ac..02f23311bc 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/cloudflare/tableflip v1.2.1-0.20200514155827-4baec9811f2b github.com/getsentry/sentry-go v0.5.1 - github.com/golang/protobuf v1.3.2 + github.com/golang/protobuf v1.4.1 github.com/google/uuid v1.1.1 github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 @@ -25,7 +25,8 @@ require ( golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e golang.org/x/sys v0.0.0-20200113162924-86b910548bc1 golang.org/x/text v0.3.3 // indirect - google.golang.org/grpc v1.24.0 + google.golang.org/grpc v1.27.0 + google.golang.org/protobuf v1.25.0 gopkg.in/yaml.v2 v2.2.8 ) diff --git a/go.sum b/go.sum index 63ca750694..25a090598b 100644 --- a/go.sum +++ b/go.sum @@ -41,6 +41,7 @@ github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+Ce github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/certifi/gocertifi v0.0.0-20180905225744-ee1a9a0726d2 h1:MmeatFT1pTPSVb4nkPmBFN/LRZ97vPjsFKsZrU3KKTs= github.com/certifi/gocertifi v0.0.0-20180905225744-ee1a9a0726d2/go.mod h1:GJKEexRPVJrBSOjoqN5VNOIKJ5Q3RViH6eu3puDRwx4= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= @@ -68,6 +69,8 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= @@ -122,13 +125,23 @@ github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1 h1:ZFgWrT+bLgsYPirOnRfKLYJLvssAegOj/hgyMFdJZe0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= @@ -519,12 +532,26 @@ google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBr google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba h1:pRj9OXZbwNtbtZtOB4dLwfK4u+EVRMvP+e9zKkg2grM= google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.24.0 h1:vb/1TCsVn3DcJlQ0Gs1yB1pKI6Do2/QNwxdKqmc/b0s= google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= +google.golang.org/grpc v1.27.0 h1:rRYRFMVgRv6E0D70Skyfsr28tDXIuuPZyWGMPdMcnXg= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= gopkg.in/DataDog/dd-trace-go.v1 v1.7.0 h1:7wbMayb6JXcbAS95RN7MI42W3o1BCxCcdIzZfVWBAiE= gopkg.in/DataDog/dd-trace-go.v1 v1.7.0/go.mod h1:DVp8HmDh8PuTu2Z0fVVlBsyWaC++fzwVCaGWylTe3tg= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= diff --git a/internal/praefect/auth_test.go b/internal/praefect/auth_test.go index 055a1025dd..1c871263a1 100644 --- a/internal/praefect/auth_test.go +++ b/internal/praefect/auth_test.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/golang/protobuf/proto" + "github.com/golang/protobuf/ptypes/empty" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" gitalyauth "gitlab.com/gitlab-org/gitaly/auth" @@ -61,9 +62,7 @@ func TestAuthFailures(t *testing.T) { cli := mock.NewSimpleServiceClient(conn) - _, err = cli.ServerAccessor(ctx, &mock.SimpleRequest{ - Value: 1, - }) + _, err = cli.RepoAccessorUnary(ctx, &mock.RepoRequest{}) testhelper.RequireGrpcError(t, err, tc.code) }) @@ -135,10 +134,8 @@ func dial(serverSocketPath string, opts []grpc.DialOption) (*grpc.ClientConn, er func runServer(t *testing.T, token string, required bool) (*grpc.Server, string, func()) { backendToken := "abcxyz" mockServer := &mockSvc{ - serverAccessor: func(_ context.Context, req *mock.SimpleRequest) (*mock.SimpleResponse, error) { - return &mock.SimpleResponse{ - Value: req.Value + 1, - }, nil + repoAccessorUnary: func(_ context.Context, req *mock.RepoRequest) (*empty.Empty, error) { + return &empty.Empty{}, nil }, } backend, cleanup := newMockDownstream(t, backendToken, mockServer) diff --git a/internal/praefect/mock/mock.pb.go b/internal/praefect/mock/mock.pb.go index 6f66b292bc..7ad3c12854 100644 --- a/internal/praefect/mock/mock.pb.go +++ b/internal/praefect/mock/mock.pb.go @@ -1,12 +1,20 @@ +// +//This file is a mock gRPC service used for validating the various types of +//gRPC methods that Praefect is expected to reverse proxy. It is intended to keep +//tests simple and keep Praefect decoupled from specific gRPC services. + // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.23.0 +// protoc v3.12.4 // source: mock.proto package mock import ( context "context" - fmt "fmt" - math "math" + reflect "reflect" + sync "sync" proto "github.com/golang/protobuf/proto" empty "github.com/golang/protobuf/ptypes/empty" @@ -14,180 +22,174 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type SimpleRequest struct { - Value int32 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 -func (m *SimpleRequest) Reset() { *m = SimpleRequest{} } -func (m *SimpleRequest) String() string { return proto.CompactTextString(m) } -func (*SimpleRequest) ProtoMessage() {} -func (*SimpleRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_6fa4806c90f7156d, []int{0} -} +type RepoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *SimpleRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SimpleRequest.Unmarshal(m, b) -} -func (m *SimpleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SimpleRequest.Marshal(b, m, deterministic) -} -func (m *SimpleRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SimpleRequest.Merge(m, src) -} -func (m *SimpleRequest) XXX_Size() int { - return xxx_messageInfo_SimpleRequest.Size(m) -} -func (m *SimpleRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SimpleRequest.DiscardUnknown(m) + Repo *gitalypb.Repository `protobuf:"bytes,1,opt,name=repo,proto3" json:"repo,omitempty"` } -var xxx_messageInfo_SimpleRequest proto.InternalMessageInfo - -func (m *SimpleRequest) GetValue() int32 { - if m != nil { - return m.Value +func (x *RepoRequest) Reset() { + *x = RepoRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_mock_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return 0 } -type SimpleResponse struct { - Value int32 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (x *RepoRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *SimpleResponse) Reset() { *m = SimpleResponse{} } -func (m *SimpleResponse) String() string { return proto.CompactTextString(m) } -func (*SimpleResponse) ProtoMessage() {} -func (*SimpleResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_6fa4806c90f7156d, []int{1} -} +func (*RepoRequest) ProtoMessage() {} -func (m *SimpleResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SimpleResponse.Unmarshal(m, b) -} -func (m *SimpleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SimpleResponse.Marshal(b, m, deterministic) -} -func (m *SimpleResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SimpleResponse.Merge(m, src) -} -func (m *SimpleResponse) XXX_Size() int { - return xxx_messageInfo_SimpleResponse.Size(m) -} -func (m *SimpleResponse) XXX_DiscardUnknown() { - xxx_messageInfo_SimpleResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_SimpleResponse proto.InternalMessageInfo - -func (m *SimpleResponse) GetValue() int32 { - if m != nil { - return m.Value +func (x *RepoRequest) ProtoReflect() protoreflect.Message { + mi := &file_mock_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return 0 -} - -type RepoRequest struct { - Repo *gitalypb.Repository `protobuf:"bytes,1,opt,name=repo,proto3" json:"repo,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + return mi.MessageOf(x) } -func (m *RepoRequest) Reset() { *m = RepoRequest{} } -func (m *RepoRequest) String() string { return proto.CompactTextString(m) } -func (*RepoRequest) ProtoMessage() {} +// Deprecated: Use RepoRequest.ProtoReflect.Descriptor instead. func (*RepoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_6fa4806c90f7156d, []int{2} -} - -func (m *RepoRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RepoRequest.Unmarshal(m, b) -} -func (m *RepoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RepoRequest.Marshal(b, m, deterministic) -} -func (m *RepoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RepoRequest.Merge(m, src) -} -func (m *RepoRequest) XXX_Size() int { - return xxx_messageInfo_RepoRequest.Size(m) + return file_mock_proto_rawDescGZIP(), []int{0} } -func (m *RepoRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RepoRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_RepoRequest proto.InternalMessageInfo -func (m *RepoRequest) GetRepo() *gitalypb.Repository { - if m != nil { - return m.Repo +func (x *RepoRequest) GetRepo() *gitalypb.Repository { + if x != nil { + return x.Repo } return nil } -func init() { - proto.RegisterType((*SimpleRequest)(nil), "mock.SimpleRequest") - proto.RegisterType((*SimpleResponse)(nil), "mock.SimpleResponse") - proto.RegisterType((*RepoRequest)(nil), "mock.RepoRequest") -} +var File_mock_proto protoreflect.FileDescriptor + +var file_mock_proto_rawDesc = []byte{ + 0x0a, 0x0a, 0x6d, 0x6f, 0x63, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x6d, 0x6f, + 0x63, 0x6b, 0x1a, 0x0a, 0x6c, 0x69, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0c, + 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, + 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3b, 0x0a, 0x0b, 0x52, 0x65, 0x70, + 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x04, 0x72, 0x65, 0x70, 0x6f, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, + 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x04, 0x98, 0xc6, 0x2c, 0x01, + 0x52, 0x04, 0x72, 0x65, 0x70, 0x6f, 0x32, 0x9e, 0x01, 0x0a, 0x0d, 0x53, 0x69, 0x6d, 0x70, 0x6c, + 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x46, 0x0a, 0x11, 0x52, 0x65, 0x70, 0x6f, + 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x55, 0x6e, 0x61, 0x72, 0x79, 0x12, 0x11, 0x2e, + 0x6d, 0x6f, 0x63, 0x6b, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x02, + 0x12, 0x45, 0x0a, 0x10, 0x52, 0x65, 0x70, 0x6f, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x6f, 0x72, 0x55, + 0x6e, 0x61, 0x72, 0x79, 0x12, 0x11, 0x2e, 0x6d, 0x6f, 0x63, 0x6b, 0x2e, 0x52, 0x65, 0x70, 0x6f, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, + 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_mock_proto_rawDescOnce sync.Once + file_mock_proto_rawDescData = file_mock_proto_rawDesc +) -func init() { proto.RegisterFile("mock.proto", fileDescriptor_6fa4806c90f7156d) } - -var fileDescriptor_6fa4806c90f7156d = []byte{ - // 279 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x90, 0x41, 0x4a, 0xc3, 0x40, - 0x14, 0x86, 0x99, 0x90, 0x96, 0xf0, 0xaa, 0xa5, 0x1d, 0x8b, 0x48, 0xdc, 0x48, 0x40, 0xc9, 0xa2, - 0x4c, 0xa1, 0x2e, 0x5d, 0x29, 0xc4, 0x9d, 0x9b, 0x14, 0x0f, 0x90, 0xc6, 0x67, 0x0c, 0x26, 0x7d, - 0xe3, 0xcc, 0xa4, 0x90, 0x93, 0xd4, 0x13, 0x79, 0x13, 0x2f, 0xd1, 0x95, 0x4c, 0x86, 0x60, 0xbb, - 0xed, 0xee, 0xbd, 0x7f, 0xbe, 0xf9, 0xe7, 0x9f, 0x1f, 0xa0, 0xa6, 0xfc, 0x53, 0x48, 0x45, 0x86, - 0xb8, 0x6f, 0xe7, 0xf0, 0x4c, 0x7f, 0x64, 0x0a, 0xdf, 0x9c, 0x16, 0x5e, 0x17, 0x44, 0x45, 0x85, - 0x8b, 0x6e, 0x5b, 0x37, 0xef, 0x0b, 0xac, 0xa5, 0x69, 0xdd, 0x61, 0x74, 0x0b, 0xe7, 0xab, 0xb2, - 0x96, 0x15, 0xa6, 0xf8, 0xd5, 0xa0, 0x36, 0x7c, 0x06, 0x83, 0x6d, 0x56, 0x35, 0x78, 0xc5, 0x6e, - 0x58, 0x3c, 0x48, 0xdd, 0x12, 0xdd, 0xc1, 0xb8, 0xc7, 0xb4, 0xa4, 0x8d, 0xc6, 0x7f, 0xce, 0x3b, - 0xe4, 0x1e, 0x60, 0x94, 0xa2, 0xa4, 0xde, 0x6c, 0x0e, 0xbe, 0x42, 0x49, 0x9d, 0xd7, 0x68, 0xc9, - 0x45, 0x51, 0x9a, 0xac, 0x6a, 0x85, 0x45, 0x74, 0x69, 0x48, 0xb5, 0x4f, 0xfe, 0xf7, 0xcf, 0x9c, - 0xa5, 0x1d, 0xb5, 0xfc, 0x65, 0x7d, 0x98, 0x15, 0xaa, 0x6d, 0x99, 0x23, 0x4f, 0x60, 0x6c, 0x47, - 0x54, 0x8f, 0x79, 0x8e, 0x5a, 0x93, 0xe2, 0x17, 0xa2, 0xfb, 0xed, 0x51, 0xe6, 0x70, 0x76, 0x2c, - 0xba, 0x84, 0x51, 0xb0, 0xdf, 0xc5, 0x7e, 0xe0, 0x4d, 0x18, 0x7f, 0x86, 0xa9, 0x7d, 0xb2, 0x37, - 0x79, 0xdd, 0x64, 0xaa, 0xe5, 0x53, 0x77, 0xe9, 0x20, 0x6e, 0x78, 0x29, 0x5c, 0x55, 0xa2, 0xaf, - 0x4a, 0x24, 0xb6, 0xaa, 0x68, 0xb8, 0xdf, 0xc5, 0x5e, 0xe0, 0xf1, 0x04, 0x26, 0x16, 0x7f, 0x69, - 0x4c, 0x66, 0x4e, 0xb6, 0x61, 0xeb, 0x61, 0xa7, 0xdf, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x6a, - 0x35, 0x84, 0xac, 0xb9, 0x01, 0x00, 0x00, +func file_mock_proto_rawDescGZIP() []byte { + file_mock_proto_rawDescOnce.Do(func() { + file_mock_proto_rawDescData = protoimpl.X.CompressGZIP(file_mock_proto_rawDescData) + }) + return file_mock_proto_rawDescData +} + +var file_mock_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_mock_proto_goTypes = []interface{}{ + (*RepoRequest)(nil), // 0: mock.RepoRequest + (*gitalypb.Repository)(nil), // 1: gitaly.Repository + (*empty.Empty)(nil), // 2: google.protobuf.Empty +} +var file_mock_proto_depIdxs = []int32{ + 1, // 0: mock.RepoRequest.repo:type_name -> gitaly.Repository + 0, // 1: mock.SimpleService.RepoAccessorUnary:input_type -> mock.RepoRequest + 0, // 2: mock.SimpleService.RepoMutatorUnary:input_type -> mock.RepoRequest + 2, // 3: mock.SimpleService.RepoAccessorUnary:output_type -> google.protobuf.Empty + 2, // 4: mock.SimpleService.RepoMutatorUnary:output_type -> google.protobuf.Empty + 3, // [3:5] is the sub-list for method output_type + 1, // [1:3] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_mock_proto_init() } +func file_mock_proto_init() { + if File_mock_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_mock_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RepoRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_mock_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_mock_proto_goTypes, + DependencyIndexes: file_mock_proto_depIdxs, + MessageInfos: file_mock_proto_msgTypes, + }.Build() + File_mock_proto = out.File + file_mock_proto_rawDesc = nil + file_mock_proto_goTypes = nil + file_mock_proto_depIdxs = nil } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context -var _ grpc.ClientConn +var _ grpc.ClientConnInterface // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 +const _ = grpc.SupportPackageIsVersion6 // SimpleServiceClient is the client API for SimpleService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type SimpleServiceClient interface { - // ServerAccessor is a unary RPC that accesses a server - ServerAccessor(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error) // RepoAccessorUnary is a unary RPC that accesses a repo RepoAccessorUnary(ctx context.Context, in *RepoRequest, opts ...grpc.CallOption) (*empty.Empty, error) // RepoMutatorUnary is a unary RPC that mutates a repo @@ -195,22 +197,13 @@ type SimpleServiceClient interface { } type simpleServiceClient struct { - cc *grpc.ClientConn + cc grpc.ClientConnInterface } -func NewSimpleServiceClient(cc *grpc.ClientConn) SimpleServiceClient { +func NewSimpleServiceClient(cc grpc.ClientConnInterface) SimpleServiceClient { return &simpleServiceClient{cc} } -func (c *simpleServiceClient) ServerAccessor(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error) { - out := new(SimpleResponse) - err := c.cc.Invoke(ctx, "/mock.SimpleService/ServerAccessor", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *simpleServiceClient) RepoAccessorUnary(ctx context.Context, in *RepoRequest, opts ...grpc.CallOption) (*empty.Empty, error) { out := new(empty.Empty) err := c.cc.Invoke(ctx, "/mock.SimpleService/RepoAccessorUnary", in, out, opts...) @@ -231,8 +224,6 @@ func (c *simpleServiceClient) RepoMutatorUnary(ctx context.Context, in *RepoRequ // SimpleServiceServer is the server API for SimpleService service. type SimpleServiceServer interface { - // ServerAccessor is a unary RPC that accesses a server - ServerAccessor(context.Context, *SimpleRequest) (*SimpleResponse, error) // RepoAccessorUnary is a unary RPC that accesses a repo RepoAccessorUnary(context.Context, *RepoRequest) (*empty.Empty, error) // RepoMutatorUnary is a unary RPC that mutates a repo @@ -243,13 +234,10 @@ type SimpleServiceServer interface { type UnimplementedSimpleServiceServer struct { } -func (*UnimplementedSimpleServiceServer) ServerAccessor(ctx context.Context, req *SimpleRequest) (*SimpleResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ServerAccessor not implemented") -} -func (*UnimplementedSimpleServiceServer) RepoAccessorUnary(ctx context.Context, req *RepoRequest) (*empty.Empty, error) { +func (*UnimplementedSimpleServiceServer) RepoAccessorUnary(context.Context, *RepoRequest) (*empty.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method RepoAccessorUnary not implemented") } -func (*UnimplementedSimpleServiceServer) RepoMutatorUnary(ctx context.Context, req *RepoRequest) (*empty.Empty, error) { +func (*UnimplementedSimpleServiceServer) RepoMutatorUnary(context.Context, *RepoRequest) (*empty.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method RepoMutatorUnary not implemented") } @@ -257,24 +245,6 @@ func RegisterSimpleServiceServer(s *grpc.Server, srv SimpleServiceServer) { s.RegisterService(&_SimpleService_serviceDesc, srv) } -func _SimpleService_ServerAccessor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SimpleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SimpleServiceServer).ServerAccessor(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/mock.SimpleService/ServerAccessor", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SimpleServiceServer).ServerAccessor(ctx, req.(*SimpleRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _SimpleService_RepoAccessorUnary_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RepoRequest) if err := dec(in); err != nil { @@ -315,10 +285,6 @@ var _SimpleService_serviceDesc = grpc.ServiceDesc{ ServiceName: "mock.SimpleService", HandlerType: (*SimpleServiceServer)(nil), Methods: []grpc.MethodDesc{ - { - MethodName: "ServerAccessor", - Handler: _SimpleService_ServerAccessor_Handler, - }, { MethodName: "RepoAccessorUnary", Handler: _SimpleService_RepoAccessorUnary_Handler, diff --git a/internal/praefect/mock/mock.proto b/internal/praefect/mock/mock.proto index 8aa159efa9..4886e8779b 100644 --- a/internal/praefect/mock/mock.proto +++ b/internal/praefect/mock/mock.proto @@ -7,30 +7,15 @@ syntax = "proto3"; package mock; +import "lint.proto"; import "shared.proto"; import "google/protobuf/empty.proto"; -message SimpleRequest { - int32 value = 1; -} - -message SimpleResponse { - int32 value = 2; -} - message RepoRequest { gitaly.Repository repo = 1 [(gitaly.target_repository)=true]; } service SimpleService { - // ServerAccessor is a unary RPC that accesses a server - rpc ServerAccessor(SimpleRequest) returns (SimpleResponse) { - option (gitaly.op_type) = { - op: ACCESSOR - scope_level: SERVER - }; - } - // RepoAccessorUnary is a unary RPC that accesses a repo rpc RepoAccessorUnary(RepoRequest) returns (google.protobuf.Empty) { option (gitaly.op_type) = { diff --git a/internal/praefect/protoregistry/protoregistry.go b/internal/praefect/protoregistry/protoregistry.go index 646cf2f311..1095535a84 100644 --- a/internal/praefect/protoregistry/protoregistry.go +++ b/internal/praefect/protoregistry/protoregistry.go @@ -10,6 +10,7 @@ import ( "github.com/golang/protobuf/proto" "github.com/golang/protobuf/protoc-gen-go/descriptor" + "gitlab.com/gitlab-org/gitaly/internal/praefect/protoregistry/protoutil" "gitlab.com/gitlab-org/gitaly/proto/go/gitalypb" ) @@ -174,7 +175,7 @@ func New(protos ...*descriptor.FileDescriptorProto) (*Registry, error) { for _, p := range protos { for _, svc := range p.GetService() { - if intercepted, err := IsIntercepted(svc); err != nil { + if intercepted, err := protoutil.IsIntercepted(svc); err != nil { return nil, fmt.Errorf("is intercepted: %w", err) } else if intercepted { continue @@ -296,8 +297,8 @@ func parseMethodInfo(p *descriptor.FileDescriptorProto, methodDesc *descriptor.M if scope == ScopeRepository { m := matcher{ - match: GetTargetRepositoryExtension, - subMatch: GetRepositoryExtension, + match: protoutil.GetTargetRepositoryExtension, + subMatch: protoutil.GetRepositoryExtension, expectedType: ".gitaly.Repository", topLevelMsgs: topLevelMsgs, } @@ -319,7 +320,7 @@ func parseMethodInfo(p *descriptor.FileDescriptorProto, methodDesc *descriptor.M mi.additionalRepo = additionalRepo } else if scope == ScopeStorage { m := matcher{ - match: GetStorageExtension, + match: protoutil.GetStorageExtension, topLevelMsgs: topLevelMsgs, } storage, err := m.findField(topLevelMsgs[typeName]) @@ -366,49 +367,8 @@ func getTopLevelMsgs(p *descriptor.FileDescriptorProto) (map[string]*descriptor. return topLevelMsgs, nil } -func IsIntercepted(s *descriptor.ServiceDescriptorProto) (bool, error) { - return getBoolExtension(s.GetOptions(), gitalypb.E_Intercepted) -} - -// GetStorageExtension gets the storage extension from a field descriptor -func GetStorageExtension(m *descriptor.FieldDescriptorProto) (bool, error) { - return getBoolExtension(m.GetOptions(), gitalypb.E_Storage) -} - -// GetTargetRepositoryExtension gets the target_repository extension from a field descriptor -func GetTargetRepositoryExtension(m *descriptor.FieldDescriptorProto) (bool, error) { - return getBoolExtension(m.GetOptions(), gitalypb.E_TargetRepository) -} - func getAdditionalRepositoryExtension(m *descriptor.FieldDescriptorProto) (bool, error) { - return getBoolExtension(m, gitalypb.E_AdditionalRepository) -} - -// GetRepositoryExtension gets the repository extension from a field descriptor -func GetRepositoryExtension(m *descriptor.FieldDescriptorProto) (bool, error) { - return getBoolExtension(m.GetOptions(), gitalypb.E_Repository) -} - -func getBoolExtension(options proto.Message, extension *proto.ExtensionDesc) (bool, error) { - if !proto.HasExtension(options, extension) { - return false, nil - } - - ext, err := proto.GetExtension(options, extension) - if err != nil { - return false, err - } - - storageMsg, ok := ext.(*bool) - if !ok { - return false, fmt.Errorf("unable to obtain bool from %#v", ext) - } - - if storageMsg == nil { - return false, nil - } - - return *storageMsg, nil + return protoutil.GetBoolExtension(m, gitalypb.E_AdditionalRepository) } // Matcher helps find field matching credentials. At first match method is used to check fields diff --git a/internal/praefect/protoregistry/protoregistry_test.go b/internal/praefect/protoregistry/protoregistry_test.go index b9e8e8174c..28afa36f00 100644 --- a/internal/praefect/protoregistry/protoregistry_test.go +++ b/internal/praefect/protoregistry/protoregistry_test.go @@ -151,9 +151,6 @@ func TestNewProtoRegistry(t *testing.T) { "BackupCustomHooks": protoregistry.OpAccessor, "FetchHTTPRemote": protoregistry.OpMutator, }, - "ServerService": map[string]protoregistry.OpType{ - "ServerInfo": protoregistry.OpAccessor, - }, "SmartHTTPService": map[string]protoregistry.OpType{ "InfoRefsUploadPack": protoregistry.OpAccessor, "InfoRefsReceivePack": protoregistry.OpAccessor, diff --git a/internal/praefect/protoregistry/protoutil/util.go b/internal/praefect/protoregistry/protoutil/util.go new file mode 100644 index 0000000000..8979bf131a --- /dev/null +++ b/internal/praefect/protoregistry/protoutil/util.go @@ -0,0 +1,54 @@ +package protoutil + +import ( + "fmt" + + "github.com/golang/protobuf/proto" + "github.com/golang/protobuf/protoc-gen-go/descriptor" + "gitlab.com/gitlab-org/gitaly/proto/go/gitalypb" +) + +func IsIntercepted(s *descriptor.ServiceDescriptorProto) (bool, error) { + return GetBoolExtension(s.GetOptions(), gitalypb.E_Intercepted) +} + +// GetStorageExtension gets the storage extension from a field descriptor +func GetStorageExtension(m *descriptor.FieldDescriptorProto) (bool, error) { + return GetBoolExtension(m.GetOptions(), gitalypb.E_Storage) +} + +// GetTargetRepositoryExtension gets the target_repository extension from a field descriptor +func GetTargetRepositoryExtension(m *descriptor.FieldDescriptorProto) (bool, error) { + return GetBoolExtension(m.GetOptions(), gitalypb.E_TargetRepository) +} + +func getAdditionalRepositoryExtension(m *descriptor.FieldDescriptorProto) (bool, error) { + return GetBoolExtension(m, gitalypb.E_AdditionalRepository) +} + +// GetRepositoryExtension gets the repository extension from a field descriptor +func GetRepositoryExtension(m *descriptor.FieldDescriptorProto) (bool, error) { + return GetBoolExtension(m.GetOptions(), gitalypb.E_Repository) +} + +func GetBoolExtension(options proto.Message, extension *proto.ExtensionDesc) (bool, error) { + if !proto.HasExtension(options, extension) { + return false, nil + } + + ext, err := proto.GetExtension(options, extension) + if err != nil { + return false, err + } + + storageMsg, ok := ext.(*bool) + if !ok { + return false, fmt.Errorf("unable to obtain bool from %#v", ext) + } + + if storageMsg == nil { + return false, nil + } + + return *storageMsg, nil +} diff --git a/proto/go/internal/linter/lint.go b/proto/go/internal/linter/lint.go index ff6bc476ad..9cfbd68dce 100644 --- a/proto/go/internal/linter/lint.go +++ b/proto/go/internal/linter/lint.go @@ -6,7 +6,7 @@ import ( "github.com/golang/protobuf/protoc-gen-go/descriptor" plugin "github.com/golang/protobuf/protoc-gen-go/plugin" - "gitlab.com/gitlab-org/gitaly/internal/praefect/protoregistry" + "gitlab.com/gitlab-org/gitaly/internal/praefect/protoregistry/protoutil" "gitlab.com/gitlab-org/gitaly/proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/proto/go/internal" ) @@ -54,7 +54,7 @@ func LintFile(file *descriptor.FileDescriptorProto, req *plugin.CodeGeneratorReq var errs []error for _, serviceDescriptorProto := range file.GetService() { - if intercepted, err := protoregistry.IsIntercepted(serviceDescriptorProto); err != nil { + if intercepted, err := protoutil.IsIntercepted(serviceDescriptorProto); err != nil { errs = append(errs, fmt.Errorf("%s: Service %q: %s", file.GetName(), serviceDescriptorProto.GetName(), err)) continue } else if intercepted { diff --git a/proto/go/internal/linter/method.go b/proto/go/internal/linter/method.go index bff9846895..4099d53d4d 100644 --- a/proto/go/internal/linter/method.go +++ b/proto/go/internal/linter/method.go @@ -7,7 +7,7 @@ import ( "github.com/golang/protobuf/protoc-gen-go/descriptor" plugin "github.com/golang/protobuf/protoc-gen-go/plugin" - "gitlab.com/gitlab-org/gitaly/internal/praefect/protoregistry" + "gitlab.com/gitlab-org/gitaly/internal/praefect/protoregistry/protoutil" "gitlab.com/gitlab-org/gitaly/proto/go/gitalypb" ) @@ -74,7 +74,7 @@ func (ml methodLinter) ensureValidStorage(expected int) error { msgT := topLevelMsgs[reqMsgName] m := matcher{ - match: protoregistry.GetStorageExtension, + match: protoutil.GetStorageExtension, subMatch: nil, expectedType: "", topLevelMsgs: topLevelMsgs, @@ -106,8 +106,8 @@ func (ml methodLinter) ensureValidTargetRepository(expected int) error { msgT := topLevelMsgs[reqMsgName] m := matcher{ - match: protoregistry.GetTargetRepositoryExtension, - subMatch: protoregistry.GetRepositoryExtension, + match: protoutil.GetTargetRepositoryExtension, + subMatch: protoutil.GetRepositoryExtension, expectedType: ".gitaly.Repository", topLevelMsgs: topLevelMsgs, } -- GitLab