Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2022-05-02 10:39:20 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2022-05-06 11:44:31 +0300
commitba661eea55984bd4ab0c00f15c2dfa07efb07cb7 (patch)
treeb6231a2ca5a91507c7f291877ae6fbba76963ca9 /tools
parent1466804c6e8e1cd5e237349998e0fca370ca3855 (diff)
tools: Move Protoc plugins into top-level `tools/` directory
The Protoc plugins we use are hidden away deep into the `proto/` directory, which makes it very hard to discover them when one doesn't already know about their existence. Let's move them into a new top-level `tools/` directory.
Diffstat (limited to 'tools')
-rw-r--r--tools/protoc-gen-gitaly-lint/lint.go94
-rw-r--r--tools/protoc-gen-gitaly-lint/lint_test.go79
-rw-r--r--tools/protoc-gen-gitaly-lint/main.go107
-rw-r--r--tools/protoc-gen-gitaly-lint/method.go262
-rw-r--r--tools/protoc-gen-gitaly-lint/testdata/invalid.pb.go1272
-rw-r--r--tools/protoc-gen-gitaly-lint/testdata/invalid.proto213
-rw-r--r--tools/protoc-gen-gitaly-lint/testdata/invalid_grpc.pb.go974
-rw-r--r--tools/protoc-gen-gitaly-lint/testdata/valid.pb.go890
-rw-r--r--tools/protoc-gen-gitaly-lint/testdata/valid.proto148
-rw-r--r--tools/protoc-gen-gitaly-lint/testdata/valid_grpc.pb.go657
-rw-r--r--tools/protoc-gen-gitaly-protolist/main.go139
11 files changed, 4835 insertions, 0 deletions
diff --git a/tools/protoc-gen-gitaly-lint/lint.go b/tools/protoc-gen-gitaly-lint/lint.go
new file mode 100644
index 000000000..901c22946
--- /dev/null
+++ b/tools/protoc-gen-gitaly-lint/lint.go
@@ -0,0 +1,94 @@
+package main
+
+import (
+ "errors"
+ "fmt"
+
+ "gitlab.com/gitlab-org/gitaly/v14/internal/protoutil"
+ "gitlab.com/gitlab-org/gitaly/v14/proto/go/gitalypb"
+ "google.golang.org/protobuf/reflect/protoregistry"
+ "google.golang.org/protobuf/types/descriptorpb"
+ "google.golang.org/protobuf/types/pluginpb"
+)
+
+// ensureMethodOpType will ensure that method includes the op_type option.
+// See proto example below:
+//
+// rpc ExampleMethod(ExampleMethodRequest) returns (ExampleMethodResponse) {
+// option (op_type).op = ACCESSOR;
+// }
+func ensureMethodOpType(fileDesc *descriptorpb.FileDescriptorProto, m *descriptorpb.MethodDescriptorProto, req *pluginpb.CodeGeneratorRequest) error {
+ opMsg, err := protoutil.GetOpExtension(m)
+ if err != nil {
+ if errors.Is(err, protoregistry.NotFound) {
+ return fmt.Errorf("missing op_type extension")
+ }
+
+ return err
+ }
+
+ ml := methodLinter{
+ req: req,
+ fileDesc: fileDesc,
+ methodDesc: m,
+ opMsg: opMsg,
+ }
+
+ switch opCode := opMsg.GetOp(); opCode {
+
+ case gitalypb.OperationMsg_ACCESSOR:
+ return ml.validateAccessor()
+
+ case gitalypb.OperationMsg_MUTATOR:
+ // if mutator, we need to make sure we specify scope or target repo
+ return ml.validateMutator()
+
+ case gitalypb.OperationMsg_MAINTENANCE:
+ return ml.validateMaintenance()
+
+ case gitalypb.OperationMsg_UNKNOWN:
+ return errors.New("op set to UNKNOWN")
+
+ default:
+ return fmt.Errorf("invalid operation class with int32 value of %d", opCode)
+ }
+}
+
+func validateMethod(file *descriptorpb.FileDescriptorProto, service *descriptorpb.ServiceDescriptorProto, method *descriptorpb.MethodDescriptorProto, req *pluginpb.CodeGeneratorRequest) error {
+ if intercepted, err := protoutil.IsInterceptedMethod(service, method); err != nil {
+ return fmt.Errorf("is intercepted method: %w", err)
+ } else if intercepted {
+ if _, err := protoutil.GetOpExtension(method); err != nil {
+ if errors.Is(err, protoregistry.NotFound) {
+ return nil
+ }
+
+ return err
+ }
+
+ return fmt.Errorf("operation type defined on an intercepted method")
+ }
+
+ return ensureMethodOpType(file, method, req)
+}
+
+// LintFile ensures the file described meets Gitaly required processes.
+// Currently, this is limited to validating if request messages contain
+// a mandatory operation code.
+func LintFile(file *descriptorpb.FileDescriptorProto, req *pluginpb.CodeGeneratorRequest) []error {
+ var errs []error
+
+ for _, service := range file.GetService() {
+ for _, method := range service.GetMethod() {
+ if err := validateMethod(file, service, method, req); err != nil {
+ errs = append(errs, formatError(file.GetName(), service.GetName(), method.GetName(), err))
+ }
+ }
+ }
+
+ return errs
+}
+
+func formatError(file, service, method string, err error) error {
+ return fmt.Errorf("%s: service %q: method: %q: %w", file, service, method, err)
+}
diff --git a/tools/protoc-gen-gitaly-lint/lint_test.go b/tools/protoc-gen-gitaly-lint/lint_test.go
new file mode 100644
index 000000000..68a8424a4
--- /dev/null
+++ b/tools/protoc-gen-gitaly-lint/lint_test.go
@@ -0,0 +1,79 @@
+package main
+
+import (
+ "errors"
+ "testing"
+
+ "github.com/stretchr/testify/require"
+ _ "gitlab.com/gitlab-org/gitaly/v14/tools/protoc-gen-gitaly-lint/testdata"
+ "google.golang.org/protobuf/reflect/protodesc"
+ protoreg "google.golang.org/protobuf/reflect/protoregistry"
+ "google.golang.org/protobuf/types/descriptorpb"
+ "google.golang.org/protobuf/types/pluginpb"
+)
+
+func TestLintFile(t *testing.T) {
+ for _, tt := range []struct {
+ protoPath string
+ errs []error
+ }{
+ {
+ protoPath: "protoc-gen-gitaly-lint/testdata/valid.proto",
+ errs: nil,
+ },
+ {
+ protoPath: "protoc-gen-gitaly-lint/testdata/invalid.proto",
+ errs: []error{
+ formatError("protoc-gen-gitaly-lint/testdata/invalid.proto", "InterceptedWithOperationType", "InvalidMethod", errors.New("operation type defined on an intercepted method")),
+ formatError("protoc-gen-gitaly-lint/testdata/invalid.proto", "InvalidService", "InvalidMethod0", errors.New("missing op_type extension")),
+ formatError("protoc-gen-gitaly-lint/testdata/invalid.proto", "InvalidService", "InvalidMethod1", errors.New("op set to UNKNOWN")),
+ formatError("protoc-gen-gitaly-lint/testdata/invalid.proto", "InvalidService", "InvalidMethod2", errors.New("unexpected count of target_repository fields 0, expected 1, found target_repository label at: []")),
+ formatError("protoc-gen-gitaly-lint/testdata/invalid.proto", "InvalidService", "InvalidMethod4", errors.New("unexpected count of target_repository fields 0, expected 1, found target_repository label at: []")),
+ formatError("protoc-gen-gitaly-lint/testdata/invalid.proto", "InvalidService", "InvalidMethod5", errors.New("wrong type of field RequestWithWrongTypeRepository.header.repository, expected .gitaly.Repository, got .test.InvalidMethodResponse")),
+ formatError("protoc-gen-gitaly-lint/testdata/invalid.proto", "InvalidService", "InvalidMethod6", errors.New("unexpected count of target_repository fields 0, expected 1, found target_repository label at: []")),
+ formatError("protoc-gen-gitaly-lint/testdata/invalid.proto", "InvalidService", "InvalidMethod7", errors.New("unexpected count of target_repository fields 0, expected 1, found target_repository label at: []")),
+ formatError("protoc-gen-gitaly-lint/testdata/invalid.proto", "InvalidService", "InvalidMethod8", errors.New("unexpected count of target_repository fields 0, expected 1, found target_repository label at: []")),
+ formatError("protoc-gen-gitaly-lint/testdata/invalid.proto", "InvalidService", "InvalidMethod9", errors.New("unexpected count of target_repository fields 1, expected 0, found target_repository label at: [InvalidMethodRequestWithRepo.destination]")),
+ formatError("protoc-gen-gitaly-lint/testdata/invalid.proto", "InvalidService", "InvalidMethod10", errors.New("unexpected count of storage field 1, expected 0, found storage label at: [RequestWithStorageAndRepo.storage_name]")),
+ formatError("protoc-gen-gitaly-lint/testdata/invalid.proto", "InvalidService", "InvalidMethod11", errors.New("unexpected count of storage field 1, expected 0, found storage label at: [RequestWithNestedStorageAndRepo.inner_message.storage_name]")),
+ formatError("protoc-gen-gitaly-lint/testdata/invalid.proto", "InvalidService", "InvalidMethod13", errors.New("unexpected count of storage field 0, expected 1, found storage label at: []")),
+ formatError("protoc-gen-gitaly-lint/testdata/invalid.proto", "InvalidService", "InvalidMethod14", errors.New("unexpected count of storage field 2, expected 1, found storage label at: [RequestWithMultipleNestedStorage.inner_message.storage_name RequestWithMultipleNestedStorage.storage_name]")),
+ formatError("protoc-gen-gitaly-lint/testdata/invalid.proto", "InvalidService", "InvalidMethod15", errors.New("operation type defined on an intercepted method")),
+ formatError("protoc-gen-gitaly-lint/testdata/invalid.proto", "InvalidService", "MaintenanceWithMissingRepository", errors.New("unexpected count of target_repository fields 0, expected 1, found target_repository label at: []")),
+ formatError("protoc-gen-gitaly-lint/testdata/invalid.proto", "InvalidService", "MaintenanceWithUnflaggedRepository", errors.New("unexpected count of target_repository fields 0, expected 1, found target_repository label at: []")),
+ formatError("protoc-gen-gitaly-lint/testdata/invalid.proto", "InvalidService", "MaintenanceWithWrongNestedRepositoryType", errors.New("wrong type of field RequestWithWrongTypeRepository.header.repository, expected .gitaly.Repository, got .test.InvalidMethodResponse")),
+ formatError("protoc-gen-gitaly-lint/testdata/invalid.proto", "InvalidService", "MaintenanceWithInvalidTargetType", errors.New("unexpected count of target_repository fields 0, expected 1, found target_repository label at: []")),
+ formatError("protoc-gen-gitaly-lint/testdata/invalid.proto", "InvalidService", "MaintenanceWithInvalidNestedRequest", errors.New("unexpected count of target_repository fields 0, expected 1, found target_repository label at: []")),
+ formatError("protoc-gen-gitaly-lint/testdata/invalid.proto", "InvalidService", "MaintenanceWithStorageAndRepository", errors.New("unexpected count of storage field 1, expected 0, found storage label at: [RequestWithStorageAndRepo.storage_name]")),
+ formatError("protoc-gen-gitaly-lint/testdata/invalid.proto", "InvalidService", "MaintenanceWithNestedStorageAndRepository", errors.New("unexpected count of storage field 1, expected 0, found storage label at: [RequestWithNestedStorageAndRepo.inner_message.storage_name]")),
+ formatError("protoc-gen-gitaly-lint/testdata/invalid.proto", "InvalidService", "MaintenanceWithStorageScope", errors.New("unknown operation scope level 2")),
+ },
+ },
+ } {
+ t.Run(tt.protoPath, func(t *testing.T) {
+ fd, err := protoreg.GlobalFiles.FindFileByPath(tt.protoPath)
+ require.NoError(t, err)
+
+ fdToCheck := protodesc.ToFileDescriptorProto(fd)
+ req := &pluginpb.CodeGeneratorRequest{
+ ProtoFile: []*descriptorpb.FileDescriptorProto{fdToCheck},
+ }
+
+ for _, protoPath := range []string{
+ // as we have no input stream we can use to create CodeGeneratorRequest
+ // we must create it by hands with all required dependencies loaded
+ "google/protobuf/descriptor.proto",
+ "google/protobuf/timestamp.proto",
+ "lint.proto",
+ "shared.proto",
+ } {
+ fd, err := protoreg.GlobalFiles.FindFileByPath(protoPath)
+ require.NoError(t, err)
+ req.ProtoFile = append(req.ProtoFile, protodesc.ToFileDescriptorProto(fd))
+ }
+
+ errs := LintFile(fdToCheck, req)
+ require.Equal(t, tt.errs, errs)
+ })
+ }
+}
diff --git a/tools/protoc-gen-gitaly-lint/main.go b/tools/protoc-gen-gitaly-lint/main.go
new file mode 100644
index 000000000..be7de808b
--- /dev/null
+++ b/tools/protoc-gen-gitaly-lint/main.go
@@ -0,0 +1,107 @@
+// Command protoc-gen-gitaly-lint is designed to be used as a protobuf compiler
+// plugin to verify Gitaly processes are being followed when writing RPC's.
+//
+// Usage
+//
+// The protoc-gen-gitaly linter can be chained into any protoc workflow that
+// requires verification that Gitaly RPC guidelines are followed. Typically
+// this can be done by adding the following argument to an existing protoc
+// command:
+//
+// --gitaly_lint_out=.
+//
+// For example, you may add the linter as an argument to the command responsible
+// for generating Go code:
+//
+// protoc --go_out=. --gitaly_lint_out=. *.proto
+//
+// Or, you can run the Gitaly linter by itself. To try out, run the following
+// command while in the project root:
+//
+// protoc --gitaly_lint_out=. ./go/internal/cmd/protoc-gen-gitaly-lint/testdata/incomplete.proto
+//
+// You should see some errors printed to screen for improperly written
+// RPC's in the incomplete.proto file.
+//
+// Prerequisites
+//
+// The protobuf compiler (protoc) can be obtained from the GitHub page:
+// https://github.com/protocolbuffers/protobuf/releases
+//
+// Background
+//
+// The protobuf compiler accepts plugins to analyze protobuf files and generate
+// language specific code.
+//
+// These plugins require the following executable naming convention:
+//
+// protoc-gen-$NAME
+//
+// Where $NAME is the plugin name of the compiler desired. The protobuf compiler
+// will search the PATH until an executable with that name is found for a
+// desired plugin. For example, the following protoc command:
+//
+// protoc --gitaly_lint_out=. *.proto
+//
+// The above will search the PATH for an executable named protoc-gen-gitaly-lint
+//
+// The plugin accepts a protobuf message in STDIN that describes the parsed
+// protobuf files. A response is sent back on STDOUT that contains any errors.
+package main
+
+import (
+ "fmt"
+ "io"
+ "log"
+ "os"
+ "strings"
+
+ "google.golang.org/protobuf/proto"
+ "google.golang.org/protobuf/types/pluginpb"
+)
+
+func main() {
+ data, err := io.ReadAll(os.Stdin)
+ if err != nil {
+ log.Fatalf("reading input: %s", err)
+ }
+
+ req := &pluginpb.CodeGeneratorRequest{}
+
+ if err := proto.Unmarshal(data, req); err != nil {
+ log.Fatalf("parsing input proto: %s", err)
+ }
+
+ if err := lintProtos(req); err != nil {
+ log.Fatal(err)
+ }
+}
+
+func lintProtos(req *pluginpb.CodeGeneratorRequest) error {
+ var errMsgs []string
+ for _, pf := range req.GetProtoFile() {
+ errs := LintFile(pf, req)
+ for _, err := range errs {
+ errMsgs = append(errMsgs, err.Error())
+ }
+ }
+
+ resp := &pluginpb.CodeGeneratorResponse{}
+
+ if len(errMsgs) > 0 {
+ errMsg := strings.Join(errMsgs, "\n\t")
+ resp.Error = &errMsg
+ }
+
+ // Send back the results.
+ data, err := proto.Marshal(resp)
+ if err != nil {
+ return fmt.Errorf("failed to marshal output proto: %s", err)
+ }
+
+ _, err = os.Stdout.Write(data)
+ if err != nil {
+ return fmt.Errorf("failed to write output proto: %s", err)
+ }
+ return nil
+}
diff --git a/tools/protoc-gen-gitaly-lint/method.go b/tools/protoc-gen-gitaly-lint/method.go
new file mode 100644
index 000000000..b1f5c7282
--- /dev/null
+++ b/tools/protoc-gen-gitaly-lint/method.go
@@ -0,0 +1,262 @@
+package main
+
+import (
+ "errors"
+ "fmt"
+ "strings"
+
+ "gitlab.com/gitlab-org/gitaly/v14/internal/protoutil"
+ "gitlab.com/gitlab-org/gitaly/v14/proto/go/gitalypb"
+ "google.golang.org/protobuf/types/descriptorpb"
+ "google.golang.org/protobuf/types/pluginpb"
+)
+
+type methodLinter struct {
+ req *pluginpb.CodeGeneratorRequest
+ fileDesc *descriptorpb.FileDescriptorProto
+ methodDesc *descriptorpb.MethodDescriptorProto
+ opMsg *gitalypb.OperationMsg
+}
+
+// validateAccessor will ensure the accessor method does not specify a target
+// repo
+func (ml methodLinter) validateAccessor() error {
+ switch ml.opMsg.GetScopeLevel() {
+ case gitalypb.OperationMsg_REPOSITORY:
+ return ml.ensureValidRepoScope()
+ case gitalypb.OperationMsg_STORAGE:
+ return ml.ensureValidStorageScope()
+ }
+
+ return nil
+}
+
+// validateMutator will ensure the following rules:
+// - Mutator RPC's with repository level scope must specify a target repo
+// - 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_STORAGE:
+ return ml.ensureValidStorageScope()
+
+ default:
+ return fmt.Errorf("unknown operation scope level %d", scope)
+
+ }
+}
+
+// validateMaintenance ensures that the message is repository-scoped and that it's got a target
+// repository.
+func (ml methodLinter) validateMaintenance() error {
+ switch scope := ml.opMsg.GetScopeLevel(); scope {
+ case gitalypb.OperationMsg_REPOSITORY:
+ return ml.ensureValidRepoScope()
+ default:
+ return fmt.Errorf("unknown operation scope level %d", scope)
+ }
+}
+
+func (ml methodLinter) ensureValidStorageScope() error {
+ if err := ml.ensureValidTargetRepository(0); err != nil {
+ return err
+ }
+
+ return ml.ensureValidStorage(1)
+}
+
+func (ml methodLinter) ensureValidRepoScope() error {
+ if err := ml.ensureValidTargetRepository(1); err != nil {
+ return err
+ }
+ return ml.ensureValidStorage(0)
+}
+
+func (ml methodLinter) ensureValidStorage(expected int) error {
+ topLevelMsgs, err := ml.getTopLevelMsgs()
+ if err != nil {
+ return err
+ }
+
+ reqMsgName, err := lastName(ml.methodDesc.GetInputType())
+ if err != nil {
+ return err
+ }
+
+ msgT := topLevelMsgs[reqMsgName]
+
+ m := matcher{
+ match: protoutil.GetStorageExtension,
+ subMatch: nil,
+ expectedType: "",
+ topLevelMsgs: topLevelMsgs,
+ }
+
+ storageFields, err := m.findMatchingFields(reqMsgName, msgT)
+ if err != nil {
+ return err
+ }
+
+ if len(storageFields) != expected {
+ return fmt.Errorf("unexpected count of storage field %d, expected %d, found storage label at: %v", len(storageFields), expected, storageFields)
+ }
+
+ return nil
+}
+
+func (ml methodLinter) ensureValidTargetRepository(expected int) error {
+ topLevelMsgs, err := ml.getTopLevelMsgs()
+ if err != nil {
+ return err
+ }
+
+ reqMsgName, err := lastName(ml.methodDesc.GetInputType())
+ if err != nil {
+ return err
+ }
+
+ msgT := topLevelMsgs[reqMsgName]
+
+ m := matcher{
+ match: protoutil.GetTargetRepositoryExtension,
+ subMatch: protoutil.GetRepositoryExtension,
+ expectedType: ".gitaly.Repository",
+ topLevelMsgs: topLevelMsgs,
+ }
+
+ storageFields, err := m.findMatchingFields(reqMsgName, msgT)
+ if err != nil {
+ return err
+ }
+
+ if len(storageFields) != expected {
+ return fmt.Errorf("unexpected count of target_repository fields %d, expected %d, found target_repository label at: %v", len(storageFields), expected, storageFields)
+ }
+
+ return nil
+}
+
+func (ml methodLinter) getTopLevelMsgs() (map[string]*descriptorpb.DescriptorProto, error) {
+ topLevelMsgs := map[string]*descriptorpb.DescriptorProto{}
+
+ types, err := getFileTypes(ml.fileDesc.GetName(), ml.req)
+ if err != nil {
+ return nil, err
+ }
+ for _, msg := range types {
+ topLevelMsgs[msg.GetName()] = msg
+ }
+ return topLevelMsgs, nil
+}
+
+type matcher struct {
+ match func(*descriptorpb.FieldDescriptorProto) (bool, error)
+ subMatch func(*descriptorpb.FieldDescriptorProto) (bool, error)
+ expectedType string
+ topLevelMsgs map[string]*descriptorpb.DescriptorProto
+}
+
+func (m matcher) findMatchingFields(prefix string, t *descriptorpb.DescriptorProto) ([]string, error) {
+ var storageFields []string
+ for _, f := range t.GetField() {
+ subMatcher := m
+ fullName := prefix + "." + f.GetName()
+
+ match, err := m.match(f)
+ if err != nil {
+ return nil, err
+ }
+
+ if match {
+ if f.GetTypeName() == m.expectedType {
+ storageFields = append(storageFields, fullName)
+ continue
+ } else if m.subMatch == nil {
+ return nil, fmt.Errorf("wrong type of field %s, expected %s, got %s", fullName, m.expectedType, f.GetTypeName())
+ } else {
+ subMatcher.match = m.subMatch
+ subMatcher.subMatch = nil
+ }
+ }
+
+ childMsg, err := findChildMsg(m.topLevelMsgs, t, f)
+ if err != nil {
+ return nil, err
+ }
+
+ if childMsg != nil {
+ nestedStorageFields, err := subMatcher.findMatchingFields(fullName, childMsg)
+ if err != nil {
+ return nil, err
+ }
+ storageFields = append(storageFields, nestedStorageFields...)
+ }
+
+ }
+ return storageFields, nil
+}
+
+func findChildMsg(topLevelMsgs map[string]*descriptorpb.DescriptorProto, t *descriptorpb.DescriptorProto, f *descriptorpb.FieldDescriptorProto) (*descriptorpb.DescriptorProto, error) {
+ var childType *descriptorpb.DescriptorProto
+ const msgPrimitive = "TYPE_MESSAGE"
+ if primitive := f.GetType().String(); primitive != msgPrimitive {
+ return nil, nil
+ }
+
+ msgName, err := lastName(f.GetTypeName())
+ if err != nil {
+ return nil, err
+ }
+
+ for _, nestedType := range t.GetNestedType() {
+ if msgName == nestedType.GetName() {
+ return nestedType, nil
+ }
+ }
+
+ if childType = topLevelMsgs[msgName]; childType != nil {
+ return childType, nil
+ }
+
+ return nil, fmt.Errorf("could not find message type %q", msgName)
+}
+
+func getFileTypes(filename string, req *pluginpb.CodeGeneratorRequest) ([]*descriptorpb.DescriptorProto, error) {
+ var types []*descriptorpb.DescriptorProto
+ var protoFile *descriptorpb.FileDescriptorProto
+ for _, pf := range req.ProtoFile {
+ if pf.Name != nil && *pf.Name == filename {
+ types = pf.GetMessageType()
+ protoFile = pf
+ break
+ }
+ }
+
+ if protoFile == nil {
+ return nil, errors.New("proto file could not be found: " + filename)
+ }
+
+ for _, dep := range protoFile.Dependency {
+ depTypes, err := getFileTypes(dep, req)
+ if err != nil {
+ return nil, err
+ }
+ types = append(types, depTypes...)
+ }
+
+ return types, nil
+}
+
+func lastName(inputType string) (string, error) {
+ tokens := strings.Split(inputType, ".")
+
+ msgName := tokens[len(tokens)-1]
+ if msgName == "" {
+ return "", fmt.Errorf("unable to parse method input type: %s", inputType)
+ }
+
+ return msgName, nil
+}
diff --git a/tools/protoc-gen-gitaly-lint/testdata/invalid.pb.go b/tools/protoc-gen-gitaly-lint/testdata/invalid.pb.go
new file mode 100644
index 000000000..6ab6f2aaa
--- /dev/null
+++ b/tools/protoc-gen-gitaly-lint/testdata/invalid.pb.go
@@ -0,0 +1,1272 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.26.0
+// protoc v3.17.3
+// source: protoc-gen-gitaly-lint/testdata/invalid.proto
+
+package testdata
+
+import (
+ gitalypb "gitlab.com/gitlab-org/gitaly/v14/proto/go/gitalypb"
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+ reflect "reflect"
+ sync "sync"
+)
+
+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)
+)
+
+type InvalidMethodRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+}
+
+func (x *InvalidMethodRequest) Reset() {
+ *x = InvalidMethodRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *InvalidMethodRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*InvalidMethodRequest) ProtoMessage() {}
+
+func (x *InvalidMethodRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_protoc_gen_gitaly_lint_testdata_invalid_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 mi.MessageOf(x)
+}
+
+// Deprecated: Use InvalidMethodRequest.ProtoReflect.Descriptor instead.
+func (*InvalidMethodRequest) Descriptor() ([]byte, []int) {
+ return file_protoc_gen_gitaly_lint_testdata_invalid_proto_rawDescGZIP(), []int{0}
+}
+
+type InvalidMethodRequestWithRepo struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Destination *gitalypb.Repository `protobuf:"bytes,1,opt,name=destination,proto3" json:"destination,omitempty"`
+}
+
+func (x *InvalidMethodRequestWithRepo) Reset() {
+ *x = InvalidMethodRequestWithRepo{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *InvalidMethodRequestWithRepo) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*InvalidMethodRequestWithRepo) ProtoMessage() {}
+
+func (x *InvalidMethodRequestWithRepo) ProtoReflect() protoreflect.Message {
+ mi := &file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[1]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use InvalidMethodRequestWithRepo.ProtoReflect.Descriptor instead.
+func (*InvalidMethodRequestWithRepo) Descriptor() ([]byte, []int) {
+ return file_protoc_gen_gitaly_lint_testdata_invalid_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *InvalidMethodRequestWithRepo) GetDestination() *gitalypb.Repository {
+ if x != nil {
+ return x.Destination
+ }
+ return nil
+}
+
+type InvalidTargetType struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ WrongType int32 `protobuf:"varint,1,opt,name=wrong_type,json=wrongType,proto3" json:"wrong_type,omitempty"`
+}
+
+func (x *InvalidTargetType) Reset() {
+ *x = InvalidTargetType{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[2]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *InvalidTargetType) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*InvalidTargetType) ProtoMessage() {}
+
+func (x *InvalidTargetType) ProtoReflect() protoreflect.Message {
+ mi := &file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[2]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use InvalidTargetType.ProtoReflect.Descriptor instead.
+func (*InvalidTargetType) Descriptor() ([]byte, []int) {
+ return file_protoc_gen_gitaly_lint_testdata_invalid_proto_rawDescGZIP(), []int{2}
+}
+
+func (x *InvalidTargetType) GetWrongType() int32 {
+ if x != nil {
+ return x.WrongType
+ }
+ return 0
+}
+
+type InvalidMethodResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+}
+
+func (x *InvalidMethodResponse) Reset() {
+ *x = InvalidMethodResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[3]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *InvalidMethodResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*InvalidMethodResponse) ProtoMessage() {}
+
+func (x *InvalidMethodResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[3]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use InvalidMethodResponse.ProtoReflect.Descriptor instead.
+func (*InvalidMethodResponse) Descriptor() ([]byte, []int) {
+ return file_protoc_gen_gitaly_lint_testdata_invalid_proto_rawDescGZIP(), []int{3}
+}
+
+type InvalidNestedRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ InnerMessage *InvalidTargetType `protobuf:"bytes,1,opt,name=inner_message,json=innerMessage,proto3" json:"inner_message,omitempty"`
+}
+
+func (x *InvalidNestedRequest) Reset() {
+ *x = InvalidNestedRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[4]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *InvalidNestedRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*InvalidNestedRequest) ProtoMessage() {}
+
+func (x *InvalidNestedRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[4]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use InvalidNestedRequest.ProtoReflect.Descriptor instead.
+func (*InvalidNestedRequest) Descriptor() ([]byte, []int) {
+ return file_protoc_gen_gitaly_lint_testdata_invalid_proto_rawDescGZIP(), []int{4}
+}
+
+func (x *InvalidNestedRequest) GetInnerMessage() *InvalidTargetType {
+ if x != nil {
+ return x.InnerMessage
+ }
+ return nil
+}
+
+type RequestWithStorage struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ StorageName string `protobuf:"bytes,1,opt,name=storage_name,json=storageName,proto3" json:"storage_name,omitempty"`
+ Destination *gitalypb.Repository `protobuf:"bytes,2,opt,name=destination,proto3" json:"destination,omitempty"`
+}
+
+func (x *RequestWithStorage) Reset() {
+ *x = RequestWithStorage{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[5]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *RequestWithStorage) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*RequestWithStorage) ProtoMessage() {}
+
+func (x *RequestWithStorage) ProtoReflect() protoreflect.Message {
+ mi := &file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[5]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use RequestWithStorage.ProtoReflect.Descriptor instead.
+func (*RequestWithStorage) Descriptor() ([]byte, []int) {
+ return file_protoc_gen_gitaly_lint_testdata_invalid_proto_rawDescGZIP(), []int{5}
+}
+
+func (x *RequestWithStorage) GetStorageName() string {
+ if x != nil {
+ return x.StorageName
+ }
+ return ""
+}
+
+func (x *RequestWithStorage) GetDestination() *gitalypb.Repository {
+ if x != nil {
+ return x.Destination
+ }
+ return nil
+}
+
+type RequestWithStorageAndRepo struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ StorageName string `protobuf:"bytes,1,opt,name=storage_name,json=storageName,proto3" json:"storage_name,omitempty"`
+ Destination *gitalypb.Repository `protobuf:"bytes,2,opt,name=destination,proto3" json:"destination,omitempty"`
+}
+
+func (x *RequestWithStorageAndRepo) Reset() {
+ *x = RequestWithStorageAndRepo{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[6]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *RequestWithStorageAndRepo) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*RequestWithStorageAndRepo) ProtoMessage() {}
+
+func (x *RequestWithStorageAndRepo) ProtoReflect() protoreflect.Message {
+ mi := &file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[6]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use RequestWithStorageAndRepo.ProtoReflect.Descriptor instead.
+func (*RequestWithStorageAndRepo) Descriptor() ([]byte, []int) {
+ return file_protoc_gen_gitaly_lint_testdata_invalid_proto_rawDescGZIP(), []int{6}
+}
+
+func (x *RequestWithStorageAndRepo) GetStorageName() string {
+ if x != nil {
+ return x.StorageName
+ }
+ return ""
+}
+
+func (x *RequestWithStorageAndRepo) GetDestination() *gitalypb.Repository {
+ if x != nil {
+ return x.Destination
+ }
+ return nil
+}
+
+type RequestWithNestedStorageAndRepo struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ InnerMessage *RequestWithStorageAndRepo `protobuf:"bytes,1,opt,name=inner_message,json=innerMessage,proto3" json:"inner_message,omitempty"`
+}
+
+func (x *RequestWithNestedStorageAndRepo) Reset() {
+ *x = RequestWithNestedStorageAndRepo{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[7]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *RequestWithNestedStorageAndRepo) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*RequestWithNestedStorageAndRepo) ProtoMessage() {}
+
+func (x *RequestWithNestedStorageAndRepo) ProtoReflect() protoreflect.Message {
+ mi := &file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[7]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use RequestWithNestedStorageAndRepo.ProtoReflect.Descriptor instead.
+func (*RequestWithNestedStorageAndRepo) Descriptor() ([]byte, []int) {
+ return file_protoc_gen_gitaly_lint_testdata_invalid_proto_rawDescGZIP(), []int{7}
+}
+
+func (x *RequestWithNestedStorageAndRepo) GetInnerMessage() *RequestWithStorageAndRepo {
+ if x != nil {
+ return x.InnerMessage
+ }
+ return nil
+}
+
+type RequestWithMultipleNestedStorage struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ InnerMessage *RequestWithStorage `protobuf:"bytes,1,opt,name=inner_message,json=innerMessage,proto3" json:"inner_message,omitempty"`
+ StorageName string `protobuf:"bytes,2,opt,name=storage_name,json=storageName,proto3" json:"storage_name,omitempty"`
+}
+
+func (x *RequestWithMultipleNestedStorage) Reset() {
+ *x = RequestWithMultipleNestedStorage{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[8]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *RequestWithMultipleNestedStorage) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*RequestWithMultipleNestedStorage) ProtoMessage() {}
+
+func (x *RequestWithMultipleNestedStorage) ProtoReflect() protoreflect.Message {
+ mi := &file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[8]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use RequestWithMultipleNestedStorage.ProtoReflect.Descriptor instead.
+func (*RequestWithMultipleNestedStorage) Descriptor() ([]byte, []int) {
+ return file_protoc_gen_gitaly_lint_testdata_invalid_proto_rawDescGZIP(), []int{8}
+}
+
+func (x *RequestWithMultipleNestedStorage) GetInnerMessage() *RequestWithStorage {
+ if x != nil {
+ return x.InnerMessage
+ }
+ return nil
+}
+
+func (x *RequestWithMultipleNestedStorage) GetStorageName() string {
+ if x != nil {
+ return x.StorageName
+ }
+ return ""
+}
+
+type RequestWithInnerNestedStorage struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Header *RequestWithInnerNestedStorage_Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
+}
+
+func (x *RequestWithInnerNestedStorage) Reset() {
+ *x = RequestWithInnerNestedStorage{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[9]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *RequestWithInnerNestedStorage) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*RequestWithInnerNestedStorage) ProtoMessage() {}
+
+func (x *RequestWithInnerNestedStorage) ProtoReflect() protoreflect.Message {
+ mi := &file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[9]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use RequestWithInnerNestedStorage.ProtoReflect.Descriptor instead.
+func (*RequestWithInnerNestedStorage) Descriptor() ([]byte, []int) {
+ return file_protoc_gen_gitaly_lint_testdata_invalid_proto_rawDescGZIP(), []int{9}
+}
+
+func (x *RequestWithInnerNestedStorage) GetHeader() *RequestWithInnerNestedStorage_Header {
+ if x != nil {
+ return x.Header
+ }
+ return nil
+}
+
+type RequestWithWrongTypeRepository struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Header *RequestWithWrongTypeRepository_Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
+}
+
+func (x *RequestWithWrongTypeRepository) Reset() {
+ *x = RequestWithWrongTypeRepository{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[10]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *RequestWithWrongTypeRepository) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*RequestWithWrongTypeRepository) ProtoMessage() {}
+
+func (x *RequestWithWrongTypeRepository) ProtoReflect() protoreflect.Message {
+ mi := &file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[10]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use RequestWithWrongTypeRepository.ProtoReflect.Descriptor instead.
+func (*RequestWithWrongTypeRepository) Descriptor() ([]byte, []int) {
+ return file_protoc_gen_gitaly_lint_testdata_invalid_proto_rawDescGZIP(), []int{10}
+}
+
+func (x *RequestWithWrongTypeRepository) GetHeader() *RequestWithWrongTypeRepository_Header {
+ if x != nil {
+ return x.Header
+ }
+ return nil
+}
+
+type RequestWithNestedRepoNotFlagged struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Header *RequestWithNestedRepoNotFlagged_Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
+}
+
+func (x *RequestWithNestedRepoNotFlagged) Reset() {
+ *x = RequestWithNestedRepoNotFlagged{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[11]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *RequestWithNestedRepoNotFlagged) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*RequestWithNestedRepoNotFlagged) ProtoMessage() {}
+
+func (x *RequestWithNestedRepoNotFlagged) ProtoReflect() protoreflect.Message {
+ mi := &file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[11]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use RequestWithNestedRepoNotFlagged.ProtoReflect.Descriptor instead.
+func (*RequestWithNestedRepoNotFlagged) Descriptor() ([]byte, []int) {
+ return file_protoc_gen_gitaly_lint_testdata_invalid_proto_rawDescGZIP(), []int{11}
+}
+
+func (x *RequestWithNestedRepoNotFlagged) GetHeader() *RequestWithNestedRepoNotFlagged_Header {
+ if x != nil {
+ return x.Header
+ }
+ return nil
+}
+
+type RequestWithInnerNestedStorage_Header struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ StorageName string `protobuf:"bytes,1,opt,name=storage_name,json=storageName,proto3" json:"storage_name,omitempty"`
+}
+
+func (x *RequestWithInnerNestedStorage_Header) Reset() {
+ *x = RequestWithInnerNestedStorage_Header{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[12]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *RequestWithInnerNestedStorage_Header) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*RequestWithInnerNestedStorage_Header) ProtoMessage() {}
+
+func (x *RequestWithInnerNestedStorage_Header) ProtoReflect() protoreflect.Message {
+ mi := &file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[12]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use RequestWithInnerNestedStorage_Header.ProtoReflect.Descriptor instead.
+func (*RequestWithInnerNestedStorage_Header) Descriptor() ([]byte, []int) {
+ return file_protoc_gen_gitaly_lint_testdata_invalid_proto_rawDescGZIP(), []int{9, 0}
+}
+
+func (x *RequestWithInnerNestedStorage_Header) GetStorageName() string {
+ if x != nil {
+ return x.StorageName
+ }
+ return ""
+}
+
+type RequestWithWrongTypeRepository_Header struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Repository *InvalidMethodResponse `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"`
+}
+
+func (x *RequestWithWrongTypeRepository_Header) Reset() {
+ *x = RequestWithWrongTypeRepository_Header{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[13]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *RequestWithWrongTypeRepository_Header) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*RequestWithWrongTypeRepository_Header) ProtoMessage() {}
+
+func (x *RequestWithWrongTypeRepository_Header) ProtoReflect() protoreflect.Message {
+ mi := &file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[13]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use RequestWithWrongTypeRepository_Header.ProtoReflect.Descriptor instead.
+func (*RequestWithWrongTypeRepository_Header) Descriptor() ([]byte, []int) {
+ return file_protoc_gen_gitaly_lint_testdata_invalid_proto_rawDescGZIP(), []int{10, 0}
+}
+
+func (x *RequestWithWrongTypeRepository_Header) GetRepository() *InvalidMethodResponse {
+ if x != nil {
+ return x.Repository
+ }
+ return nil
+}
+
+type RequestWithNestedRepoNotFlagged_Header struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Repository *gitalypb.Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"`
+}
+
+func (x *RequestWithNestedRepoNotFlagged_Header) Reset() {
+ *x = RequestWithNestedRepoNotFlagged_Header{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[14]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *RequestWithNestedRepoNotFlagged_Header) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*RequestWithNestedRepoNotFlagged_Header) ProtoMessage() {}
+
+func (x *RequestWithNestedRepoNotFlagged_Header) ProtoReflect() protoreflect.Message {
+ mi := &file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[14]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use RequestWithNestedRepoNotFlagged_Header.ProtoReflect.Descriptor instead.
+func (*RequestWithNestedRepoNotFlagged_Header) Descriptor() ([]byte, []int) {
+ return file_protoc_gen_gitaly_lint_testdata_invalid_proto_rawDescGZIP(), []int{11, 0}
+}
+
+func (x *RequestWithNestedRepoNotFlagged_Header) GetRepository() *gitalypb.Repository {
+ if x != nil {
+ return x.Repository
+ }
+ return nil
+}
+
+var File_protoc_gen_gitaly_lint_testdata_invalid_proto protoreflect.FileDescriptor
+
+var file_protoc_gen_gitaly_lint_testdata_invalid_proto_rawDesc = []byte{
+ 0x0a, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x69, 0x74,
+ 0x61, 0x6c, 0x79, 0x2d, 0x6c, 0x69, 0x6e, 0x74, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74,
+ 0x61, 0x2f, 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
+ 0x04, 0x74, 0x65, 0x73, 0x74, 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, 0x22,
+ 0x16, 0x0a, 0x14, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64,
+ 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x5a, 0x0a, 0x1c, 0x49, 0x6e, 0x76, 0x61, 0x6c,
+ 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x57,
+ 0x69, 0x74, 0x68, 0x52, 0x65, 0x70, 0x6f, 0x12, 0x3a, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69,
+ 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 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, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x22, 0x38, 0x0a, 0x11, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x54, 0x61,
+ 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x0a, 0x77, 0x72, 0x6f, 0x6e,
+ 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x42, 0x04, 0x98, 0xc6,
+ 0x2c, 0x01, 0x52, 0x09, 0x77, 0x72, 0x6f, 0x6e, 0x67, 0x54, 0x79, 0x70, 0x65, 0x22, 0x17, 0x0a,
+ 0x15, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65,
+ 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x54, 0x0a, 0x14, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69,
+ 0x64, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3c,
+ 0x0a, 0x0d, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18,
+ 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x76,
+ 0x61, 0x6c, 0x69, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0c,
+ 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x73, 0x0a, 0x12,
+ 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x53, 0x74, 0x6f, 0x72, 0x61,
+ 0x67, 0x65, 0x12, 0x27, 0x0a, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x6e, 0x61,
+ 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0x88, 0xc6, 0x2c, 0x01, 0x52, 0x0b,
+ 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x34, 0x0a, 0x0b, 0x64,
+ 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b,
+ 0x32, 0x12, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69,
+ 0x74, 0x6f, 0x72, 0x79, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x22, 0x80, 0x01, 0x0a, 0x19, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x57, 0x69, 0x74,
+ 0x68, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x41, 0x6e, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x12,
+ 0x27, 0x0a, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18,
+ 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0x88, 0xc6, 0x2c, 0x01, 0x52, 0x0b, 0x73, 0x74, 0x6f,
+ 0x72, 0x61, 0x67, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x3a, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x74,
+ 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 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, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x67, 0x0a, 0x1f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x57,
+ 0x69, 0x74, 0x68, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65,
+ 0x41, 0x6e, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x12, 0x44, 0x0a, 0x0d, 0x69, 0x6e, 0x6e, 0x65, 0x72,
+ 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f,
+ 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x57, 0x69, 0x74,
+ 0x68, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x41, 0x6e, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x52,
+ 0x0c, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x8a, 0x01,
+ 0x0a, 0x20, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x4d, 0x75, 0x6c,
+ 0x74, 0x69, 0x70, 0x6c, 0x65, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x53, 0x74, 0x6f, 0x72, 0x61,
+ 0x67, 0x65, 0x12, 0x3d, 0x0a, 0x0d, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73,
+ 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x74, 0x65, 0x73, 0x74,
+ 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x53, 0x74, 0x6f, 0x72,
+ 0x61, 0x67, 0x65, 0x52, 0x0c, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
+ 0x65, 0x12, 0x27, 0x0a, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x6e, 0x61, 0x6d,
+ 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0x88, 0xc6, 0x2c, 0x01, 0x52, 0x0b, 0x73,
+ 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x96, 0x01, 0x0a, 0x1d, 0x52,
+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x4e,
+ 0x65, 0x73, 0x74, 0x65, 0x64, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x12, 0x42, 0x0a, 0x06,
+ 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x74,
+ 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x49,
+ 0x6e, 0x6e, 0x65, 0x72, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67,
+ 0x65, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72,
+ 0x1a, 0x31, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0c, 0x73, 0x74,
+ 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
+ 0x42, 0x04, 0x88, 0xc6, 0x2c, 0x01, 0x52, 0x0b, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x4e,
+ 0x61, 0x6d, 0x65, 0x22, 0xb8, 0x01, 0x0a, 0x1e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x57,
+ 0x69, 0x74, 0x68, 0x57, 0x72, 0x6f, 0x6e, 0x67, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x70, 0x6f,
+ 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x49, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72,
+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65,
+ 0x71, 0x75, 0x65, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x57, 0x72, 0x6f, 0x6e, 0x67, 0x54, 0x79,
+ 0x70, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x48, 0x65, 0x61,
+ 0x64, 0x65, 0x72, 0x42, 0x04, 0x98, 0xc6, 0x2c, 0x01, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65,
+ 0x72, 0x1a, 0x4b, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x41, 0x0a, 0x0a, 0x72,
+ 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
+ 0x1b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4d, 0x65,
+ 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x04, 0x90, 0xc6,
+ 0x2c, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x22, 0xab,
+ 0x01, 0x0a, 0x1f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x65,
+ 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x4e, 0x6f, 0x74, 0x46, 0x6c, 0x61, 0x67, 0x67,
+ 0x65, 0x64, 0x12, 0x4a, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01,
+ 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
+ 0x74, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x4e,
+ 0x6f, 0x74, 0x46, 0x6c, 0x61, 0x67, 0x67, 0x65, 0x64, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72,
+ 0x42, 0x04, 0x98, 0xc6, 0x2c, 0x01, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x3c,
+ 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6f,
+ 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 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,
+ 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x32, 0x76, 0x0a, 0x1c,
+ 0x49, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x57, 0x69, 0x74, 0x68, 0x4f,
+ 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x50, 0x0a, 0x0d,
+ 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x1a, 0x2e,
+ 0x74, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68,
+ 0x6f, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x74, 0x65, 0x73, 0x74,
+ 0x2e, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65,
+ 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x02, 0x1a, 0x04,
+ 0xf0, 0x97, 0x28, 0x01, 0x32, 0xc1, 0x10, 0x0a, 0x0e, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64,
+ 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4b, 0x0a, 0x0e, 0x49, 0x6e, 0x76, 0x61, 0x6c,
+ 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x30, 0x12, 0x1a, 0x2e, 0x74, 0x65, 0x73, 0x74,
+ 0x2e, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65,
+ 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x76,
+ 0x61, 0x6c, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
+ 0x73, 0x65, 0x22, 0x00, 0x12, 0x51, 0x0a, 0x0e, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4d,
+ 0x65, 0x74, 0x68, 0x6f, 0x64, 0x31, 0x12, 0x1a, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e,
+ 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65,
+ 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69,
+ 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
+ 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x00, 0x12, 0x51, 0x0a, 0x0e, 0x49, 0x6e, 0x76, 0x61, 0x6c,
+ 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x32, 0x12, 0x1a, 0x2e, 0x74, 0x65, 0x73, 0x74,
+ 0x2e, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65,
+ 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x76,
+ 0x61, 0x6c, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
+ 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x02, 0x12, 0x51, 0x0a, 0x0e, 0x49, 0x6e,
+ 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x34, 0x12, 0x1a, 0x2e, 0x74,
+ 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f,
+ 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e,
+ 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x73,
+ 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x01, 0x12, 0x5b, 0x0a,
+ 0x0e, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x35, 0x12,
+ 0x24, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x57, 0x69,
+ 0x74, 0x68, 0x57, 0x72, 0x6f, 0x6e, 0x67, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73,
+ 0x69, 0x74, 0x6f, 0x72, 0x79, 0x1a, 0x1b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x76,
+ 0x61, 0x6c, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
+ 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x01, 0x12, 0x5c, 0x0a, 0x0e, 0x49, 0x6e,
+ 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x36, 0x12, 0x25, 0x2e, 0x74,
+ 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x4e,
+ 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x4e, 0x6f, 0x74, 0x46, 0x6c, 0x61, 0x67,
+ 0x67, 0x65, 0x64, 0x1a, 0x1b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x76, 0x61, 0x6c,
+ 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
+ 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x01, 0x12, 0x4e, 0x0a, 0x0e, 0x49, 0x6e, 0x76, 0x61,
+ 0x6c, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x37, 0x12, 0x17, 0x2e, 0x74, 0x65, 0x73,
+ 0x74, 0x2e, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54,
+ 0x79, 0x70, 0x65, 0x1a, 0x1b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x76, 0x61, 0x6c,
+ 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
+ 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x01, 0x12, 0x51, 0x0a, 0x0e, 0x49, 0x6e, 0x76, 0x61,
+ 0x6c, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x38, 0x12, 0x1a, 0x2e, 0x74, 0x65, 0x73,
+ 0x74, 0x2e, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52,
+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e,
+ 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f,
+ 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x01, 0x12, 0x5b, 0x0a, 0x0e, 0x49,
+ 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x39, 0x12, 0x22, 0x2e,
+ 0x74, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68,
+ 0x6f, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x52, 0x65, 0x70,
+ 0x6f, 0x1a, 0x1b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64,
+ 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x08,
+ 0xfa, 0x97, 0x28, 0x04, 0x08, 0x01, 0x10, 0x02, 0x12, 0x57, 0x0a, 0x0f, 0x49, 0x6e, 0x76, 0x61,
+ 0x6c, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x31, 0x30, 0x12, 0x1f, 0x2e, 0x74, 0x65,
+ 0x73, 0x74, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x53, 0x74,
+ 0x6f, 0x72, 0x61, 0x67, 0x65, 0x41, 0x6e, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x1a, 0x1b, 0x2e, 0x74,
+ 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f,
+ 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08,
+ 0x02, 0x12, 0x5d, 0x0a, 0x0f, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68,
+ 0x6f, 0x64, 0x31, 0x31, 0x12, 0x25, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x71, 0x75,
+ 0x65, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x53, 0x74, 0x6f,
+ 0x72, 0x61, 0x67, 0x65, 0x41, 0x6e, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x1a, 0x1b, 0x2e, 0x74, 0x65,
+ 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64,
+ 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x01,
+ 0x12, 0x51, 0x0a, 0x0f, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f,
+ 0x64, 0x31, 0x33, 0x12, 0x17, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x76, 0x61, 0x6c,
+ 0x69, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x1a, 0x1b, 0x2e, 0x74,
+ 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f,
+ 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x08, 0xfa, 0x97, 0x28, 0x04, 0x08,
+ 0x01, 0x10, 0x02, 0x12, 0x60, 0x0a, 0x0f, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4d, 0x65,
+ 0x74, 0x68, 0x6f, 0x64, 0x31, 0x34, 0x12, 0x26, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65,
+ 0x71, 0x75, 0x65, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c,
+ 0x65, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x1a, 0x1b,
+ 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4d, 0x65, 0x74,
+ 0x68, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x08, 0xfa, 0x97, 0x28,
+ 0x04, 0x08, 0x01, 0x10, 0x02, 0x12, 0x59, 0x0a, 0x0f, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64,
+ 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x31, 0x35, 0x12, 0x1f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e,
+ 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x53, 0x74, 0x6f, 0x72, 0x61,
+ 0x67, 0x65, 0x41, 0x6e, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x1a, 0x1b, 0x2e, 0x74, 0x65, 0x73, 0x74,
+ 0x2e, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65,
+ 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x08, 0x80, 0x98, 0x28, 0x01, 0xfa, 0x97, 0x28, 0x00,
+ 0x12, 0x63, 0x0a, 0x20, 0x4d, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x57,
+ 0x69, 0x74, 0x68, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69,
+ 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1a, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x76, 0x61,
+ 0x6c, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
+ 0x1a, 0x1b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4d,
+ 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa,
+ 0x97, 0x28, 0x02, 0x08, 0x03, 0x12, 0x70, 0x0a, 0x22, 0x4d, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x6e,
+ 0x61, 0x6e, 0x63, 0x65, 0x57, 0x69, 0x74, 0x68, 0x55, 0x6e, 0x66, 0x6c, 0x61, 0x67, 0x67, 0x65,
+ 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x25, 0x2e, 0x74, 0x65,
+ 0x73, 0x74, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x65,
+ 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x4e, 0x6f, 0x74, 0x46, 0x6c, 0x61, 0x67, 0x67,
+ 0x65, 0x64, 0x1a, 0x1b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69,
+ 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
+ 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x03, 0x12, 0x75, 0x0a, 0x28, 0x4d, 0x61, 0x69, 0x6e, 0x74,
+ 0x65, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x72, 0x6f, 0x6e, 0x67, 0x4e,
+ 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x54,
+ 0x79, 0x70, 0x65, 0x12, 0x24, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65,
+ 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x57, 0x72, 0x6f, 0x6e, 0x67, 0x54, 0x79, 0x70, 0x65, 0x52,
+ 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x1a, 0x1b, 0x2e, 0x74, 0x65, 0x73, 0x74,
+ 0x2e, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65,
+ 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x03, 0x12, 0x60,
+ 0x0a, 0x20, 0x4d, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x57, 0x69, 0x74,
+ 0x68, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79,
+ 0x70, 0x65, 0x12, 0x17, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69,
+ 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x1a, 0x1b, 0x2e, 0x74, 0x65,
+ 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64,
+ 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x03,
+ 0x12, 0x66, 0x0a, 0x23, 0x4d, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x57,
+ 0x69, 0x74, 0x68, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64,
+ 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x49,
+ 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75,
+ 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x76, 0x61, 0x6c,
+ 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
+ 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x03, 0x12, 0x6b, 0x0a, 0x23, 0x4d, 0x61, 0x69, 0x6e,
+ 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x74, 0x6f, 0x72, 0x61,
+ 0x67, 0x65, 0x41, 0x6e, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12,
+ 0x1f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x57, 0x69,
+ 0x74, 0x68, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x41, 0x6e, 0x64, 0x52, 0x65, 0x70, 0x6f,
+ 0x1a, 0x1b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4d,
+ 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa,
+ 0x97, 0x28, 0x02, 0x08, 0x03, 0x12, 0x77, 0x0a, 0x29, 0x4d, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x6e,
+ 0x61, 0x6e, 0x63, 0x65, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x53, 0x74,
+ 0x6f, 0x72, 0x61, 0x67, 0x65, 0x41, 0x6e, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f,
+ 0x72, 0x79, 0x12, 0x25, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
+ 0x74, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x53, 0x74, 0x6f, 0x72, 0x61,
+ 0x67, 0x65, 0x41, 0x6e, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x1a, 0x1b, 0x2e, 0x74, 0x65, 0x73, 0x74,
+ 0x2e, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65,
+ 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x03, 0x12, 0x68,
+ 0x0a, 0x1b, 0x4d, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x57, 0x69, 0x74,
+ 0x68, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x22, 0x2e,
+ 0x74, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68,
+ 0x6f, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x52, 0x65, 0x70,
+ 0x6f, 0x1a, 0x1b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64,
+ 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x08,
+ 0xfa, 0x97, 0x28, 0x04, 0x08, 0x03, 0x10, 0x02, 0x42, 0x48, 0x5a, 0x46, 0x67, 0x69, 0x74, 0x6c,
+ 0x61, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2d, 0x6f, 0x72,
+ 0x67, 0x2f, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2f, 0x76, 0x31, 0x34, 0x2f, 0x74, 0x6f, 0x6f,
+ 0x6c, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x69,
+ 0x74, 0x61, 0x6c, 0x79, 0x2d, 0x6c, 0x69, 0x6e, 0x74, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61,
+ 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+}
+
+var (
+ file_protoc_gen_gitaly_lint_testdata_invalid_proto_rawDescOnce sync.Once
+ file_protoc_gen_gitaly_lint_testdata_invalid_proto_rawDescData = file_protoc_gen_gitaly_lint_testdata_invalid_proto_rawDesc
+)
+
+func file_protoc_gen_gitaly_lint_testdata_invalid_proto_rawDescGZIP() []byte {
+ file_protoc_gen_gitaly_lint_testdata_invalid_proto_rawDescOnce.Do(func() {
+ file_protoc_gen_gitaly_lint_testdata_invalid_proto_rawDescData = protoimpl.X.CompressGZIP(file_protoc_gen_gitaly_lint_testdata_invalid_proto_rawDescData)
+ })
+ return file_protoc_gen_gitaly_lint_testdata_invalid_proto_rawDescData
+}
+
+var file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes = make([]protoimpl.MessageInfo, 15)
+var file_protoc_gen_gitaly_lint_testdata_invalid_proto_goTypes = []interface{}{
+ (*InvalidMethodRequest)(nil), // 0: test.InvalidMethodRequest
+ (*InvalidMethodRequestWithRepo)(nil), // 1: test.InvalidMethodRequestWithRepo
+ (*InvalidTargetType)(nil), // 2: test.InvalidTargetType
+ (*InvalidMethodResponse)(nil), // 3: test.InvalidMethodResponse
+ (*InvalidNestedRequest)(nil), // 4: test.InvalidNestedRequest
+ (*RequestWithStorage)(nil), // 5: test.RequestWithStorage
+ (*RequestWithStorageAndRepo)(nil), // 6: test.RequestWithStorageAndRepo
+ (*RequestWithNestedStorageAndRepo)(nil), // 7: test.RequestWithNestedStorageAndRepo
+ (*RequestWithMultipleNestedStorage)(nil), // 8: test.RequestWithMultipleNestedStorage
+ (*RequestWithInnerNestedStorage)(nil), // 9: test.RequestWithInnerNestedStorage
+ (*RequestWithWrongTypeRepository)(nil), // 10: test.RequestWithWrongTypeRepository
+ (*RequestWithNestedRepoNotFlagged)(nil), // 11: test.RequestWithNestedRepoNotFlagged
+ (*RequestWithInnerNestedStorage_Header)(nil), // 12: test.RequestWithInnerNestedStorage.Header
+ (*RequestWithWrongTypeRepository_Header)(nil), // 13: test.RequestWithWrongTypeRepository.Header
+ (*RequestWithNestedRepoNotFlagged_Header)(nil), // 14: test.RequestWithNestedRepoNotFlagged.Header
+ (*gitalypb.Repository)(nil), // 15: gitaly.Repository
+}
+var file_protoc_gen_gitaly_lint_testdata_invalid_proto_depIdxs = []int32{
+ 15, // 0: test.InvalidMethodRequestWithRepo.destination:type_name -> gitaly.Repository
+ 2, // 1: test.InvalidNestedRequest.inner_message:type_name -> test.InvalidTargetType
+ 15, // 2: test.RequestWithStorage.destination:type_name -> gitaly.Repository
+ 15, // 3: test.RequestWithStorageAndRepo.destination:type_name -> gitaly.Repository
+ 6, // 4: test.RequestWithNestedStorageAndRepo.inner_message:type_name -> test.RequestWithStorageAndRepo
+ 5, // 5: test.RequestWithMultipleNestedStorage.inner_message:type_name -> test.RequestWithStorage
+ 12, // 6: test.RequestWithInnerNestedStorage.header:type_name -> test.RequestWithInnerNestedStorage.Header
+ 13, // 7: test.RequestWithWrongTypeRepository.header:type_name -> test.RequestWithWrongTypeRepository.Header
+ 14, // 8: test.RequestWithNestedRepoNotFlagged.header:type_name -> test.RequestWithNestedRepoNotFlagged.Header
+ 3, // 9: test.RequestWithWrongTypeRepository.Header.repository:type_name -> test.InvalidMethodResponse
+ 15, // 10: test.RequestWithNestedRepoNotFlagged.Header.repository:type_name -> gitaly.Repository
+ 0, // 11: test.InterceptedWithOperationType.InvalidMethod:input_type -> test.InvalidMethodRequest
+ 0, // 12: test.InvalidService.InvalidMethod0:input_type -> test.InvalidMethodRequest
+ 0, // 13: test.InvalidService.InvalidMethod1:input_type -> test.InvalidMethodRequest
+ 0, // 14: test.InvalidService.InvalidMethod2:input_type -> test.InvalidMethodRequest
+ 0, // 15: test.InvalidService.InvalidMethod4:input_type -> test.InvalidMethodRequest
+ 10, // 16: test.InvalidService.InvalidMethod5:input_type -> test.RequestWithWrongTypeRepository
+ 11, // 17: test.InvalidService.InvalidMethod6:input_type -> test.RequestWithNestedRepoNotFlagged
+ 2, // 18: test.InvalidService.InvalidMethod7:input_type -> test.InvalidTargetType
+ 4, // 19: test.InvalidService.InvalidMethod8:input_type -> test.InvalidNestedRequest
+ 1, // 20: test.InvalidService.InvalidMethod9:input_type -> test.InvalidMethodRequestWithRepo
+ 6, // 21: test.InvalidService.InvalidMethod10:input_type -> test.RequestWithStorageAndRepo
+ 7, // 22: test.InvalidService.InvalidMethod11:input_type -> test.RequestWithNestedStorageAndRepo
+ 2, // 23: test.InvalidService.InvalidMethod13:input_type -> test.InvalidTargetType
+ 8, // 24: test.InvalidService.InvalidMethod14:input_type -> test.RequestWithMultipleNestedStorage
+ 6, // 25: test.InvalidService.InvalidMethod15:input_type -> test.RequestWithStorageAndRepo
+ 0, // 26: test.InvalidService.MaintenanceWithMissingRepository:input_type -> test.InvalidMethodRequest
+ 11, // 27: test.InvalidService.MaintenanceWithUnflaggedRepository:input_type -> test.RequestWithNestedRepoNotFlagged
+ 10, // 28: test.InvalidService.MaintenanceWithWrongNestedRepositoryType:input_type -> test.RequestWithWrongTypeRepository
+ 2, // 29: test.InvalidService.MaintenanceWithInvalidTargetType:input_type -> test.InvalidTargetType
+ 4, // 30: test.InvalidService.MaintenanceWithInvalidNestedRequest:input_type -> test.InvalidNestedRequest
+ 6, // 31: test.InvalidService.MaintenanceWithStorageAndRepository:input_type -> test.RequestWithStorageAndRepo
+ 7, // 32: test.InvalidService.MaintenanceWithNestedStorageAndRepository:input_type -> test.RequestWithNestedStorageAndRepo
+ 1, // 33: test.InvalidService.MaintenanceWithStorageScope:input_type -> test.InvalidMethodRequestWithRepo
+ 3, // 34: test.InterceptedWithOperationType.InvalidMethod:output_type -> test.InvalidMethodResponse
+ 3, // 35: test.InvalidService.InvalidMethod0:output_type -> test.InvalidMethodResponse
+ 3, // 36: test.InvalidService.InvalidMethod1:output_type -> test.InvalidMethodResponse
+ 3, // 37: test.InvalidService.InvalidMethod2:output_type -> test.InvalidMethodResponse
+ 3, // 38: test.InvalidService.InvalidMethod4:output_type -> test.InvalidMethodResponse
+ 3, // 39: test.InvalidService.InvalidMethod5:output_type -> test.InvalidMethodResponse
+ 3, // 40: test.InvalidService.InvalidMethod6:output_type -> test.InvalidMethodResponse
+ 3, // 41: test.InvalidService.InvalidMethod7:output_type -> test.InvalidMethodResponse
+ 3, // 42: test.InvalidService.InvalidMethod8:output_type -> test.InvalidMethodResponse
+ 3, // 43: test.InvalidService.InvalidMethod9:output_type -> test.InvalidMethodResponse
+ 3, // 44: test.InvalidService.InvalidMethod10:output_type -> test.InvalidMethodResponse
+ 3, // 45: test.InvalidService.InvalidMethod11:output_type -> test.InvalidMethodResponse
+ 3, // 46: test.InvalidService.InvalidMethod13:output_type -> test.InvalidMethodResponse
+ 3, // 47: test.InvalidService.InvalidMethod14:output_type -> test.InvalidMethodResponse
+ 3, // 48: test.InvalidService.InvalidMethod15:output_type -> test.InvalidMethodResponse
+ 3, // 49: test.InvalidService.MaintenanceWithMissingRepository:output_type -> test.InvalidMethodResponse
+ 3, // 50: test.InvalidService.MaintenanceWithUnflaggedRepository:output_type -> test.InvalidMethodResponse
+ 3, // 51: test.InvalidService.MaintenanceWithWrongNestedRepositoryType:output_type -> test.InvalidMethodResponse
+ 3, // 52: test.InvalidService.MaintenanceWithInvalidTargetType:output_type -> test.InvalidMethodResponse
+ 3, // 53: test.InvalidService.MaintenanceWithInvalidNestedRequest:output_type -> test.InvalidMethodResponse
+ 3, // 54: test.InvalidService.MaintenanceWithStorageAndRepository:output_type -> test.InvalidMethodResponse
+ 3, // 55: test.InvalidService.MaintenanceWithNestedStorageAndRepository:output_type -> test.InvalidMethodResponse
+ 3, // 56: test.InvalidService.MaintenanceWithStorageScope:output_type -> test.InvalidMethodResponse
+ 34, // [34:57] is the sub-list for method output_type
+ 11, // [11:34] is the sub-list for method input_type
+ 11, // [11:11] is the sub-list for extension type_name
+ 11, // [11:11] is the sub-list for extension extendee
+ 0, // [0:11] is the sub-list for field type_name
+}
+
+func init() { file_protoc_gen_gitaly_lint_testdata_invalid_proto_init() }
+func file_protoc_gen_gitaly_lint_testdata_invalid_proto_init() {
+ if File_protoc_gen_gitaly_lint_testdata_invalid_proto != nil {
+ return
+ }
+ if !protoimpl.UnsafeEnabled {
+ file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*InvalidMethodRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*InvalidMethodRequestWithRepo); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*InvalidTargetType); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*InvalidMethodResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*InvalidNestedRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*RequestWithStorage); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*RequestWithStorageAndRepo); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*RequestWithNestedStorageAndRepo); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*RequestWithMultipleNestedStorage); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*RequestWithInnerNestedStorage); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*RequestWithWrongTypeRepository); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*RequestWithNestedRepoNotFlagged); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*RequestWithInnerNestedStorage_Header); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*RequestWithWrongTypeRepository_Header); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*RequestWithNestedRepoNotFlagged_Header); 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_protoc_gen_gitaly_lint_testdata_invalid_proto_rawDesc,
+ NumEnums: 0,
+ NumMessages: 15,
+ NumExtensions: 0,
+ NumServices: 2,
+ },
+ GoTypes: file_protoc_gen_gitaly_lint_testdata_invalid_proto_goTypes,
+ DependencyIndexes: file_protoc_gen_gitaly_lint_testdata_invalid_proto_depIdxs,
+ MessageInfos: file_protoc_gen_gitaly_lint_testdata_invalid_proto_msgTypes,
+ }.Build()
+ File_protoc_gen_gitaly_lint_testdata_invalid_proto = out.File
+ file_protoc_gen_gitaly_lint_testdata_invalid_proto_rawDesc = nil
+ file_protoc_gen_gitaly_lint_testdata_invalid_proto_goTypes = nil
+ file_protoc_gen_gitaly_lint_testdata_invalid_proto_depIdxs = nil
+}
diff --git a/tools/protoc-gen-gitaly-lint/testdata/invalid.proto b/tools/protoc-gen-gitaly-lint/testdata/invalid.proto
new file mode 100644
index 000000000..80deaa416
--- /dev/null
+++ b/tools/protoc-gen-gitaly-lint/testdata/invalid.proto
@@ -0,0 +1,213 @@
+syntax = "proto3";
+
+package test;
+
+import "lint.proto";
+import "shared.proto";
+
+option go_package = "gitlab.com/gitlab-org/gitaly/v14/tools/protoc-gen-gitaly-lint/testdata";
+
+message InvalidMethodRequest {
+}
+
+message InvalidMethodRequestWithRepo {
+ gitaly.Repository destination = 1 [(gitaly.target_repository)=true];
+}
+
+message InvalidTargetType {
+ int32 wrong_type = 1 [(gitaly.target_repository)=true];
+}
+
+message InvalidMethodResponse{
+}
+
+message InvalidNestedRequest{
+ InvalidTargetType inner_message = 1;
+}
+
+message RequestWithStorage {
+ string storage_name = 1 [(gitaly.storage)=true];
+ gitaly.Repository destination = 2;
+}
+
+message RequestWithStorageAndRepo {
+ string storage_name = 1 [(gitaly.storage)=true];
+ gitaly.Repository destination = 2 [(gitaly.target_repository)=true];
+}
+
+message RequestWithNestedStorageAndRepo{
+ RequestWithStorageAndRepo inner_message = 1;
+}
+
+message RequestWithMultipleNestedStorage{
+ RequestWithStorage inner_message = 1;
+ string storage_name = 2 [(gitaly.storage)=true];
+}
+
+message RequestWithInnerNestedStorage {
+ message Header {
+ string storage_name = 1 [(gitaly.storage) = true];
+ }
+
+ Header header = 1;
+}
+
+message RequestWithWrongTypeRepository {
+ message Header {
+ InvalidMethodResponse repository = 1 [(gitaly.repository) = true];
+ }
+
+ Header header = 1 [(gitaly.target_repository) = true];
+}
+
+message RequestWithNestedRepoNotFlagged {
+ message Header {
+ gitaly.Repository repository = 1;
+ }
+
+ Header header = 1 [(gitaly.target_repository) = true];
+}
+
+service InterceptedWithOperationType {
+ option (gitaly.intercepted) = true;
+
+ // intercepted services can't have operation type annotations.
+ rpc InvalidMethod(InvalidMethodRequest) returns (InvalidMethodResponse) {
+ option (gitaly.op_type) = {
+ op: ACCESSOR
+ };
+ }
+}
+
+service InvalidService {
+ // should fail if op_type extension is missing
+ rpc InvalidMethod0(InvalidMethodRequest) returns (InvalidMethodResponse) {}
+
+ // should fail if op type is unknown
+ rpc InvalidMethod1(InvalidMethodRequest) returns (InvalidMethodResponse) {
+ option (gitaly.op_type).op = UNKNOWN;
+ }
+ // should fail if target repo is not provided for accessor
+ rpc InvalidMethod2(InvalidMethodRequest) returns (InvalidMethodResponse) {
+ option (gitaly.op_type) = {
+ op: ACCESSOR
+ };
+ }
+ // should fail if missing either target repo or non-repo-scope for mutator
+ rpc InvalidMethod4(InvalidMethodRequest) returns (InvalidMethodResponse) {
+ option (gitaly.op_type).op = MUTATOR;
+ }
+
+ // should fail if repository is not of type Repository
+ rpc InvalidMethod5(RequestWithWrongTypeRepository) returns (InvalidMethodResponse) {
+ option (gitaly.op_type).op = MUTATOR;
+ }
+
+ // should fail if nested repository isn't flagged
+ rpc InvalidMethod6(RequestWithNestedRepoNotFlagged) returns (InvalidMethodResponse) {
+ option (gitaly.op_type).op = MUTATOR;
+ }
+ // should fail if target field type is not of type Repository
+ rpc InvalidMethod7(InvalidTargetType) returns (InvalidMethodResponse) {
+ option (gitaly.op_type) = {
+ op: MUTATOR
+ };
+ }
+
+ // should fail if nested target field type is not of type Repository
+ rpc InvalidMethod8(InvalidNestedRequest) returns (InvalidMethodResponse) {
+ option (gitaly.op_type) = {
+ op: MUTATOR
+ };
+ }
+ // should fail if target repo is specified for storage scoped RPC
+ rpc InvalidMethod9(InvalidMethodRequestWithRepo) returns (InvalidMethodResponse) {
+ option (gitaly.op_type) = {
+ op: MUTATOR
+ scope_level: STORAGE
+ };
+ }
+
+ // should fail if storage is specified for implicit repository scoped RPC
+ rpc InvalidMethod10(RequestWithStorageAndRepo) returns (InvalidMethodResponse) {
+ option (gitaly.op_type) = {
+ op: ACCESSOR
+ };
+ }
+
+ // should fail if storage is specified for repository scoped RPC
+ rpc InvalidMethod11(RequestWithNestedStorageAndRepo) returns (InvalidMethodResponse) {
+ option (gitaly.op_type) = {
+ op: MUTATOR
+ scope_level: REPOSITORY
+ };
+ }
+
+ // should fail if storage isn't specified for storage scoped RPC
+ rpc InvalidMethod13(InvalidTargetType) returns (InvalidMethodResponse) {
+ option (gitaly.op_type) = {
+ op: MUTATOR
+ scope_level: STORAGE
+ };
+ }
+
+ // should fail if multiple storage is specified for storage scoped RPC
+ rpc InvalidMethod14(RequestWithMultipleNestedStorage) returns (InvalidMethodResponse) {
+ option (gitaly.op_type) = {
+ op: MUTATOR
+ scope_level: STORAGE
+ };
+ }
+
+ // Intercepted methods must not have operation type annotations.
+ rpc InvalidMethod15(RequestWithStorageAndRepo) returns (InvalidMethodResponse) {
+ option (gitaly.intercepted_method) = true;
+ option (gitaly.op_type) = {};
+ };
+
+ rpc MaintenanceWithMissingRepository(InvalidMethodRequest) returns (InvalidMethodResponse) {
+ option (gitaly.op_type).op = MAINTENANCE;
+ }
+
+ rpc MaintenanceWithUnflaggedRepository(RequestWithNestedRepoNotFlagged) returns (InvalidMethodResponse) {
+ option (gitaly.op_type).op = MAINTENANCE;
+ }
+
+ rpc MaintenanceWithWrongNestedRepositoryType(RequestWithWrongTypeRepository) returns (InvalidMethodResponse) {
+ option (gitaly.op_type).op = MAINTENANCE;
+ }
+
+ rpc MaintenanceWithInvalidTargetType(InvalidTargetType) returns (InvalidMethodResponse) {
+ option (gitaly.op_type) = {
+ op: MAINTENANCE
+ };
+ }
+
+ rpc MaintenanceWithInvalidNestedRequest(InvalidNestedRequest) returns (InvalidMethodResponse) {
+ option (gitaly.op_type) = {
+ op: MAINTENANCE
+ };
+ }
+
+ rpc MaintenanceWithStorageAndRepository(RequestWithStorageAndRepo) returns (InvalidMethodResponse) {
+ option (gitaly.op_type) = {
+ op: MAINTENANCE
+ scope_level: REPOSITORY
+ };
+ }
+
+ rpc MaintenanceWithNestedStorageAndRepository(RequestWithNestedStorageAndRepo) returns (InvalidMethodResponse) {
+ option (gitaly.op_type) = {
+ op: MAINTENANCE
+ scope_level: REPOSITORY
+ };
+ }
+
+ rpc MaintenanceWithStorageScope(InvalidMethodRequestWithRepo) returns (InvalidMethodResponse) {
+ option (gitaly.op_type) = {
+ op: MAINTENANCE
+ scope_level: STORAGE
+ };
+ }
+
+}
diff --git a/tools/protoc-gen-gitaly-lint/testdata/invalid_grpc.pb.go b/tools/protoc-gen-gitaly-lint/testdata/invalid_grpc.pb.go
new file mode 100644
index 000000000..746f85a4c
--- /dev/null
+++ b/tools/protoc-gen-gitaly-lint/testdata/invalid_grpc.pb.go
@@ -0,0 +1,974 @@
+// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
+
+package testdata
+
+import (
+ context "context"
+ grpc "google.golang.org/grpc"
+ codes "google.golang.org/grpc/codes"
+ status "google.golang.org/grpc/status"
+)
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the grpc package it is being compiled against.
+// Requires gRPC-Go v1.32.0 or later.
+const _ = grpc.SupportPackageIsVersion7
+
+// InterceptedWithOperationTypeClient is the client API for InterceptedWithOperationType service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
+type InterceptedWithOperationTypeClient interface {
+ // intercepted services can't have operation type annotations.
+ InvalidMethod(ctx context.Context, in *InvalidMethodRequest, opts ...grpc.CallOption) (*InvalidMethodResponse, error)
+}
+
+type interceptedWithOperationTypeClient struct {
+ cc grpc.ClientConnInterface
+}
+
+func NewInterceptedWithOperationTypeClient(cc grpc.ClientConnInterface) InterceptedWithOperationTypeClient {
+ return &interceptedWithOperationTypeClient{cc}
+}
+
+func (c *interceptedWithOperationTypeClient) InvalidMethod(ctx context.Context, in *InvalidMethodRequest, opts ...grpc.CallOption) (*InvalidMethodResponse, error) {
+ out := new(InvalidMethodResponse)
+ err := c.cc.Invoke(ctx, "/test.InterceptedWithOperationType/InvalidMethod", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+// InterceptedWithOperationTypeServer is the server API for InterceptedWithOperationType service.
+// All implementations must embed UnimplementedInterceptedWithOperationTypeServer
+// for forward compatibility
+type InterceptedWithOperationTypeServer interface {
+ // intercepted services can't have operation type annotations.
+ InvalidMethod(context.Context, *InvalidMethodRequest) (*InvalidMethodResponse, error)
+ mustEmbedUnimplementedInterceptedWithOperationTypeServer()
+}
+
+// UnimplementedInterceptedWithOperationTypeServer must be embedded to have forward compatible implementations.
+type UnimplementedInterceptedWithOperationTypeServer struct {
+}
+
+func (UnimplementedInterceptedWithOperationTypeServer) InvalidMethod(context.Context, *InvalidMethodRequest) (*InvalidMethodResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method InvalidMethod not implemented")
+}
+func (UnimplementedInterceptedWithOperationTypeServer) mustEmbedUnimplementedInterceptedWithOperationTypeServer() {
+}
+
+// UnsafeInterceptedWithOperationTypeServer may be embedded to opt out of forward compatibility for this service.
+// Use of this interface is not recommended, as added methods to InterceptedWithOperationTypeServer will
+// result in compilation errors.
+type UnsafeInterceptedWithOperationTypeServer interface {
+ mustEmbedUnimplementedInterceptedWithOperationTypeServer()
+}
+
+func RegisterInterceptedWithOperationTypeServer(s grpc.ServiceRegistrar, srv InterceptedWithOperationTypeServer) {
+ s.RegisterService(&InterceptedWithOperationType_ServiceDesc, srv)
+}
+
+func _InterceptedWithOperationType_InvalidMethod_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.(InterceptedWithOperationTypeServer).InvalidMethod(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/test.InterceptedWithOperationType/InvalidMethod",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(InterceptedWithOperationTypeServer).InvalidMethod(ctx, req.(*InvalidMethodRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+// InterceptedWithOperationType_ServiceDesc is the grpc.ServiceDesc for InterceptedWithOperationType service.
+// It's only intended for direct use with grpc.RegisterService,
+// and not to be introspected or modified (even as a copy)
+var InterceptedWithOperationType_ServiceDesc = grpc.ServiceDesc{
+ ServiceName: "test.InterceptedWithOperationType",
+ HandlerType: (*InterceptedWithOperationTypeServer)(nil),
+ Methods: []grpc.MethodDesc{
+ {
+ MethodName: "InvalidMethod",
+ Handler: _InterceptedWithOperationType_InvalidMethod_Handler,
+ },
+ },
+ Streams: []grpc.StreamDesc{},
+ Metadata: "protoc-gen-gitaly-lint/testdata/invalid.proto",
+}
+
+// InvalidServiceClient is the client API for InvalidService service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#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 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 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)
+ // Intercepted methods must not have operation type annotations.
+ InvalidMethod15(ctx context.Context, in *RequestWithStorageAndRepo, opts ...grpc.CallOption) (*InvalidMethodResponse, error)
+ MaintenanceWithMissingRepository(ctx context.Context, in *InvalidMethodRequest, opts ...grpc.CallOption) (*InvalidMethodResponse, error)
+ MaintenanceWithUnflaggedRepository(ctx context.Context, in *RequestWithNestedRepoNotFlagged, opts ...grpc.CallOption) (*InvalidMethodResponse, error)
+ MaintenanceWithWrongNestedRepositoryType(ctx context.Context, in *RequestWithWrongTypeRepository, opts ...grpc.CallOption) (*InvalidMethodResponse, error)
+ MaintenanceWithInvalidTargetType(ctx context.Context, in *InvalidTargetType, opts ...grpc.CallOption) (*InvalidMethodResponse, error)
+ MaintenanceWithInvalidNestedRequest(ctx context.Context, in *InvalidNestedRequest, opts ...grpc.CallOption) (*InvalidMethodResponse, error)
+ MaintenanceWithStorageAndRepository(ctx context.Context, in *RequestWithStorageAndRepo, opts ...grpc.CallOption) (*InvalidMethodResponse, error)
+ MaintenanceWithNestedStorageAndRepository(ctx context.Context, in *RequestWithNestedStorageAndRepo, opts ...grpc.CallOption) (*InvalidMethodResponse, error)
+ MaintenanceWithStorageScope(ctx context.Context, in *InvalidMethodRequestWithRepo, opts ...grpc.CallOption) (*InvalidMethodResponse, error)
+}
+
+type invalidServiceClient struct {
+ cc grpc.ClientConnInterface
+}
+
+func NewInvalidServiceClient(cc grpc.ClientConnInterface) 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) 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) 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
+}
+
+func (c *invalidServiceClient) InvalidMethod15(ctx context.Context, in *RequestWithStorageAndRepo, opts ...grpc.CallOption) (*InvalidMethodResponse, error) {
+ out := new(InvalidMethodResponse)
+ err := c.cc.Invoke(ctx, "/test.InvalidService/InvalidMethod15", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *invalidServiceClient) MaintenanceWithMissingRepository(ctx context.Context, in *InvalidMethodRequest, opts ...grpc.CallOption) (*InvalidMethodResponse, error) {
+ out := new(InvalidMethodResponse)
+ err := c.cc.Invoke(ctx, "/test.InvalidService/MaintenanceWithMissingRepository", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *invalidServiceClient) MaintenanceWithUnflaggedRepository(ctx context.Context, in *RequestWithNestedRepoNotFlagged, opts ...grpc.CallOption) (*InvalidMethodResponse, error) {
+ out := new(InvalidMethodResponse)
+ err := c.cc.Invoke(ctx, "/test.InvalidService/MaintenanceWithUnflaggedRepository", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *invalidServiceClient) MaintenanceWithWrongNestedRepositoryType(ctx context.Context, in *RequestWithWrongTypeRepository, opts ...grpc.CallOption) (*InvalidMethodResponse, error) {
+ out := new(InvalidMethodResponse)
+ err := c.cc.Invoke(ctx, "/test.InvalidService/MaintenanceWithWrongNestedRepositoryType", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *invalidServiceClient) MaintenanceWithInvalidTargetType(ctx context.Context, in *InvalidTargetType, opts ...grpc.CallOption) (*InvalidMethodResponse, error) {
+ out := new(InvalidMethodResponse)
+ err := c.cc.Invoke(ctx, "/test.InvalidService/MaintenanceWithInvalidTargetType", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *invalidServiceClient) MaintenanceWithInvalidNestedRequest(ctx context.Context, in *InvalidNestedRequest, opts ...grpc.CallOption) (*InvalidMethodResponse, error) {
+ out := new(InvalidMethodResponse)
+ err := c.cc.Invoke(ctx, "/test.InvalidService/MaintenanceWithInvalidNestedRequest", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *invalidServiceClient) MaintenanceWithStorageAndRepository(ctx context.Context, in *RequestWithStorageAndRepo, opts ...grpc.CallOption) (*InvalidMethodResponse, error) {
+ out := new(InvalidMethodResponse)
+ err := c.cc.Invoke(ctx, "/test.InvalidService/MaintenanceWithStorageAndRepository", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *invalidServiceClient) MaintenanceWithNestedStorageAndRepository(ctx context.Context, in *RequestWithNestedStorageAndRepo, opts ...grpc.CallOption) (*InvalidMethodResponse, error) {
+ out := new(InvalidMethodResponse)
+ err := c.cc.Invoke(ctx, "/test.InvalidService/MaintenanceWithNestedStorageAndRepository", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *invalidServiceClient) MaintenanceWithStorageScope(ctx context.Context, in *InvalidMethodRequestWithRepo, opts ...grpc.CallOption) (*InvalidMethodResponse, error) {
+ out := new(InvalidMethodResponse)
+ err := c.cc.Invoke(ctx, "/test.InvalidService/MaintenanceWithStorageScope", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+// InvalidServiceServer is the server API for InvalidService service.
+// All implementations must embed UnimplementedInvalidServiceServer
+// for forward compatibility
+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 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 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)
+ // Intercepted methods must not have operation type annotations.
+ InvalidMethod15(context.Context, *RequestWithStorageAndRepo) (*InvalidMethodResponse, error)
+ MaintenanceWithMissingRepository(context.Context, *InvalidMethodRequest) (*InvalidMethodResponse, error)
+ MaintenanceWithUnflaggedRepository(context.Context, *RequestWithNestedRepoNotFlagged) (*InvalidMethodResponse, error)
+ MaintenanceWithWrongNestedRepositoryType(context.Context, *RequestWithWrongTypeRepository) (*InvalidMethodResponse, error)
+ MaintenanceWithInvalidTargetType(context.Context, *InvalidTargetType) (*InvalidMethodResponse, error)
+ MaintenanceWithInvalidNestedRequest(context.Context, *InvalidNestedRequest) (*InvalidMethodResponse, error)
+ MaintenanceWithStorageAndRepository(context.Context, *RequestWithStorageAndRepo) (*InvalidMethodResponse, error)
+ MaintenanceWithNestedStorageAndRepository(context.Context, *RequestWithNestedStorageAndRepo) (*InvalidMethodResponse, error)
+ MaintenanceWithStorageScope(context.Context, *InvalidMethodRequestWithRepo) (*InvalidMethodResponse, error)
+ mustEmbedUnimplementedInvalidServiceServer()
+}
+
+// UnimplementedInvalidServiceServer must be embedded to have forward compatible implementations.
+type UnimplementedInvalidServiceServer struct {
+}
+
+func (UnimplementedInvalidServiceServer) InvalidMethod0(context.Context, *InvalidMethodRequest) (*InvalidMethodResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method InvalidMethod0 not implemented")
+}
+func (UnimplementedInvalidServiceServer) InvalidMethod1(context.Context, *InvalidMethodRequest) (*InvalidMethodResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method InvalidMethod1 not implemented")
+}
+func (UnimplementedInvalidServiceServer) InvalidMethod2(context.Context, *InvalidMethodRequest) (*InvalidMethodResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method InvalidMethod2 not implemented")
+}
+func (UnimplementedInvalidServiceServer) InvalidMethod4(context.Context, *InvalidMethodRequest) (*InvalidMethodResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method InvalidMethod4 not implemented")
+}
+func (UnimplementedInvalidServiceServer) InvalidMethod5(context.Context, *RequestWithWrongTypeRepository) (*InvalidMethodResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method InvalidMethod5 not implemented")
+}
+func (UnimplementedInvalidServiceServer) InvalidMethod6(context.Context, *RequestWithNestedRepoNotFlagged) (*InvalidMethodResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method InvalidMethod6 not implemented")
+}
+func (UnimplementedInvalidServiceServer) InvalidMethod7(context.Context, *InvalidTargetType) (*InvalidMethodResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method InvalidMethod7 not implemented")
+}
+func (UnimplementedInvalidServiceServer) InvalidMethod8(context.Context, *InvalidNestedRequest) (*InvalidMethodResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method InvalidMethod8 not implemented")
+}
+func (UnimplementedInvalidServiceServer) InvalidMethod9(context.Context, *InvalidMethodRequestWithRepo) (*InvalidMethodResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method InvalidMethod9 not implemented")
+}
+func (UnimplementedInvalidServiceServer) InvalidMethod10(context.Context, *RequestWithStorageAndRepo) (*InvalidMethodResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method InvalidMethod10 not implemented")
+}
+func (UnimplementedInvalidServiceServer) InvalidMethod11(context.Context, *RequestWithNestedStorageAndRepo) (*InvalidMethodResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method InvalidMethod11 not implemented")
+}
+func (UnimplementedInvalidServiceServer) InvalidMethod13(context.Context, *InvalidTargetType) (*InvalidMethodResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method InvalidMethod13 not implemented")
+}
+func (UnimplementedInvalidServiceServer) InvalidMethod14(context.Context, *RequestWithMultipleNestedStorage) (*InvalidMethodResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method InvalidMethod14 not implemented")
+}
+func (UnimplementedInvalidServiceServer) InvalidMethod15(context.Context, *RequestWithStorageAndRepo) (*InvalidMethodResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method InvalidMethod15 not implemented")
+}
+func (UnimplementedInvalidServiceServer) MaintenanceWithMissingRepository(context.Context, *InvalidMethodRequest) (*InvalidMethodResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method MaintenanceWithMissingRepository not implemented")
+}
+func (UnimplementedInvalidServiceServer) MaintenanceWithUnflaggedRepository(context.Context, *RequestWithNestedRepoNotFlagged) (*InvalidMethodResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method MaintenanceWithUnflaggedRepository not implemented")
+}
+func (UnimplementedInvalidServiceServer) MaintenanceWithWrongNestedRepositoryType(context.Context, *RequestWithWrongTypeRepository) (*InvalidMethodResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method MaintenanceWithWrongNestedRepositoryType not implemented")
+}
+func (UnimplementedInvalidServiceServer) MaintenanceWithInvalidTargetType(context.Context, *InvalidTargetType) (*InvalidMethodResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method MaintenanceWithInvalidTargetType not implemented")
+}
+func (UnimplementedInvalidServiceServer) MaintenanceWithInvalidNestedRequest(context.Context, *InvalidNestedRequest) (*InvalidMethodResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method MaintenanceWithInvalidNestedRequest not implemented")
+}
+func (UnimplementedInvalidServiceServer) MaintenanceWithStorageAndRepository(context.Context, *RequestWithStorageAndRepo) (*InvalidMethodResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method MaintenanceWithStorageAndRepository not implemented")
+}
+func (UnimplementedInvalidServiceServer) MaintenanceWithNestedStorageAndRepository(context.Context, *RequestWithNestedStorageAndRepo) (*InvalidMethodResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method MaintenanceWithNestedStorageAndRepository not implemented")
+}
+func (UnimplementedInvalidServiceServer) MaintenanceWithStorageScope(context.Context, *InvalidMethodRequestWithRepo) (*InvalidMethodResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method MaintenanceWithStorageScope not implemented")
+}
+func (UnimplementedInvalidServiceServer) mustEmbedUnimplementedInvalidServiceServer() {}
+
+// UnsafeInvalidServiceServer may be embedded to opt out of forward compatibility for this service.
+// Use of this interface is not recommended, as added methods to InvalidServiceServer will
+// result in compilation errors.
+type UnsafeInvalidServiceServer interface {
+ mustEmbedUnimplementedInvalidServiceServer()
+}
+
+func RegisterInvalidServiceServer(s grpc.ServiceRegistrar, 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_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_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)
+}
+
+func _InvalidService_InvalidMethod15_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).InvalidMethod15(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/test.InvalidService/InvalidMethod15",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(InvalidServiceServer).InvalidMethod15(ctx, req.(*RequestWithStorageAndRepo))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _InvalidService_MaintenanceWithMissingRepository_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).MaintenanceWithMissingRepository(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/test.InvalidService/MaintenanceWithMissingRepository",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(InvalidServiceServer).MaintenanceWithMissingRepository(ctx, req.(*InvalidMethodRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _InvalidService_MaintenanceWithUnflaggedRepository_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).MaintenanceWithUnflaggedRepository(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/test.InvalidService/MaintenanceWithUnflaggedRepository",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(InvalidServiceServer).MaintenanceWithUnflaggedRepository(ctx, req.(*RequestWithNestedRepoNotFlagged))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _InvalidService_MaintenanceWithWrongNestedRepositoryType_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).MaintenanceWithWrongNestedRepositoryType(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/test.InvalidService/MaintenanceWithWrongNestedRepositoryType",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(InvalidServiceServer).MaintenanceWithWrongNestedRepositoryType(ctx, req.(*RequestWithWrongTypeRepository))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _InvalidService_MaintenanceWithInvalidTargetType_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).MaintenanceWithInvalidTargetType(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/test.InvalidService/MaintenanceWithInvalidTargetType",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(InvalidServiceServer).MaintenanceWithInvalidTargetType(ctx, req.(*InvalidTargetType))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _InvalidService_MaintenanceWithInvalidNestedRequest_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).MaintenanceWithInvalidNestedRequest(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/test.InvalidService/MaintenanceWithInvalidNestedRequest",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(InvalidServiceServer).MaintenanceWithInvalidNestedRequest(ctx, req.(*InvalidNestedRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _InvalidService_MaintenanceWithStorageAndRepository_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).MaintenanceWithStorageAndRepository(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/test.InvalidService/MaintenanceWithStorageAndRepository",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(InvalidServiceServer).MaintenanceWithStorageAndRepository(ctx, req.(*RequestWithStorageAndRepo))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _InvalidService_MaintenanceWithNestedStorageAndRepository_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).MaintenanceWithNestedStorageAndRepository(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/test.InvalidService/MaintenanceWithNestedStorageAndRepository",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(InvalidServiceServer).MaintenanceWithNestedStorageAndRepository(ctx, req.(*RequestWithNestedStorageAndRepo))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _InvalidService_MaintenanceWithStorageScope_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).MaintenanceWithStorageScope(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/test.InvalidService/MaintenanceWithStorageScope",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(InvalidServiceServer).MaintenanceWithStorageScope(ctx, req.(*InvalidMethodRequestWithRepo))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+// InvalidService_ServiceDesc is the grpc.ServiceDesc for InvalidService service.
+// It's only intended for direct use with grpc.RegisterService,
+// and not to be introspected or modified (even as a copy)
+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: "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: "InvalidMethod13",
+ Handler: _InvalidService_InvalidMethod13_Handler,
+ },
+ {
+ MethodName: "InvalidMethod14",
+ Handler: _InvalidService_InvalidMethod14_Handler,
+ },
+ {
+ MethodName: "InvalidMethod15",
+ Handler: _InvalidService_InvalidMethod15_Handler,
+ },
+ {
+ MethodName: "MaintenanceWithMissingRepository",
+ Handler: _InvalidService_MaintenanceWithMissingRepository_Handler,
+ },
+ {
+ MethodName: "MaintenanceWithUnflaggedRepository",
+ Handler: _InvalidService_MaintenanceWithUnflaggedRepository_Handler,
+ },
+ {
+ MethodName: "MaintenanceWithWrongNestedRepositoryType",
+ Handler: _InvalidService_MaintenanceWithWrongNestedRepositoryType_Handler,
+ },
+ {
+ MethodName: "MaintenanceWithInvalidTargetType",
+ Handler: _InvalidService_MaintenanceWithInvalidTargetType_Handler,
+ },
+ {
+ MethodName: "MaintenanceWithInvalidNestedRequest",
+ Handler: _InvalidService_MaintenanceWithInvalidNestedRequest_Handler,
+ },
+ {
+ MethodName: "MaintenanceWithStorageAndRepository",
+ Handler: _InvalidService_MaintenanceWithStorageAndRepository_Handler,
+ },
+ {
+ MethodName: "MaintenanceWithNestedStorageAndRepository",
+ Handler: _InvalidService_MaintenanceWithNestedStorageAndRepository_Handler,
+ },
+ {
+ MethodName: "MaintenanceWithStorageScope",
+ Handler: _InvalidService_MaintenanceWithStorageScope_Handler,
+ },
+ },
+ Streams: []grpc.StreamDesc{},
+ Metadata: "protoc-gen-gitaly-lint/testdata/invalid.proto",
+}
diff --git a/tools/protoc-gen-gitaly-lint/testdata/valid.pb.go b/tools/protoc-gen-gitaly-lint/testdata/valid.pb.go
new file mode 100644
index 000000000..c49093be0
--- /dev/null
+++ b/tools/protoc-gen-gitaly-lint/testdata/valid.pb.go
@@ -0,0 +1,890 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.26.0
+// protoc v3.17.3
+// source: protoc-gen-gitaly-lint/testdata/valid.proto
+
+package testdata
+
+import (
+ gitalypb "gitlab.com/gitlab-org/gitaly/v14/proto/go/gitalypb"
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+ reflect "reflect"
+ sync "sync"
+)
+
+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)
+)
+
+type ValidRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Destination *gitalypb.Repository `protobuf:"bytes,1,opt,name=destination,proto3" json:"destination,omitempty"`
+}
+
+func (x *ValidRequest) Reset() {
+ *x = ValidRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_protoc_gen_gitaly_lint_testdata_valid_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ValidRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ValidRequest) ProtoMessage() {}
+
+func (x *ValidRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_protoc_gen_gitaly_lint_testdata_valid_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 mi.MessageOf(x)
+}
+
+// Deprecated: Use ValidRequest.ProtoReflect.Descriptor instead.
+func (*ValidRequest) Descriptor() ([]byte, []int) {
+ return file_protoc_gen_gitaly_lint_testdata_valid_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *ValidRequest) GetDestination() *gitalypb.Repository {
+ if x != nil {
+ return x.Destination
+ }
+ return nil
+}
+
+type ValidRequestWithoutRepo struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+}
+
+func (x *ValidRequestWithoutRepo) Reset() {
+ *x = ValidRequestWithoutRepo{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_protoc_gen_gitaly_lint_testdata_valid_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ValidRequestWithoutRepo) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ValidRequestWithoutRepo) ProtoMessage() {}
+
+func (x *ValidRequestWithoutRepo) ProtoReflect() protoreflect.Message {
+ mi := &file_protoc_gen_gitaly_lint_testdata_valid_proto_msgTypes[1]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use ValidRequestWithoutRepo.ProtoReflect.Descriptor instead.
+func (*ValidRequestWithoutRepo) Descriptor() ([]byte, []int) {
+ return file_protoc_gen_gitaly_lint_testdata_valid_proto_rawDescGZIP(), []int{1}
+}
+
+type ValidStorageRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ StorageName string `protobuf:"bytes,1,opt,name=storage_name,json=storageName,proto3" json:"storage_name,omitempty"`
+}
+
+func (x *ValidStorageRequest) Reset() {
+ *x = ValidStorageRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_protoc_gen_gitaly_lint_testdata_valid_proto_msgTypes[2]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ValidStorageRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ValidStorageRequest) ProtoMessage() {}
+
+func (x *ValidStorageRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_protoc_gen_gitaly_lint_testdata_valid_proto_msgTypes[2]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use ValidStorageRequest.ProtoReflect.Descriptor instead.
+func (*ValidStorageRequest) Descriptor() ([]byte, []int) {
+ return file_protoc_gen_gitaly_lint_testdata_valid_proto_rawDescGZIP(), []int{2}
+}
+
+func (x *ValidStorageRequest) GetStorageName() string {
+ if x != nil {
+ return x.StorageName
+ }
+ return ""
+}
+
+type ValidResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+}
+
+func (x *ValidResponse) Reset() {
+ *x = ValidResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_protoc_gen_gitaly_lint_testdata_valid_proto_msgTypes[3]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ValidResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ValidResponse) ProtoMessage() {}
+
+func (x *ValidResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_protoc_gen_gitaly_lint_testdata_valid_proto_msgTypes[3]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use ValidResponse.ProtoReflect.Descriptor instead.
+func (*ValidResponse) Descriptor() ([]byte, []int) {
+ return file_protoc_gen_gitaly_lint_testdata_valid_proto_rawDescGZIP(), []int{3}
+}
+
+type ValidNestedRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ InnerMessage *ValidRequest `protobuf:"bytes,1,opt,name=inner_message,json=innerMessage,proto3" json:"inner_message,omitempty"`
+}
+
+func (x *ValidNestedRequest) Reset() {
+ *x = ValidNestedRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_protoc_gen_gitaly_lint_testdata_valid_proto_msgTypes[4]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ValidNestedRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ValidNestedRequest) ProtoMessage() {}
+
+func (x *ValidNestedRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_protoc_gen_gitaly_lint_testdata_valid_proto_msgTypes[4]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use ValidNestedRequest.ProtoReflect.Descriptor instead.
+func (*ValidNestedRequest) Descriptor() ([]byte, []int) {
+ return file_protoc_gen_gitaly_lint_testdata_valid_proto_rawDescGZIP(), []int{4}
+}
+
+func (x *ValidNestedRequest) GetInnerMessage() *ValidRequest {
+ if x != nil {
+ return x.InnerMessage
+ }
+ return nil
+}
+
+type ValidStorageNestedRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ InnerMessage *ValidStorageRequest `protobuf:"bytes,1,opt,name=inner_message,json=innerMessage,proto3" json:"inner_message,omitempty"`
+}
+
+func (x *ValidStorageNestedRequest) Reset() {
+ *x = ValidStorageNestedRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_protoc_gen_gitaly_lint_testdata_valid_proto_msgTypes[5]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ValidStorageNestedRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ValidStorageNestedRequest) ProtoMessage() {}
+
+func (x *ValidStorageNestedRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_protoc_gen_gitaly_lint_testdata_valid_proto_msgTypes[5]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use ValidStorageNestedRequest.ProtoReflect.Descriptor instead.
+func (*ValidStorageNestedRequest) Descriptor() ([]byte, []int) {
+ return file_protoc_gen_gitaly_lint_testdata_valid_proto_rawDescGZIP(), []int{5}
+}
+
+func (x *ValidStorageNestedRequest) GetInnerMessage() *ValidStorageRequest {
+ if x != nil {
+ return x.InnerMessage
+ }
+ return nil
+}
+
+type ValidNestedSharedRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ NestedTargetRepo *gitalypb.ObjectPool `protobuf:"bytes,1,opt,name=nested_target_repo,json=nestedTargetRepo,proto3" json:"nested_target_repo,omitempty"`
+}
+
+func (x *ValidNestedSharedRequest) Reset() {
+ *x = ValidNestedSharedRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_protoc_gen_gitaly_lint_testdata_valid_proto_msgTypes[6]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ValidNestedSharedRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ValidNestedSharedRequest) ProtoMessage() {}
+
+func (x *ValidNestedSharedRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_protoc_gen_gitaly_lint_testdata_valid_proto_msgTypes[6]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use ValidNestedSharedRequest.ProtoReflect.Descriptor instead.
+func (*ValidNestedSharedRequest) Descriptor() ([]byte, []int) {
+ return file_protoc_gen_gitaly_lint_testdata_valid_proto_rawDescGZIP(), []int{6}
+}
+
+func (x *ValidNestedSharedRequest) GetNestedTargetRepo() *gitalypb.ObjectPool {
+ if x != nil {
+ return x.NestedTargetRepo
+ }
+ return nil
+}
+
+type ValidInnerNestedRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Header *ValidInnerNestedRequest_Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
+}
+
+func (x *ValidInnerNestedRequest) Reset() {
+ *x = ValidInnerNestedRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_protoc_gen_gitaly_lint_testdata_valid_proto_msgTypes[7]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ValidInnerNestedRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ValidInnerNestedRequest) ProtoMessage() {}
+
+func (x *ValidInnerNestedRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_protoc_gen_gitaly_lint_testdata_valid_proto_msgTypes[7]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use ValidInnerNestedRequest.ProtoReflect.Descriptor instead.
+func (*ValidInnerNestedRequest) Descriptor() ([]byte, []int) {
+ return file_protoc_gen_gitaly_lint_testdata_valid_proto_rawDescGZIP(), []int{7}
+}
+
+func (x *ValidInnerNestedRequest) GetHeader() *ValidInnerNestedRequest_Header {
+ if x != nil {
+ return x.Header
+ }
+ return nil
+}
+
+type ValidStorageInnerNestedRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Header *ValidStorageInnerNestedRequest_Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
+}
+
+func (x *ValidStorageInnerNestedRequest) Reset() {
+ *x = ValidStorageInnerNestedRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_protoc_gen_gitaly_lint_testdata_valid_proto_msgTypes[8]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ValidStorageInnerNestedRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ValidStorageInnerNestedRequest) ProtoMessage() {}
+
+func (x *ValidStorageInnerNestedRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_protoc_gen_gitaly_lint_testdata_valid_proto_msgTypes[8]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use ValidStorageInnerNestedRequest.ProtoReflect.Descriptor instead.
+func (*ValidStorageInnerNestedRequest) Descriptor() ([]byte, []int) {
+ return file_protoc_gen_gitaly_lint_testdata_valid_proto_rawDescGZIP(), []int{8}
+}
+
+func (x *ValidStorageInnerNestedRequest) GetHeader() *ValidStorageInnerNestedRequest_Header {
+ if x != nil {
+ return x.Header
+ }
+ return nil
+}
+
+type ValidInnerNestedRequest_Header struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Destination *gitalypb.Repository `protobuf:"bytes,1,opt,name=destination,proto3" json:"destination,omitempty"`
+}
+
+func (x *ValidInnerNestedRequest_Header) Reset() {
+ *x = ValidInnerNestedRequest_Header{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_protoc_gen_gitaly_lint_testdata_valid_proto_msgTypes[9]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ValidInnerNestedRequest_Header) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ValidInnerNestedRequest_Header) ProtoMessage() {}
+
+func (x *ValidInnerNestedRequest_Header) ProtoReflect() protoreflect.Message {
+ mi := &file_protoc_gen_gitaly_lint_testdata_valid_proto_msgTypes[9]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use ValidInnerNestedRequest_Header.ProtoReflect.Descriptor instead.
+func (*ValidInnerNestedRequest_Header) Descriptor() ([]byte, []int) {
+ return file_protoc_gen_gitaly_lint_testdata_valid_proto_rawDescGZIP(), []int{7, 0}
+}
+
+func (x *ValidInnerNestedRequest_Header) GetDestination() *gitalypb.Repository {
+ if x != nil {
+ return x.Destination
+ }
+ return nil
+}
+
+type ValidStorageInnerNestedRequest_Header struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ StorageName string `protobuf:"bytes,1,opt,name=storage_name,json=storageName,proto3" json:"storage_name,omitempty"`
+}
+
+func (x *ValidStorageInnerNestedRequest_Header) Reset() {
+ *x = ValidStorageInnerNestedRequest_Header{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_protoc_gen_gitaly_lint_testdata_valid_proto_msgTypes[10]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ValidStorageInnerNestedRequest_Header) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ValidStorageInnerNestedRequest_Header) ProtoMessage() {}
+
+func (x *ValidStorageInnerNestedRequest_Header) ProtoReflect() protoreflect.Message {
+ mi := &file_protoc_gen_gitaly_lint_testdata_valid_proto_msgTypes[10]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use ValidStorageInnerNestedRequest_Header.ProtoReflect.Descriptor instead.
+func (*ValidStorageInnerNestedRequest_Header) Descriptor() ([]byte, []int) {
+ return file_protoc_gen_gitaly_lint_testdata_valid_proto_rawDescGZIP(), []int{8, 0}
+}
+
+func (x *ValidStorageInnerNestedRequest_Header) GetStorageName() string {
+ if x != nil {
+ return x.StorageName
+ }
+ return ""
+}
+
+var File_protoc_gen_gitaly_lint_testdata_valid_proto protoreflect.FileDescriptor
+
+var file_protoc_gen_gitaly_lint_testdata_valid_proto_rawDesc = []byte{
+ 0x0a, 0x2b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x69, 0x74,
+ 0x61, 0x6c, 0x79, 0x2d, 0x6c, 0x69, 0x6e, 0x74, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74,
+ 0x61, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x74,
+ 0x65, 0x73, 0x74, 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, 0x22, 0x4a, 0x0a,
+ 0x0c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3a, 0x0a,
+ 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 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, 0x0b, 0x64, 0x65,
+ 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x19, 0x0a, 0x17, 0x56, 0x61, 0x6c,
+ 0x69, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74,
+ 0x52, 0x65, 0x70, 0x6f, 0x22, 0x3e, 0x0a, 0x13, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x53, 0x74, 0x6f,
+ 0x72, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x0c, 0x73,
+ 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
+ 0x09, 0x42, 0x04, 0x88, 0xc6, 0x2c, 0x01, 0x52, 0x0b, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65,
+ 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x0f, 0x0a, 0x0d, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x52, 0x65, 0x73,
+ 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4d, 0x0a, 0x12, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x4e, 0x65,
+ 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x0d, 0x69,
+ 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01,
+ 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x52,
+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0c, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x4d, 0x65, 0x73,
+ 0x73, 0x61, 0x67, 0x65, 0x22, 0x5b, 0x0a, 0x19, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x53, 0x74, 0x6f,
+ 0x72, 0x61, 0x67, 0x65, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
+ 0x74, 0x12, 0x3e, 0x0a, 0x0d, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61,
+ 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e,
+ 0x56, 0x61, 0x6c, 0x69, 0x64, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75,
+ 0x65, 0x73, 0x74, 0x52, 0x0c, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
+ 0x65, 0x22, 0x62, 0x0a, 0x18, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64,
+ 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a,
+ 0x12, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x72,
+ 0x65, 0x70, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x69, 0x74, 0x61,
+ 0x6c, 0x79, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x6f, 0x6f, 0x6c, 0x42, 0x04, 0x98,
+ 0xc6, 0x2c, 0x01, 0x52, 0x10, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65,
+ 0x74, 0x52, 0x65, 0x70, 0x6f, 0x22, 0x9d, 0x01, 0x0a, 0x17, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x49,
+ 0x6e, 0x6e, 0x65, 0x72, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
+ 0x74, 0x12, 0x3c, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28,
+ 0x0b, 0x32, 0x24, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x49, 0x6e,
+ 0x6e, 0x65, 0x72, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
+ 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a,
+ 0x44, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x3a, 0x0a, 0x0b, 0x64, 0x65, 0x73,
+ 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 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, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x98, 0x01, 0x0a, 0x1e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x53,
+ 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x4e, 0x65, 0x73, 0x74, 0x65,
+ 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x43, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64,
+ 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e,
+ 0x56, 0x61, 0x6c, 0x69, 0x64, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x6e, 0x65,
+ 0x72, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x48,
+ 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x31, 0x0a,
+ 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x61,
+ 0x67, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0x88,
+ 0xc6, 0x2c, 0x01, 0x52, 0x0b, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x4e, 0x61, 0x6d, 0x65,
+ 0x32, 0x51, 0x0a, 0x12, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x53,
+ 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x35, 0x0a, 0x0a, 0x54, 0x65, 0x73, 0x74, 0x4d, 0x65,
+ 0x74, 0x68, 0x6f, 0x64, 0x12, 0x12, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x56, 0x61, 0x6c, 0x69,
+ 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e,
+ 0x56, 0x61, 0x6c, 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x04, 0xf0,
+ 0x97, 0x28, 0x01, 0x32, 0xc4, 0x08, 0x0a, 0x0c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x53, 0x65, 0x72,
+ 0x76, 0x69, 0x63, 0x65, 0x12, 0x3d, 0x0a, 0x0a, 0x54, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x68,
+ 0x6f, 0x64, 0x12, 0x12, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x52,
+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x56, 0x61,
+ 0x6c, 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28,
+ 0x02, 0x08, 0x02, 0x12, 0x3e, 0x0a, 0x0b, 0x54, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x68, 0x6f,
+ 0x64, 0x32, 0x12, 0x12, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x52,
+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x56, 0x61,
+ 0x6c, 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28,
+ 0x02, 0x08, 0x01, 0x12, 0x3e, 0x0a, 0x0b, 0x54, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x68, 0x6f,
+ 0x64, 0x33, 0x12, 0x12, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x52,
+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x56, 0x61,
+ 0x6c, 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28,
+ 0x02, 0x08, 0x01, 0x12, 0x44, 0x0a, 0x0b, 0x54, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x68, 0x6f,
+ 0x64, 0x35, 0x12, 0x18, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x4e,
+ 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x74,
+ 0x65, 0x73, 0x74, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
+ 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x01, 0x12, 0x4a, 0x0a, 0x0b, 0x54, 0x65, 0x73,
+ 0x74, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x36, 0x12, 0x1e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e,
+ 0x56, 0x61, 0x6c, 0x69, 0x64, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x53, 0x68, 0x61, 0x72, 0x65,
+ 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e,
+ 0x56, 0x61, 0x6c, 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa,
+ 0x97, 0x28, 0x02, 0x08, 0x01, 0x12, 0x49, 0x0a, 0x0b, 0x54, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74,
+ 0x68, 0x6f, 0x64, 0x37, 0x12, 0x1d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x56, 0x61, 0x6c, 0x69,
+ 0x64, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75,
+ 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64,
+ 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x01,
+ 0x12, 0x47, 0x0a, 0x0b, 0x54, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x38, 0x12,
+ 0x19, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x53, 0x74, 0x6f, 0x72,
+ 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x74, 0x65, 0x73,
+ 0x74, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
+ 0x08, 0xfa, 0x97, 0x28, 0x04, 0x08, 0x01, 0x10, 0x02, 0x12, 0x4d, 0x0a, 0x0b, 0x54, 0x65, 0x73,
+ 0x74, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x39, 0x12, 0x1f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e,
+ 0x56, 0x61, 0x6c, 0x69, 0x64, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x4e, 0x65, 0x73, 0x74,
+ 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x74, 0x65, 0x73, 0x74,
+ 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x08,
+ 0xfa, 0x97, 0x28, 0x04, 0x08, 0x01, 0x10, 0x02, 0x12, 0x44, 0x0a, 0x0c, 0x54, 0x65, 0x73, 0x74,
+ 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x31, 0x30, 0x12, 0x19, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e,
+ 0x56, 0x61, 0x6c, 0x69, 0x64, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75,
+ 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64,
+ 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x04, 0x80, 0x98, 0x28, 0x01, 0x12, 0x42,
+ 0x0a, 0x0f, 0x54, 0x65, 0x73, 0x74, 0x4d, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x63,
+ 0x65, 0x12, 0x12, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x52, 0x65,
+ 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x56, 0x61, 0x6c,
+ 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02,
+ 0x08, 0x03, 0x12, 0x53, 0x0a, 0x20, 0x54, 0x65, 0x73, 0x74, 0x4d, 0x61, 0x69, 0x6e, 0x74, 0x65,
+ 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x57, 0x69, 0x74, 0x68, 0x45, 0x78, 0x70, 0x6c, 0x69, 0x63, 0x69,
+ 0x74, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x12, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x56, 0x61,
+ 0x6c, 0x69, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x74, 0x65, 0x73,
+ 0x74, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
+ 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x03, 0x12, 0x59, 0x0a, 0x20, 0x54, 0x65, 0x73, 0x74, 0x4d,
+ 0x61, 0x69, 0x6e, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x65,
+ 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x2e, 0x74, 0x65,
+ 0x73, 0x74, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65,
+ 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x56, 0x61, 0x6c,
+ 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02,
+ 0x08, 0x03, 0x12, 0x65, 0x0a, 0x26, 0x54, 0x65, 0x73, 0x74, 0x4d, 0x61, 0x69, 0x6e, 0x74, 0x65,
+ 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x53,
+ 0x68, 0x61, 0x72, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x2e, 0x74,
+ 0x65, 0x73, 0x74, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x53,
+ 0x68, 0x61, 0x72, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x74,
+ 0x65, 0x73, 0x74, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
+ 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x03, 0x12, 0x5f, 0x0a, 0x21, 0x54, 0x65, 0x73,
+ 0x74, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x6f, 0x72, 0x57, 0x69, 0x74, 0x68, 0x49, 0x6e, 0x6e, 0x65,
+ 0x72, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d,
+ 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x49, 0x6e, 0x6e, 0x65, 0x72,
+ 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e,
+ 0x74, 0x65, 0x73, 0x74, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
+ 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x03, 0x42, 0x48, 0x5a, 0x46, 0x67, 0x69,
+ 0x74, 0x6c, 0x61, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2d,
+ 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2f, 0x76, 0x31, 0x34, 0x2f, 0x74,
+ 0x6f, 0x6f, 0x6c, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d,
+ 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2d, 0x6c, 0x69, 0x6e, 0x74, 0x2f, 0x74, 0x65, 0x73, 0x74,
+ 0x64, 0x61, 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+}
+
+var (
+ file_protoc_gen_gitaly_lint_testdata_valid_proto_rawDescOnce sync.Once
+ file_protoc_gen_gitaly_lint_testdata_valid_proto_rawDescData = file_protoc_gen_gitaly_lint_testdata_valid_proto_rawDesc
+)
+
+func file_protoc_gen_gitaly_lint_testdata_valid_proto_rawDescGZIP() []byte {
+ file_protoc_gen_gitaly_lint_testdata_valid_proto_rawDescOnce.Do(func() {
+ file_protoc_gen_gitaly_lint_testdata_valid_proto_rawDescData = protoimpl.X.CompressGZIP(file_protoc_gen_gitaly_lint_testdata_valid_proto_rawDescData)
+ })
+ return file_protoc_gen_gitaly_lint_testdata_valid_proto_rawDescData
+}
+
+var file_protoc_gen_gitaly_lint_testdata_valid_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
+var file_protoc_gen_gitaly_lint_testdata_valid_proto_goTypes = []interface{}{
+ (*ValidRequest)(nil), // 0: test.ValidRequest
+ (*ValidRequestWithoutRepo)(nil), // 1: test.ValidRequestWithoutRepo
+ (*ValidStorageRequest)(nil), // 2: test.ValidStorageRequest
+ (*ValidResponse)(nil), // 3: test.ValidResponse
+ (*ValidNestedRequest)(nil), // 4: test.ValidNestedRequest
+ (*ValidStorageNestedRequest)(nil), // 5: test.ValidStorageNestedRequest
+ (*ValidNestedSharedRequest)(nil), // 6: test.ValidNestedSharedRequest
+ (*ValidInnerNestedRequest)(nil), // 7: test.ValidInnerNestedRequest
+ (*ValidStorageInnerNestedRequest)(nil), // 8: test.ValidStorageInnerNestedRequest
+ (*ValidInnerNestedRequest_Header)(nil), // 9: test.ValidInnerNestedRequest.Header
+ (*ValidStorageInnerNestedRequest_Header)(nil), // 10: test.ValidStorageInnerNestedRequest.Header
+ (*gitalypb.Repository)(nil), // 11: gitaly.Repository
+ (*gitalypb.ObjectPool)(nil), // 12: gitaly.ObjectPool
+}
+var file_protoc_gen_gitaly_lint_testdata_valid_proto_depIdxs = []int32{
+ 11, // 0: test.ValidRequest.destination:type_name -> gitaly.Repository
+ 0, // 1: test.ValidNestedRequest.inner_message:type_name -> test.ValidRequest
+ 2, // 2: test.ValidStorageNestedRequest.inner_message:type_name -> test.ValidStorageRequest
+ 12, // 3: test.ValidNestedSharedRequest.nested_target_repo:type_name -> gitaly.ObjectPool
+ 9, // 4: test.ValidInnerNestedRequest.header:type_name -> test.ValidInnerNestedRequest.Header
+ 10, // 5: test.ValidStorageInnerNestedRequest.header:type_name -> test.ValidStorageInnerNestedRequest.Header
+ 11, // 6: test.ValidInnerNestedRequest.Header.destination:type_name -> gitaly.Repository
+ 0, // 7: test.InterceptedService.TestMethod:input_type -> test.ValidRequest
+ 0, // 8: test.ValidService.TestMethod:input_type -> test.ValidRequest
+ 0, // 9: test.ValidService.TestMethod2:input_type -> test.ValidRequest
+ 0, // 10: test.ValidService.TestMethod3:input_type -> test.ValidRequest
+ 4, // 11: test.ValidService.TestMethod5:input_type -> test.ValidNestedRequest
+ 6, // 12: test.ValidService.TestMethod6:input_type -> test.ValidNestedSharedRequest
+ 7, // 13: test.ValidService.TestMethod7:input_type -> test.ValidInnerNestedRequest
+ 2, // 14: test.ValidService.TestMethod8:input_type -> test.ValidStorageRequest
+ 5, // 15: test.ValidService.TestMethod9:input_type -> test.ValidStorageNestedRequest
+ 2, // 16: test.ValidService.TestMethod10:input_type -> test.ValidStorageRequest
+ 0, // 17: test.ValidService.TestMaintenance:input_type -> test.ValidRequest
+ 0, // 18: test.ValidService.TestMaintenanceWithExplicitScope:input_type -> test.ValidRequest
+ 4, // 19: test.ValidService.TestMaintenanceWithNestedRequest:input_type -> test.ValidNestedRequest
+ 6, // 20: test.ValidService.TestMaintenanceWithNestedSharedRequest:input_type -> test.ValidNestedSharedRequest
+ 7, // 21: test.ValidService.TestMutatorWithInnerNestedRequest:input_type -> test.ValidInnerNestedRequest
+ 3, // 22: test.InterceptedService.TestMethod:output_type -> test.ValidResponse
+ 3, // 23: test.ValidService.TestMethod:output_type -> test.ValidResponse
+ 3, // 24: test.ValidService.TestMethod2:output_type -> test.ValidResponse
+ 3, // 25: test.ValidService.TestMethod3:output_type -> test.ValidResponse
+ 3, // 26: test.ValidService.TestMethod5:output_type -> test.ValidResponse
+ 3, // 27: test.ValidService.TestMethod6:output_type -> test.ValidResponse
+ 3, // 28: test.ValidService.TestMethod7:output_type -> test.ValidResponse
+ 3, // 29: test.ValidService.TestMethod8:output_type -> test.ValidResponse
+ 3, // 30: test.ValidService.TestMethod9:output_type -> test.ValidResponse
+ 3, // 31: test.ValidService.TestMethod10:output_type -> test.ValidResponse
+ 3, // 32: test.ValidService.TestMaintenance:output_type -> test.ValidResponse
+ 3, // 33: test.ValidService.TestMaintenanceWithExplicitScope:output_type -> test.ValidResponse
+ 3, // 34: test.ValidService.TestMaintenanceWithNestedRequest:output_type -> test.ValidResponse
+ 3, // 35: test.ValidService.TestMaintenanceWithNestedSharedRequest:output_type -> test.ValidResponse
+ 3, // 36: test.ValidService.TestMutatorWithInnerNestedRequest:output_type -> test.ValidResponse
+ 22, // [22:37] is the sub-list for method output_type
+ 7, // [7:22] is the sub-list for method input_type
+ 7, // [7:7] is the sub-list for extension type_name
+ 7, // [7:7] is the sub-list for extension extendee
+ 0, // [0:7] is the sub-list for field type_name
+}
+
+func init() { file_protoc_gen_gitaly_lint_testdata_valid_proto_init() }
+func file_protoc_gen_gitaly_lint_testdata_valid_proto_init() {
+ if File_protoc_gen_gitaly_lint_testdata_valid_proto != nil {
+ return
+ }
+ if !protoimpl.UnsafeEnabled {
+ file_protoc_gen_gitaly_lint_testdata_valid_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ValidRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_protoc_gen_gitaly_lint_testdata_valid_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ValidRequestWithoutRepo); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_protoc_gen_gitaly_lint_testdata_valid_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ValidStorageRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_protoc_gen_gitaly_lint_testdata_valid_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ValidResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_protoc_gen_gitaly_lint_testdata_valid_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ValidNestedRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_protoc_gen_gitaly_lint_testdata_valid_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ValidStorageNestedRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_protoc_gen_gitaly_lint_testdata_valid_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ValidNestedSharedRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_protoc_gen_gitaly_lint_testdata_valid_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ValidInnerNestedRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_protoc_gen_gitaly_lint_testdata_valid_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ValidStorageInnerNestedRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_protoc_gen_gitaly_lint_testdata_valid_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ValidInnerNestedRequest_Header); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_protoc_gen_gitaly_lint_testdata_valid_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ValidStorageInnerNestedRequest_Header); 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_protoc_gen_gitaly_lint_testdata_valid_proto_rawDesc,
+ NumEnums: 0,
+ NumMessages: 11,
+ NumExtensions: 0,
+ NumServices: 2,
+ },
+ GoTypes: file_protoc_gen_gitaly_lint_testdata_valid_proto_goTypes,
+ DependencyIndexes: file_protoc_gen_gitaly_lint_testdata_valid_proto_depIdxs,
+ MessageInfos: file_protoc_gen_gitaly_lint_testdata_valid_proto_msgTypes,
+ }.Build()
+ File_protoc_gen_gitaly_lint_testdata_valid_proto = out.File
+ file_protoc_gen_gitaly_lint_testdata_valid_proto_rawDesc = nil
+ file_protoc_gen_gitaly_lint_testdata_valid_proto_goTypes = nil
+ file_protoc_gen_gitaly_lint_testdata_valid_proto_depIdxs = nil
+}
diff --git a/tools/protoc-gen-gitaly-lint/testdata/valid.proto b/tools/protoc-gen-gitaly-lint/testdata/valid.proto
new file mode 100644
index 000000000..e9763b067
--- /dev/null
+++ b/tools/protoc-gen-gitaly-lint/testdata/valid.proto
@@ -0,0 +1,148 @@
+syntax = "proto3";
+
+package test;
+
+import "lint.proto";
+import "shared.proto";
+
+option go_package = "gitlab.com/gitlab-org/gitaly/v14/tools/protoc-gen-gitaly-lint/testdata";
+
+message ValidRequest {
+ gitaly.Repository destination = 1 [(gitaly.target_repository)=true];
+}
+
+message ValidRequestWithoutRepo {
+}
+
+message ValidStorageRequest {
+ string storage_name = 1 [(gitaly.storage)=true];
+}
+
+message ValidResponse{
+}
+
+message ValidNestedRequest{
+ ValidRequest inner_message = 1;
+}
+
+message ValidStorageNestedRequest{
+ ValidStorageRequest inner_message = 1;
+}
+
+message ValidNestedSharedRequest {
+ gitaly.ObjectPool nested_target_repo = 1 [(gitaly.target_repository)=true];
+}
+
+message ValidInnerNestedRequest {
+ message Header {
+ gitaly.Repository destination = 1 [(gitaly.target_repository)=true];
+ }
+
+ Header header = 1;
+}
+
+message ValidStorageInnerNestedRequest {
+ message Header {
+ string storage_name = 1 [(gitaly.storage) = true];
+ }
+
+ 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) = {
+ op: ACCESSOR
+ };
+ }
+
+ rpc TestMethod2(ValidRequest) returns (ValidResponse) {
+ option (gitaly.op_type) = {
+ op: MUTATOR
+ };
+ }
+
+ rpc TestMethod3(ValidRequest) returns (ValidResponse) {
+ option (gitaly.op_type) = {
+ op: MUTATOR
+ scope_level: REPOSITORY // repo can be explicitly included
+ };
+ }
+
+ rpc TestMethod5(ValidNestedRequest) returns (ValidResponse) {
+ option (gitaly.op_type) = {
+ op: MUTATOR
+ };
+ }
+
+ rpc TestMethod6(ValidNestedSharedRequest) returns (ValidResponse) {
+ option (gitaly.op_type) = {
+ op: MUTATOR
+ };
+ }
+
+ rpc TestMethod7(ValidInnerNestedRequest) returns (ValidResponse) {
+ option (gitaly.op_type) = {
+ op: MUTATOR
+ };
+ }
+
+ rpc TestMethod8(ValidStorageRequest) returns (ValidResponse) {
+ option (gitaly.op_type) = {
+ op: MUTATOR
+ scope_level: STORAGE
+ };
+ }
+
+ rpc TestMethod9(ValidStorageNestedRequest) returns (ValidResponse) {
+ option (gitaly.op_type) = {
+ op: MUTATOR
+ scope_level: STORAGE
+ };
+ }
+
+ // Intercepted methods do not need operation type annotations.
+ rpc TestMethod10(ValidStorageRequest) returns (ValidResponse) {
+ option (gitaly.intercepted_method) = true;
+ }
+
+ rpc TestMaintenance(ValidRequest) returns (ValidResponse) {
+ option (gitaly.op_type) = {
+ op: MAINTENANCE
+ };
+ }
+
+ rpc TestMaintenanceWithExplicitScope(ValidRequest) returns (ValidResponse) {
+ option (gitaly.op_type) = {
+ op: MAINTENANCE
+ scope_level: REPOSITORY // repo can be explicitly included
+ };
+ }
+
+ rpc TestMaintenanceWithNestedRequest(ValidNestedRequest) returns (ValidResponse) {
+ option (gitaly.op_type) = {
+ op: MAINTENANCE
+ };
+ }
+
+ rpc TestMaintenanceWithNestedSharedRequest(ValidNestedSharedRequest) returns (ValidResponse) {
+ option (gitaly.op_type) = {
+ op: MAINTENANCE
+ };
+ }
+
+ rpc TestMutatorWithInnerNestedRequest(ValidInnerNestedRequest) returns (ValidResponse) {
+ option (gitaly.op_type) = {
+ op: MAINTENANCE
+ };
+ }
+
+}
diff --git a/tools/protoc-gen-gitaly-lint/testdata/valid_grpc.pb.go b/tools/protoc-gen-gitaly-lint/testdata/valid_grpc.pb.go
new file mode 100644
index 000000000..be6f3206b
--- /dev/null
+++ b/tools/protoc-gen-gitaly-lint/testdata/valid_grpc.pb.go
@@ -0,0 +1,657 @@
+// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
+
+package testdata
+
+import (
+ context "context"
+ grpc "google.golang.org/grpc"
+ codes "google.golang.org/grpc/codes"
+ status "google.golang.org/grpc/status"
+)
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the grpc package it is being compiled against.
+// Requires gRPC-Go v1.32.0 or later.
+const _ = grpc.SupportPackageIsVersion7
+
+// InterceptedServiceClient is the client API for InterceptedService service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
+type InterceptedServiceClient interface {
+ TestMethod(ctx context.Context, in *ValidRequest, opts ...grpc.CallOption) (*ValidResponse, error)
+}
+
+type interceptedServiceClient struct {
+ cc grpc.ClientConnInterface
+}
+
+func NewInterceptedServiceClient(cc grpc.ClientConnInterface) InterceptedServiceClient {
+ return &interceptedServiceClient{cc}
+}
+
+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 out, nil
+}
+
+// InterceptedServiceServer is the server API for InterceptedService service.
+// All implementations must embed UnimplementedInterceptedServiceServer
+// for forward compatibility
+type InterceptedServiceServer interface {
+ TestMethod(context.Context, *ValidRequest) (*ValidResponse, error)
+ mustEmbedUnimplementedInterceptedServiceServer()
+}
+
+// UnimplementedInterceptedServiceServer must be embedded to have forward compatible implementations.
+type UnimplementedInterceptedServiceServer struct {
+}
+
+func (UnimplementedInterceptedServiceServer) TestMethod(context.Context, *ValidRequest) (*ValidResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method TestMethod not implemented")
+}
+func (UnimplementedInterceptedServiceServer) mustEmbedUnimplementedInterceptedServiceServer() {}
+
+// UnsafeInterceptedServiceServer may be embedded to opt out of forward compatibility for this service.
+// Use of this interface is not recommended, as added methods to InterceptedServiceServer will
+// result in compilation errors.
+type UnsafeInterceptedServiceServer interface {
+ mustEmbedUnimplementedInterceptedServiceServer()
+}
+
+func RegisterInterceptedServiceServer(s grpc.ServiceRegistrar, srv InterceptedServiceServer) {
+ s.RegisterService(&InterceptedService_ServiceDesc, srv)
+}
+
+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)
+}
+
+// InterceptedService_ServiceDesc is the grpc.ServiceDesc for InterceptedService service.
+// It's only intended for direct use with grpc.RegisterService,
+// and not to be introspected or modified (even as a copy)
+var InterceptedService_ServiceDesc = grpc.ServiceDesc{
+ ServiceName: "test.InterceptedService",
+ HandlerType: (*InterceptedServiceServer)(nil),
+ Methods: []grpc.MethodDesc{
+ {
+ MethodName: "TestMethod",
+ Handler: _InterceptedService_TestMethod_Handler,
+ },
+ },
+ Streams: []grpc.StreamDesc{},
+ Metadata: "protoc-gen-gitaly-lint/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://pkg.go.dev/google.golang.org/grpc/?tab=doc#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)
+ 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)
+ // Intercepted methods do not need operation type annotations.
+ TestMethod10(ctx context.Context, in *ValidStorageRequest, opts ...grpc.CallOption) (*ValidResponse, error)
+ TestMaintenance(ctx context.Context, in *ValidRequest, opts ...grpc.CallOption) (*ValidResponse, error)
+ TestMaintenanceWithExplicitScope(ctx context.Context, in *ValidRequest, opts ...grpc.CallOption) (*ValidResponse, error)
+ TestMaintenanceWithNestedRequest(ctx context.Context, in *ValidNestedRequest, opts ...grpc.CallOption) (*ValidResponse, error)
+ TestMaintenanceWithNestedSharedRequest(ctx context.Context, in *ValidNestedSharedRequest, opts ...grpc.CallOption) (*ValidResponse, error)
+ TestMutatorWithInnerNestedRequest(ctx context.Context, in *ValidInnerNestedRequest, opts ...grpc.CallOption) (*ValidResponse, error)
+}
+
+type validServiceClient struct {
+ cc grpc.ClientConnInterface
+}
+
+func NewValidServiceClient(cc grpc.ClientConnInterface) 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 (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 (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
+}
+
+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 out, nil
+}
+
+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 out, nil
+}
+
+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 out, nil
+}
+
+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 out, nil
+}
+
+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 out, nil
+}
+
+func (c *validServiceClient) TestMethod10(ctx context.Context, in *ValidStorageRequest, opts ...grpc.CallOption) (*ValidResponse, error) {
+ out := new(ValidResponse)
+ err := c.cc.Invoke(ctx, "/test.ValidService/TestMethod10", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *validServiceClient) TestMaintenance(ctx context.Context, in *ValidRequest, opts ...grpc.CallOption) (*ValidResponse, error) {
+ out := new(ValidResponse)
+ err := c.cc.Invoke(ctx, "/test.ValidService/TestMaintenance", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *validServiceClient) TestMaintenanceWithExplicitScope(ctx context.Context, in *ValidRequest, opts ...grpc.CallOption) (*ValidResponse, error) {
+ out := new(ValidResponse)
+ err := c.cc.Invoke(ctx, "/test.ValidService/TestMaintenanceWithExplicitScope", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *validServiceClient) TestMaintenanceWithNestedRequest(ctx context.Context, in *ValidNestedRequest, opts ...grpc.CallOption) (*ValidResponse, error) {
+ out := new(ValidResponse)
+ err := c.cc.Invoke(ctx, "/test.ValidService/TestMaintenanceWithNestedRequest", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *validServiceClient) TestMaintenanceWithNestedSharedRequest(ctx context.Context, in *ValidNestedSharedRequest, opts ...grpc.CallOption) (*ValidResponse, error) {
+ out := new(ValidResponse)
+ err := c.cc.Invoke(ctx, "/test.ValidService/TestMaintenanceWithNestedSharedRequest", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *validServiceClient) TestMutatorWithInnerNestedRequest(ctx context.Context, in *ValidInnerNestedRequest, opts ...grpc.CallOption) (*ValidResponse, error) {
+ out := new(ValidResponse)
+ err := c.cc.Invoke(ctx, "/test.ValidService/TestMutatorWithInnerNestedRequest", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+// ValidServiceServer is the server API for ValidService service.
+// All implementations must embed UnimplementedValidServiceServer
+// for forward compatibility
+type ValidServiceServer interface {
+ TestMethod(context.Context, *ValidRequest) (*ValidResponse, error)
+ TestMethod2(context.Context, *ValidRequest) (*ValidResponse, error)
+ TestMethod3(context.Context, *ValidRequest) (*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)
+ // Intercepted methods do not need operation type annotations.
+ TestMethod10(context.Context, *ValidStorageRequest) (*ValidResponse, error)
+ TestMaintenance(context.Context, *ValidRequest) (*ValidResponse, error)
+ TestMaintenanceWithExplicitScope(context.Context, *ValidRequest) (*ValidResponse, error)
+ TestMaintenanceWithNestedRequest(context.Context, *ValidNestedRequest) (*ValidResponse, error)
+ TestMaintenanceWithNestedSharedRequest(context.Context, *ValidNestedSharedRequest) (*ValidResponse, error)
+ TestMutatorWithInnerNestedRequest(context.Context, *ValidInnerNestedRequest) (*ValidResponse, error)
+ mustEmbedUnimplementedValidServiceServer()
+}
+
+// UnimplementedValidServiceServer must be embedded to have forward compatible implementations.
+type UnimplementedValidServiceServer struct {
+}
+
+func (UnimplementedValidServiceServer) TestMethod(context.Context, *ValidRequest) (*ValidResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method TestMethod not implemented")
+}
+func (UnimplementedValidServiceServer) TestMethod2(context.Context, *ValidRequest) (*ValidResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method TestMethod2 not implemented")
+}
+func (UnimplementedValidServiceServer) TestMethod3(context.Context, *ValidRequest) (*ValidResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method TestMethod3 not implemented")
+}
+func (UnimplementedValidServiceServer) TestMethod5(context.Context, *ValidNestedRequest) (*ValidResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method TestMethod5 not implemented")
+}
+func (UnimplementedValidServiceServer) TestMethod6(context.Context, *ValidNestedSharedRequest) (*ValidResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method TestMethod6 not implemented")
+}
+func (UnimplementedValidServiceServer) TestMethod7(context.Context, *ValidInnerNestedRequest) (*ValidResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method TestMethod7 not implemented")
+}
+func (UnimplementedValidServiceServer) TestMethod8(context.Context, *ValidStorageRequest) (*ValidResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method TestMethod8 not implemented")
+}
+func (UnimplementedValidServiceServer) TestMethod9(context.Context, *ValidStorageNestedRequest) (*ValidResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method TestMethod9 not implemented")
+}
+func (UnimplementedValidServiceServer) TestMethod10(context.Context, *ValidStorageRequest) (*ValidResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method TestMethod10 not implemented")
+}
+func (UnimplementedValidServiceServer) TestMaintenance(context.Context, *ValidRequest) (*ValidResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method TestMaintenance not implemented")
+}
+func (UnimplementedValidServiceServer) TestMaintenanceWithExplicitScope(context.Context, *ValidRequest) (*ValidResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method TestMaintenanceWithExplicitScope not implemented")
+}
+func (UnimplementedValidServiceServer) TestMaintenanceWithNestedRequest(context.Context, *ValidNestedRequest) (*ValidResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method TestMaintenanceWithNestedRequest not implemented")
+}
+func (UnimplementedValidServiceServer) TestMaintenanceWithNestedSharedRequest(context.Context, *ValidNestedSharedRequest) (*ValidResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method TestMaintenanceWithNestedSharedRequest not implemented")
+}
+func (UnimplementedValidServiceServer) TestMutatorWithInnerNestedRequest(context.Context, *ValidInnerNestedRequest) (*ValidResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method TestMutatorWithInnerNestedRequest not implemented")
+}
+func (UnimplementedValidServiceServer) mustEmbedUnimplementedValidServiceServer() {}
+
+// UnsafeValidServiceServer may be embedded to opt out of forward compatibility for this service.
+// Use of this interface is not recommended, as added methods to ValidServiceServer will
+// result in compilation errors.
+type UnsafeValidServiceServer interface {
+ mustEmbedUnimplementedValidServiceServer()
+}
+
+func RegisterValidServiceServer(s grpc.ServiceRegistrar, srv ValidServiceServer) {
+ s.RegisterService(&ValidService_ServiceDesc, srv)
+}
+
+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
+ }
+ 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 _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 interceptor(ctx, in, info, handler)
+}
+
+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 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 {
+ 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)
+}
+
+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)
+}
+
+func _ValidService_TestMethod10_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).TestMethod10(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/test.ValidService/TestMethod10",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(ValidServiceServer).TestMethod10(ctx, req.(*ValidStorageRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _ValidService_TestMaintenance_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).TestMaintenance(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/test.ValidService/TestMaintenance",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(ValidServiceServer).TestMaintenance(ctx, req.(*ValidRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _ValidService_TestMaintenanceWithExplicitScope_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).TestMaintenanceWithExplicitScope(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/test.ValidService/TestMaintenanceWithExplicitScope",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(ValidServiceServer).TestMaintenanceWithExplicitScope(ctx, req.(*ValidRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _ValidService_TestMaintenanceWithNestedRequest_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).TestMaintenanceWithNestedRequest(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/test.ValidService/TestMaintenanceWithNestedRequest",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(ValidServiceServer).TestMaintenanceWithNestedRequest(ctx, req.(*ValidNestedRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _ValidService_TestMaintenanceWithNestedSharedRequest_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).TestMaintenanceWithNestedSharedRequest(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/test.ValidService/TestMaintenanceWithNestedSharedRequest",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(ValidServiceServer).TestMaintenanceWithNestedSharedRequest(ctx, req.(*ValidNestedSharedRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _ValidService_TestMutatorWithInnerNestedRequest_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).TestMutatorWithInnerNestedRequest(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/test.ValidService/TestMutatorWithInnerNestedRequest",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(ValidServiceServer).TestMutatorWithInnerNestedRequest(ctx, req.(*ValidInnerNestedRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+// ValidService_ServiceDesc is the grpc.ServiceDesc for ValidService service.
+// It's only intended for direct use with grpc.RegisterService,
+// and not to be introspected or modified (even as a copy)
+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: "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,
+ },
+ {
+ MethodName: "TestMethod10",
+ Handler: _ValidService_TestMethod10_Handler,
+ },
+ {
+ MethodName: "TestMaintenance",
+ Handler: _ValidService_TestMaintenance_Handler,
+ },
+ {
+ MethodName: "TestMaintenanceWithExplicitScope",
+ Handler: _ValidService_TestMaintenanceWithExplicitScope_Handler,
+ },
+ {
+ MethodName: "TestMaintenanceWithNestedRequest",
+ Handler: _ValidService_TestMaintenanceWithNestedRequest_Handler,
+ },
+ {
+ MethodName: "TestMaintenanceWithNestedSharedRequest",
+ Handler: _ValidService_TestMaintenanceWithNestedSharedRequest_Handler,
+ },
+ {
+ MethodName: "TestMutatorWithInnerNestedRequest",
+ Handler: _ValidService_TestMutatorWithInnerNestedRequest_Handler,
+ },
+ },
+ Streams: []grpc.StreamDesc{},
+ Metadata: "protoc-gen-gitaly-lint/testdata/valid.proto",
+}
diff --git a/tools/protoc-gen-gitaly-protolist/main.go b/tools/protoc-gen-gitaly-protolist/main.go
new file mode 100644
index 000000000..7e775360e
--- /dev/null
+++ b/tools/protoc-gen-gitaly-protolist/main.go
@@ -0,0 +1,139 @@
+// Command protoc-gen-gitaly-protolist is designed to be used as a protobuf compiler to generate a
+// list of protobuf files via a publicly accessible variable.
+//
+// This plugin can be accessed by invoking the protoc compiler with the following arguments:
+//
+// protoc --plugin=protoc-gen-gitaly-protolist --gitaly_protolist_out=.
+//
+// The plugin accepts a protobuf message in STDIN that describes the parsed protobuf files. A
+// response is sent back on STDOUT that contains any errors.
+package main
+
+import (
+ "bytes"
+ "fmt"
+ "go/format"
+ "io"
+ "log"
+ "os"
+ "path/filepath"
+ "strings"
+ "text/template"
+
+ "google.golang.org/protobuf/proto"
+ "google.golang.org/protobuf/types/pluginpb"
+)
+
+const (
+ gitalyProtoDirArg = "proto_dir"
+ gitalypbDirArg = "gitalypb_dir"
+)
+
+func main() {
+ data, err := io.ReadAll(os.Stdin)
+ if err != nil {
+ log.Fatalf("reading input: %s", err)
+ }
+
+ req := &pluginpb.CodeGeneratorRequest{}
+
+ if err := proto.Unmarshal(data, req); err != nil {
+ log.Fatalf("parsing input proto: %s", err)
+ }
+
+ if err := generateProtolistGo(req); err != nil {
+ log.Fatal(err)
+ }
+}
+
+func parseArgs(argString string) (gitalyProtoDir string, gitalypbDir string) {
+ for _, arg := range strings.Split(argString, ",") {
+ argKeyValue := strings.Split(arg, "=")
+ if len(argKeyValue) != 2 {
+ continue
+ }
+ switch argKeyValue[0] {
+ case gitalyProtoDirArg:
+ gitalyProtoDir = argKeyValue[1]
+ case gitalypbDirArg:
+ gitalypbDir = argKeyValue[1]
+ }
+ }
+
+ return gitalyProtoDir, gitalypbDir
+}
+
+func generateProtolistGo(req *pluginpb.CodeGeneratorRequest) error {
+ var err error
+ gitalyProtoDir, gitalypbDir := parseArgs(req.GetParameter())
+
+ if gitalyProtoDir == "" {
+ return fmt.Errorf("%s not provided", gitalyProtoDirArg)
+ }
+ if gitalypbDir == "" {
+ return fmt.Errorf("%s not provided", gitalypbDirArg)
+ }
+
+ var protoNames []string
+
+ if gitalyProtoDir, err = filepath.Abs(gitalyProtoDir); err != nil {
+ return fmt.Errorf("failed to get absolute path for %s: %v", gitalyProtoDir, err)
+ }
+
+ files, err := os.ReadDir(gitalyProtoDir)
+ if err != nil {
+ return fmt.Errorf("failed to read %s: %v", gitalyProtoDir, err)
+ }
+
+ for _, fi := range files {
+ if !fi.IsDir() && strings.HasSuffix(fi.Name(), ".proto") {
+ protoNames = append(protoNames, fmt.Sprintf(`"%s"`, fi.Name()))
+ }
+ }
+
+ f, err := os.Create(filepath.Join(gitalypbDir, "protolist.go"))
+ if err != nil {
+ return fmt.Errorf("could not create protolist.go: %v", err)
+ }
+ defer f.Close()
+
+ if err = renderProtoList(f, protoNames); err != nil {
+ return fmt.Errorf("could not render go code: %v", err)
+ }
+
+ return nil
+}
+
+// renderProtoList generate a go file with a list of gitaly protos
+func renderProtoList(dest io.WriteCloser, protoNames []string) error {
+ joinFunc := template.FuncMap{"join": strings.Join}
+ protoList := `package gitalypb
+ // Code generated by protoc-gen-gitaly. DO NOT EDIT
+
+ // GitalyProtos is a list of gitaly protobuf files
+ var GitalyProtos = []string{
+ {{join . ",\n"}},
+ }
+ `
+ protoListTempl, err := template.New("protoList").Funcs(joinFunc).Parse(protoList)
+ if err != nil {
+ return fmt.Errorf("could not create go code template: %v", err)
+ }
+
+ var rawGo bytes.Buffer
+
+ if err := protoListTempl.Execute(&rawGo, protoNames); err != nil {
+ return fmt.Errorf("could not execute go code template: %v", err)
+ }
+
+ formattedGo, err := format.Source(rawGo.Bytes())
+ if err != nil {
+ return fmt.Errorf("could not format go code: %v", err)
+ }
+
+ if _, err = io.Copy(dest, bytes.NewBuffer(formattedGo)); err != nil {
+ return fmt.Errorf("failed to write protolist.go file: %v", err)
+ }
+
+ return nil
+}