diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-03-31 08:03:59 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-03-31 08:03:59 +0300 |
commit | a32498721df03d6a16731f7aa4ef5143f3fb60d7 (patch) | |
tree | dc234e526d18ea27665356f15dfdee8742766861 /proto/go | |
parent | 438801e8fdf288fe1629365c455941467776bab2 (diff) | |
parent | a650f42c86d5a1f9e78afffe200b39bb95a89859 (diff) |
Merge branch 'pks-proto-introduce-maintenance-operations' into 'master'
proto: Introduce new "maintenance" RPC type
Closes #4079
See merge request gitlab-org/gitaly!4399
Diffstat (limited to 'proto/go')
-rw-r--r-- | proto/go/gitalypb/lint.pb.go | 100 | ||||
-rw-r--r-- | proto/go/gitalypb/ref.pb.go | 2 | ||||
-rw-r--r-- | proto/go/gitalypb/repository-service.pb.go | 16 | ||||
-rw-r--r-- | proto/go/internal/linter/lint.go | 3 | ||||
-rw-r--r-- | proto/go/internal/linter/lint_test.go | 8 | ||||
-rw-r--r-- | proto/go/internal/linter/method.go | 11 | ||||
-rw-r--r-- | proto/go/internal/linter/testdata/invalid.pb.go | 119 | ||||
-rw-r--r-- | proto/go/internal/linter/testdata/invalid.proto | 46 | ||||
-rw-r--r-- | proto/go/internal/linter/testdata/invalid_grpc.pb.go | 288 | ||||
-rw-r--r-- | proto/go/internal/linter/testdata/valid.pb.go | 76 | ||||
-rw-r--r-- | proto/go/internal/linter/testdata/valid.proto | 32 | ||||
-rw-r--r-- | proto/go/internal/linter/testdata/valid_grpc.pb.go | 180 |
12 files changed, 781 insertions, 100 deletions
diff --git a/proto/go/gitalypb/lint.pb.go b/proto/go/gitalypb/lint.pb.go index cb57cecac..13c98757d 100644 --- a/proto/go/gitalypb/lint.pb.go +++ b/proto/go/gitalypb/lint.pb.go @@ -24,9 +24,10 @@ const ( type OperationMsg_Operation int32 const ( - OperationMsg_UNKNOWN OperationMsg_Operation = 0 - OperationMsg_MUTATOR OperationMsg_Operation = 1 - OperationMsg_ACCESSOR OperationMsg_Operation = 2 + OperationMsg_UNKNOWN OperationMsg_Operation = 0 + OperationMsg_MUTATOR OperationMsg_Operation = 1 + OperationMsg_ACCESSOR OperationMsg_Operation = 2 + OperationMsg_MAINTENANCE OperationMsg_Operation = 3 ) // Enum value maps for OperationMsg_Operation. @@ -35,11 +36,13 @@ var ( 0: "UNKNOWN", 1: "MUTATOR", 2: "ACCESSOR", + 3: "MAINTENANCE", } OperationMsg_Operation_value = map[string]int32{ - "UNKNOWN": 0, - "MUTATOR": 1, - "ACCESSOR": 2, + "UNKNOWN": 0, + "MUTATOR": 1, + "ACCESSOR": 2, + "MAINTENANCE": 3, } ) @@ -288,7 +291,7 @@ var file_lint_proto_rawDesc = []byte{ 0x0a, 0x0a, 0x6c, 0x69, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe4, 0x01, 0x0a, 0x0c, 0x4f, 0x70, 0x65, 0x72, 0x61, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf5, 0x01, 0x0a, 0x0c, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x73, 0x67, 0x12, 0x2e, 0x0a, 0x02, 0x6f, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x73, 0x67, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, @@ -296,50 +299,51 @@ var file_lint_proto_rawDesc = []byte{ 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x73, 0x67, 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x0a, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x4c, - 0x65, 0x76, 0x65, 0x6c, 0x22, 0x33, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x65, 0x76, 0x65, 0x6c, 0x22, 0x44, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x4d, 0x55, 0x54, 0x41, 0x54, 0x4f, 0x52, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x41, - 0x43, 0x43, 0x45, 0x53, 0x53, 0x4f, 0x52, 0x10, 0x02, 0x22, 0x32, 0x0a, 0x05, 0x53, 0x63, 0x6f, - 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x0a, 0x52, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x4f, 0x52, 0x59, - 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x54, 0x4f, 0x52, 0x41, 0x47, 0x45, 0x10, 0x02, 0x22, - 0x04, 0x08, 0x01, 0x10, 0x01, 0x2a, 0x06, 0x53, 0x45, 0x52, 0x56, 0x45, 0x52, 0x3a, 0x43, 0x0a, - 0x0b, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x12, 0x1f, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xfe, 0x82, - 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x65, 0x70, 0x74, - 0x65, 0x64, 0x3a, 0x4f, 0x0a, 0x07, 0x6f, 0x70, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x2e, + 0x43, 0x43, 0x45, 0x53, 0x53, 0x4f, 0x52, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x4d, 0x41, 0x49, + 0x4e, 0x54, 0x45, 0x4e, 0x41, 0x4e, 0x43, 0x45, 0x10, 0x03, 0x22, 0x32, 0x0a, 0x05, 0x53, 0x63, + 0x6f, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x0a, 0x52, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x4f, 0x52, + 0x59, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x54, 0x4f, 0x52, 0x41, 0x47, 0x45, 0x10, 0x02, + 0x22, 0x04, 0x08, 0x01, 0x10, 0x01, 0x2a, 0x06, 0x53, 0x45, 0x52, 0x56, 0x45, 0x52, 0x3a, 0x43, + 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xff, 0x82, - 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x4f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x73, 0x67, 0x52, 0x06, 0x6f, 0x70, 0x54, - 0x79, 0x70, 0x65, 0x3a, 0x4f, 0x0a, 0x12, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x65, 0x70, 0x74, - 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, 0x68, - 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x80, 0x83, 0x05, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x11, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x4d, 0x65, - 0x74, 0x68, 0x6f, 0x64, 0x3a, 0x39, 0x0a, 0x07, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x12, - 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xe1, - 0xc8, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x3a, - 0x3f, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1d, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xe2, 0xc8, 0x05, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, - 0x3a, 0x4c, 0x0a, 0x11, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xe3, 0xc8, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x74, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x3a, 0x54, - 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x72, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xe4, 0xc8, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, - 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x79, 0x42, 0x34, 0x5a, 0x32, 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, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, - 0x6f, 0x2f, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xfe, + 0x82, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x65, 0x70, + 0x74, 0x65, 0x64, 0x3a, 0x4f, 0x0a, 0x07, 0x6f, 0x70, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1e, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xff, + 0x82, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, + 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x73, 0x67, 0x52, 0x06, 0x6f, 0x70, + 0x54, 0x79, 0x70, 0x65, 0x3a, 0x4f, 0x0a, 0x12, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x65, 0x70, + 0x74, 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, + 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x80, 0x83, 0x05, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x11, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x4d, + 0x65, 0x74, 0x68, 0x6f, 0x64, 0x3a, 0x39, 0x0a, 0x07, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0xe1, 0xc8, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x3a, 0x3f, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1d, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xe2, 0xc8, + 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, + 0x79, 0x3a, 0x4c, 0x0a, 0x11, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x72, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xe3, 0xc8, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x74, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x3a, + 0x54, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x72, 0x65, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xe4, 0xc8, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x34, 0x5a, 0x32, 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, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x67, 0x6f, 0x2f, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( diff --git a/proto/go/gitalypb/ref.pb.go b/proto/go/gitalypb/ref.pb.go index e2a4e4b97..116e1ac18 100644 --- a/proto/go/gitalypb/ref.pb.go +++ b/proto/go/gitalypb/ref.pb.go @@ -3255,7 +3255,7 @@ var file_ref_proto_rawDesc = []byte{ 0x17, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x66, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x66, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x09, 0x88, 0x02, 0x01, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x01, 0x12, 0x47, 0x0a, + 0x73, 0x65, 0x22, 0x09, 0x88, 0x02, 0x01, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x03, 0x12, 0x47, 0x0a, 0x08, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x66, 0x73, 0x12, 0x17, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x66, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, diff --git a/proto/go/gitalypb/repository-service.pb.go b/proto/go/gitalypb/repository-service.pb.go index 4e346ae7e..54e49033c 100644 --- a/proto/go/gitalypb/repository-service.pb.go +++ b/proto/go/gitalypb/repository-service.pb.go @@ -5057,28 +5057,28 @@ var file_repository_service_proto_rawDesc = []byte{ 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x52, 0x65, 0x70, 0x61, 0x63, 0x6b, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x09, 0x88, 0x02, 0x01, 0xfa, 0x97, 0x28, 0x02, - 0x08, 0x01, 0x12, 0x4e, 0x0a, 0x0a, 0x52, 0x65, 0x70, 0x61, 0x63, 0x6b, 0x46, 0x75, 0x6c, 0x6c, + 0x08, 0x03, 0x12, 0x4e, 0x0a, 0x0a, 0x52, 0x65, 0x70, 0x61, 0x63, 0x6b, 0x46, 0x75, 0x6c, 0x6c, 0x12, 0x19, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x52, 0x65, 0x70, 0x61, 0x63, 0x6b, 0x46, 0x75, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x52, 0x65, 0x70, 0x61, 0x63, 0x6b, 0x46, 0x75, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x09, 0x88, 0x02, 0x01, 0xfa, 0x97, 0x28, 0x02, - 0x08, 0x01, 0x12, 0x4e, 0x0a, 0x0a, 0x4d, 0x69, 0x64, 0x78, 0x52, 0x65, 0x70, 0x61, 0x63, 0x6b, + 0x08, 0x03, 0x12, 0x4e, 0x0a, 0x0a, 0x4d, 0x69, 0x64, 0x78, 0x52, 0x65, 0x70, 0x61, 0x63, 0x6b, 0x12, 0x19, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x4d, 0x69, 0x64, 0x78, 0x52, 0x65, 0x70, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x4d, 0x69, 0x64, 0x78, 0x52, 0x65, 0x70, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x09, 0x88, 0x02, 0x01, 0xfa, 0x97, 0x28, 0x02, - 0x08, 0x01, 0x12, 0x5a, 0x0a, 0x0e, 0x47, 0x61, 0x72, 0x62, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6c, + 0x08, 0x03, 0x12, 0x5a, 0x0a, 0x0e, 0x47, 0x61, 0x72, 0x62, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x12, 0x1d, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x47, 0x61, 0x72, 0x62, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x47, 0x61, 0x72, 0x62, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x09, 0x88, 0x02, 0x01, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x01, 0x12, 0x60, + 0x6e, 0x73, 0x65, 0x22, 0x09, 0x88, 0x02, 0x01, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x03, 0x12, 0x60, 0x0a, 0x10, 0x57, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x47, 0x72, 0x61, 0x70, 0x68, 0x12, 0x1f, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x47, 0x72, 0x61, 0x70, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x47, 0x72, 0x61, 0x70, 0x68, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x09, 0x88, 0x02, 0x01, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x01, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x09, 0x88, 0x02, 0x01, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x03, 0x12, 0x57, 0x0a, 0x0e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, @@ -5196,7 +5196,7 @@ var file_repository_service_proto_rawDesc = []byte{ 0x70, 0x12, 0x16, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x43, 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x43, 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x09, 0x88, 0x02, 0x01, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x01, 0x12, 0x50, 0x0a, + 0x73, 0x65, 0x22, 0x09, 0x88, 0x02, 0x01, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x03, 0x12, 0x50, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x1a, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, @@ -5273,14 +5273,14 @@ var file_repository_service_proto_rawDesc = []byte{ 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, - 0x02, 0x08, 0x01, 0x12, 0x72, 0x0a, 0x17, 0x50, 0x72, 0x75, 0x6e, 0x65, 0x55, 0x6e, 0x72, 0x65, + 0x02, 0x08, 0x03, 0x12, 0x72, 0x0a, 0x17, 0x50, 0x72, 0x75, 0x6e, 0x65, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x63, 0x68, 0x61, 0x62, 0x6c, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x26, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x50, 0x72, 0x75, 0x6e, 0x65, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x63, 0x68, 0x61, 0x62, 0x6c, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x50, 0x72, 0x75, 0x6e, 0x65, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x63, 0x68, 0x61, 0x62, 0x6c, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x01, 0x12, 0x4e, 0x0a, 0x0b, 0x53, 0x65, 0x74, 0x46, 0x75, + 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x03, 0x12, 0x4e, 0x0a, 0x0b, 0x53, 0x65, 0x74, 0x46, 0x75, 0x6c, 0x6c, 0x50, 0x61, 0x74, 0x68, 0x12, 0x1a, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x53, 0x65, 0x74, 0x46, 0x75, 0x6c, 0x6c, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x53, 0x65, 0x74, 0x46, diff --git a/proto/go/internal/linter/lint.go b/proto/go/internal/linter/lint.go index 6d8ed34b6..48eb0f252 100644 --- a/proto/go/internal/linter/lint.go +++ b/proto/go/internal/linter/lint.go @@ -43,6 +43,9 @@ func ensureMethodOpType(fileDesc *descriptorpb.FileDescriptorProto, m *descripto // 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") diff --git a/proto/go/internal/linter/lint_test.go b/proto/go/internal/linter/lint_test.go index bbf868d20..5747b3893 100644 --- a/proto/go/internal/linter/lint_test.go +++ b/proto/go/internal/linter/lint_test.go @@ -39,6 +39,14 @@ func TestLintFile(t *testing.T) { formatError("go/internal/linter/testdata/invalid.proto", "InvalidService", "InvalidMethod13", errors.New("unexpected count of storage field 0, expected 1, found storage label at: []")), formatError("go/internal/linter/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("go/internal/linter/testdata/invalid.proto", "InvalidService", "InvalidMethod15", errors.New("operation type defined on an intercepted method")), + formatError("go/internal/linter/testdata/invalid.proto", "InvalidService", "MaintenanceWithMissingRepository", errors.New("unexpected count of target_repository fields 0, expected 1, found target_repository label at: []")), + formatError("go/internal/linter/testdata/invalid.proto", "InvalidService", "MaintenanceWithUnflaggedRepository", errors.New("unexpected count of target_repository fields 0, expected 1, found target_repository label at: []")), + formatError("go/internal/linter/testdata/invalid.proto", "InvalidService", "MaintenanceWithWrongNestedRepositoryType", errors.New("wrong type of field RequestWithWrongTypeRepository.header.repository, expected .gitaly.Repository, got .test.InvalidMethodResponse")), + formatError("go/internal/linter/testdata/invalid.proto", "InvalidService", "MaintenanceWithInvalidTargetType", errors.New("unexpected count of target_repository fields 0, expected 1, found target_repository label at: []")), + formatError("go/internal/linter/testdata/invalid.proto", "InvalidService", "MaintenanceWithInvalidNestedRequest", errors.New("unexpected count of target_repository fields 0, expected 1, found target_repository label at: []")), + formatError("go/internal/linter/testdata/invalid.proto", "InvalidService", "MaintenanceWithStorageAndRepository", errors.New("unexpected count of storage field 1, expected 0, found storage label at: [RequestWithStorageAndRepo.storage_name]")), + formatError("go/internal/linter/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("go/internal/linter/testdata/invalid.proto", "InvalidService", "MaintenanceWithStorageScope", errors.New("unknown operation scope level 2")), }, }, } { diff --git a/proto/go/internal/linter/method.go b/proto/go/internal/linter/method.go index 11ad03c36..b336f7f4f 100644 --- a/proto/go/internal/linter/method.go +++ b/proto/go/internal/linter/method.go @@ -49,6 +49,17 @@ func (ml methodLinter) validateMutator() error { } } +// 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 diff --git a/proto/go/internal/linter/testdata/invalid.pb.go b/proto/go/internal/linter/testdata/invalid.pb.go index cc379716f..1252ad32f 100644 --- a/proto/go/internal/linter/testdata/invalid.pb.go +++ b/proto/go/internal/linter/testdata/invalid.pb.go @@ -828,7 +828,7 @@ var file_go_internal_linter_testdata_invalid_proto_rawDesc = []byte{ 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, 0xd9, 0x09, 0x0a, 0x0e, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x53, 0x65, 0x72, 0x76, + 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, @@ -905,12 +905,67 @@ var file_go_internal_linter_testdata_invalid_proto_rawDesc = []byte{ 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, 0x42, 0x44, 0x5a, 0x42, - 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, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x2f, 0x6c, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, - 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 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, 0x44, 0x5a, 0x42, 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, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, + 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x6c, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -971,23 +1026,39 @@ var file_go_internal_linter_testdata_invalid_proto_depIdxs = []int32{ 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 - 3, // 26: test.InterceptedWithOperationType.InvalidMethod:output_type -> test.InvalidMethodResponse - 3, // 27: test.InvalidService.InvalidMethod0:output_type -> test.InvalidMethodResponse - 3, // 28: test.InvalidService.InvalidMethod1:output_type -> test.InvalidMethodResponse - 3, // 29: test.InvalidService.InvalidMethod2:output_type -> test.InvalidMethodResponse - 3, // 30: test.InvalidService.InvalidMethod4:output_type -> test.InvalidMethodResponse - 3, // 31: test.InvalidService.InvalidMethod5:output_type -> test.InvalidMethodResponse - 3, // 32: test.InvalidService.InvalidMethod6:output_type -> test.InvalidMethodResponse - 3, // 33: test.InvalidService.InvalidMethod7:output_type -> test.InvalidMethodResponse - 3, // 34: test.InvalidService.InvalidMethod8:output_type -> test.InvalidMethodResponse - 3, // 35: test.InvalidService.InvalidMethod9:output_type -> test.InvalidMethodResponse - 3, // 36: test.InvalidService.InvalidMethod10:output_type -> test.InvalidMethodResponse - 3, // 37: test.InvalidService.InvalidMethod11:output_type -> test.InvalidMethodResponse - 3, // 38: test.InvalidService.InvalidMethod13:output_type -> test.InvalidMethodResponse - 3, // 39: test.InvalidService.InvalidMethod14:output_type -> test.InvalidMethodResponse - 3, // 40: test.InvalidService.InvalidMethod15:output_type -> test.InvalidMethodResponse - 26, // [26:41] is the sub-list for method output_type - 11, // [11:26] is the sub-list for method input_type + 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 diff --git a/proto/go/internal/linter/testdata/invalid.proto b/proto/go/internal/linter/testdata/invalid.proto index a8c3ce54a..badafa4da 100644 --- a/proto/go/internal/linter/testdata/invalid.proto +++ b/proto/go/internal/linter/testdata/invalid.proto @@ -162,4 +162,50 @@ service InvalidService { 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/proto/go/internal/linter/testdata/invalid_grpc.pb.go b/proto/go/internal/linter/testdata/invalid_grpc.pb.go index 2f109e568..02211b2f9 100644 --- a/proto/go/internal/linter/testdata/invalid_grpc.pb.go +++ b/proto/go/internal/linter/testdata/invalid_grpc.pb.go @@ -135,6 +135,14 @@ type InvalidServiceClient interface { 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 { @@ -271,6 +279,78 @@ func (c *invalidServiceClient) InvalidMethod15(ctx context.Context, in *RequestW 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 @@ -303,6 +383,14 @@ type InvalidServiceServer interface { 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() } @@ -352,6 +440,30 @@ func (UnimplementedInvalidServiceServer) InvalidMethod14(context.Context, *Reque 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. @@ -617,6 +729,150 @@ func _InvalidService_InvalidMethod15_Handler(srv interface{}, ctx context.Contex 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) @@ -680,6 +936,38 @@ var InvalidService_ServiceDesc = grpc.ServiceDesc{ 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: "go/internal/linter/testdata/invalid.proto", diff --git a/proto/go/internal/linter/testdata/valid.pb.go b/proto/go/internal/linter/testdata/valid.pb.go index b136201be..2885e8430 100644 --- a/proto/go/internal/linter/testdata/valid.pb.go +++ b/proto/go/internal/linter/testdata/valid.pb.go @@ -581,7 +581,7 @@ var file_go_internal_linter_testdata_valid_proto_rawDesc = []byte{ 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, - 0x88, 0x05, 0x0a, 0x0c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 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, @@ -621,12 +621,40 @@ var file_go_internal_linter_testdata_valid_proto_rawDesc = []byte{ 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, 0x42, 0x44, 0x5a, 0x42, 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, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, - 0x2f, 0x6c, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 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, 0x44, 0x5a, 0x42, 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, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x67, 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x6c, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -675,18 +703,28 @@ var file_go_internal_linter_testdata_valid_proto_depIdxs = []int32{ 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 - 3, // 17: test.InterceptedService.TestMethod:output_type -> test.ValidResponse - 3, // 18: test.ValidService.TestMethod:output_type -> test.ValidResponse - 3, // 19: test.ValidService.TestMethod2:output_type -> test.ValidResponse - 3, // 20: test.ValidService.TestMethod3:output_type -> test.ValidResponse - 3, // 21: test.ValidService.TestMethod5:output_type -> test.ValidResponse - 3, // 22: test.ValidService.TestMethod6:output_type -> test.ValidResponse - 3, // 23: test.ValidService.TestMethod7:output_type -> test.ValidResponse - 3, // 24: test.ValidService.TestMethod8:output_type -> test.ValidResponse - 3, // 25: test.ValidService.TestMethod9:output_type -> test.ValidResponse - 3, // 26: test.ValidService.TestMethod10:output_type -> test.ValidResponse - 17, // [17:27] is the sub-list for method output_type - 7, // [7:17] is the sub-list for method input_type + 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 diff --git a/proto/go/internal/linter/testdata/valid.proto b/proto/go/internal/linter/testdata/valid.proto index 0e3614792..9d1c9532e 100644 --- a/proto/go/internal/linter/testdata/valid.proto +++ b/proto/go/internal/linter/testdata/valid.proto @@ -112,4 +112,36 @@ service ValidService { 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/proto/go/internal/linter/testdata/valid_grpc.pb.go b/proto/go/internal/linter/testdata/valid_grpc.pb.go index d545af891..c9d929b1f 100644 --- a/proto/go/internal/linter/testdata/valid_grpc.pb.go +++ b/proto/go/internal/linter/testdata/valid_grpc.pb.go @@ -114,6 +114,11 @@ type ValidServiceClient interface { 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 { @@ -205,6 +210,51 @@ func (c *validServiceClient) TestMethod10(ctx context.Context, in *ValidStorageR 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 @@ -219,6 +269,11 @@ type ValidServiceServer interface { 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() } @@ -253,6 +308,21 @@ func (UnimplementedValidServiceServer) TestMethod9(context.Context, *ValidStorag 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. @@ -428,6 +498,96 @@ func _ValidService_TestMethod10_Handler(srv interface{}, ctx context.Context, de 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) @@ -471,6 +631,26 @@ var ValidService_ServiceDesc = grpc.ServiceDesc{ 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: "go/internal/linter/testdata/valid.proto", |