From 6ef9953d221c9e0435dc8ad5cfbe804769d3bd15 Mon Sep 17 00:00:00 2001 From: Lukasz Zajaczkowski Date: Fri, 20 Oct 2023 09:42:05 +0200 Subject: [PATCH 1/2] cleanup gitops --- cmd/kas/kasapp/configured_app.go | 25 + cmd/kas/kasapp/defaulting.go | 5 +- internal/api/types.go | 3 - internal/fake/api/get_agent_info.go | 1 - internal/gitaly/BUILD.bazel | 51 - internal/gitaly/error.go | 161 - internal/gitaly/error_test.go | 115 - internal/gitaly/feature_flags.go | 18 - internal/gitaly/fetch_visitors.go | 245 - internal/gitaly/fetch_visitors_test.go | 340 -- internal/gitaly/path_fetcher.go | 153 - internal/gitaly/path_fetcher_test.go | 210 - internal/gitaly/path_visitor.go | 61 - internal/gitaly/path_visitor_test.go | 76 - internal/gitaly/poller.go | 142 - internal/gitaly/poller_test.go | 267 - internal/gitaly/pool.go | 65 - internal/gitaly/vendored/README.md | 15 - internal/gitaly/vendored/backoff/BUILD.bazel | 8 - internal/gitaly/vendored/backoff/backoff.go | 75 - internal/gitaly/vendored/client/BUILD.bazel | 19 - internal/gitaly/vendored/client/dial.go | 46 - internal/gitaly/vendored/client/pool.go | 98 - .../gitaly/vendored/client/pool_options.go | 39 - .../gitaly/vendored/dnsresolver/BUILD.bazel | 18 - .../gitaly/vendored/dnsresolver/builder.go | 110 - internal/gitaly/vendored/dnsresolver/noop.go | 10 - .../gitaly/vendored/dnsresolver/resolver.go | 130 - .../gitaly/vendored/dnsresolver/target.go | 100 - .../gitaly/vendored/gitalyauth/BUILD.bazel | 12 - .../vendored/gitalyauth/rpccredentials.go | 33 - internal/gitaly/vendored/gitalyauth/token.go | 14 - internal/gitaly/vendored/gitalypb/BUILD.bazel | 152 - .../gitaly/vendored/gitalypb/commit.pb.go | 5385 ----------------- .../gitaly/vendored/gitalypb/commit.proto | 881 --- .../vendored/gitalypb/commit_grpc.pb.go | 1367 ----- .../gitaly/vendored/gitalypb/errors.pb.go | 1396 ----- .../gitaly/vendored/gitalypb/errors.proto | 201 - internal/gitaly/vendored/gitalypb/lint.pb.go | 389 -- internal/gitaly/vendored/gitalypb/lint.proto | 71 - .../gitaly/vendored/gitalypb/packfile.pb.go | 216 - .../gitaly/vendored/gitalypb/packfile.proto | 26 - .../vendored/gitalypb/service_config.pb.go | 705 --- .../vendored/gitalypb/service_config.proto | 82 - .../gitaly/vendored/gitalypb/shared.pb.go | 1505 ----- .../gitaly/vendored/gitalypb/shared.proto | 241 - .../gitaly/vendored/gitalypb/smarthttp.pb.go | 625 -- .../gitaly/vendored/gitalypb/smarthttp.proto | 121 - .../vendored/gitalypb/smarthttp_grpc.pb.go | 308 - internal/gitaly/vendored/gittest/BUILD.bazel | 12 - internal/gitaly/vendored/gittest/pktline.go | 25 - .../gitaly/vendored/grpc/client/BUILD.bazel | 20 - .../vendored/grpc/client/address_parser.go | 38 - internal/gitaly/vendored/grpc/client/dial.go | 232 - internal/gitaly/vendored/pktline/BUILD.bazel | 16 - .../gitaly/vendored/pktline/pkt_line_test.go | 157 - internal/gitaly/vendored/pktline/pktline.go | 117 - internal/gitaly/vendored/stats/BUILD.bazel | 23 - .../vendored/stats/reference_discovery.go | 116 - .../stats/reference_discovery_test.go | 117 - .../gitaly/vendored/structerr/BUILD.bazel | 14 - internal/gitaly/vendored/structerr/error.go | 380 -- internal/gitlab/api/api_extra.go | 2 - .../agent_configuration/server/factory.go | 1 - .../module/agent_configuration/server/fake.go | 11 - .../agent_configuration/server/server.go | 247 - .../agent_configuration/server/server_test.go | 409 -- .../configuration_project/server/factory.go | 26 - .../configuration_project/server/server.go | 90 - .../server/server_test.go | 157 - internal/module/gitops/BUILD.bazel | 8 - .../gitops/agent/manifestops/BUILD.bazel | 91 - .../module/gitops/agent/manifestops/doc.go | 3 - .../gitops/agent/manifestops/factory.go | 95 - .../gitops/agent/manifestops/mock_for_test.go | 81 - .../module/gitops/agent/manifestops/module.go | 92 - .../gitops/agent/manifestops/module_test.go | 7 - .../agent/manifestops/retry_pipeline.go | 89 - .../agent/manifestops/retry_pipeline_test.go | 91 - .../gitops/agent/manifestops/sync_decoder.go | 74 - .../agent/manifestops/sync_decoder_test.go | 285 - .../module/gitops/agent/manifestops/worker.go | 43 - .../agent/manifestops/worker_1_watch.go | 30 - .../agent/manifestops/worker_2_decode.go | 96 - .../agent/manifestops/worker_3_apply.go | 55 - .../agent/manifestops/worker_factory.go | 158 - .../gitops/agent/manifestops/worker_test.go | 406 -- internal/module/gitops/api.go | 7 - internal/module/gitops/rpc/BUILD.bazel | 59 - .../module/gitops/rpc/obj_to_sync_watcher.go | 125 - .../gitops/rpc/obj_to_sync_watcher_test.go | 217 - internal/module/gitops/rpc/rpc.pb.go | 766 --- internal/module/gitops/rpc/rpc.pb.validate.go | 1194 ---- internal/module/gitops/rpc/rpc.proto | 110 - internal/module/gitops/rpc/rpc_extra.go | 42 - internal/module/gitops/rpc/rpc_extra_test.go | 106 - internal/module/gitops/rpc/rpc_grpc.pb.go | 137 - internal/module/gitops/server/BUILD.bazel | 82 - internal/module/gitops/server/defaulting.go | 33 - internal/module/gitops/server/factory.go | 87 - internal/module/gitops/server/module.go | 18 - internal/module/gitops/server/module_test.go | 11 - .../gitops/server/project_info_client.go | 27 - internal/module/gitops/server/server.go | 325 - internal/module/gitops/server/server_test.go | 728 --- internal/module/gitops/server/visitor.go | 34 - internal/module/gitops/server/visitor_test.go | 69 - internal/module/modserver/api.go | 2 - pkg/entity/entity_extra.go | 16 - 109 files changed, 29 insertions(+), 24416 deletions(-) delete mode 100644 internal/gitaly/BUILD.bazel delete mode 100644 internal/gitaly/error.go delete mode 100644 internal/gitaly/error_test.go delete mode 100644 internal/gitaly/feature_flags.go delete mode 100644 internal/gitaly/fetch_visitors.go delete mode 100644 internal/gitaly/fetch_visitors_test.go delete mode 100644 internal/gitaly/path_fetcher.go delete mode 100644 internal/gitaly/path_fetcher_test.go delete mode 100644 internal/gitaly/path_visitor.go delete mode 100644 internal/gitaly/path_visitor_test.go delete mode 100644 internal/gitaly/poller.go delete mode 100644 internal/gitaly/poller_test.go delete mode 100644 internal/gitaly/pool.go delete mode 100644 internal/gitaly/vendored/README.md delete mode 100644 internal/gitaly/vendored/backoff/BUILD.bazel delete mode 100644 internal/gitaly/vendored/backoff/backoff.go delete mode 100644 internal/gitaly/vendored/client/BUILD.bazel delete mode 100644 internal/gitaly/vendored/client/dial.go delete mode 100644 internal/gitaly/vendored/client/pool.go delete mode 100644 internal/gitaly/vendored/client/pool_options.go delete mode 100644 internal/gitaly/vendored/dnsresolver/BUILD.bazel delete mode 100644 internal/gitaly/vendored/dnsresolver/builder.go delete mode 100644 internal/gitaly/vendored/dnsresolver/noop.go delete mode 100644 internal/gitaly/vendored/dnsresolver/resolver.go delete mode 100644 internal/gitaly/vendored/dnsresolver/target.go delete mode 100644 internal/gitaly/vendored/gitalyauth/BUILD.bazel delete mode 100644 internal/gitaly/vendored/gitalyauth/rpccredentials.go delete mode 100644 internal/gitaly/vendored/gitalyauth/token.go delete mode 100644 internal/gitaly/vendored/gitalypb/BUILD.bazel delete mode 100644 internal/gitaly/vendored/gitalypb/commit.pb.go delete mode 100644 internal/gitaly/vendored/gitalypb/commit.proto delete mode 100644 internal/gitaly/vendored/gitalypb/commit_grpc.pb.go delete mode 100644 internal/gitaly/vendored/gitalypb/errors.pb.go delete mode 100644 internal/gitaly/vendored/gitalypb/errors.proto delete mode 100644 internal/gitaly/vendored/gitalypb/lint.pb.go delete mode 100644 internal/gitaly/vendored/gitalypb/lint.proto delete mode 100644 internal/gitaly/vendored/gitalypb/packfile.pb.go delete mode 100644 internal/gitaly/vendored/gitalypb/packfile.proto delete mode 100644 internal/gitaly/vendored/gitalypb/service_config.pb.go delete mode 100644 internal/gitaly/vendored/gitalypb/service_config.proto delete mode 100644 internal/gitaly/vendored/gitalypb/shared.pb.go delete mode 100644 internal/gitaly/vendored/gitalypb/shared.proto delete mode 100644 internal/gitaly/vendored/gitalypb/smarthttp.pb.go delete mode 100644 internal/gitaly/vendored/gitalypb/smarthttp.proto delete mode 100644 internal/gitaly/vendored/gitalypb/smarthttp_grpc.pb.go delete mode 100644 internal/gitaly/vendored/gittest/BUILD.bazel delete mode 100644 internal/gitaly/vendored/gittest/pktline.go delete mode 100644 internal/gitaly/vendored/grpc/client/BUILD.bazel delete mode 100644 internal/gitaly/vendored/grpc/client/address_parser.go delete mode 100644 internal/gitaly/vendored/grpc/client/dial.go delete mode 100644 internal/gitaly/vendored/pktline/BUILD.bazel delete mode 100644 internal/gitaly/vendored/pktline/pkt_line_test.go delete mode 100644 internal/gitaly/vendored/pktline/pktline.go delete mode 100644 internal/gitaly/vendored/stats/BUILD.bazel delete mode 100644 internal/gitaly/vendored/stats/reference_discovery.go delete mode 100644 internal/gitaly/vendored/stats/reference_discovery_test.go delete mode 100644 internal/gitaly/vendored/structerr/BUILD.bazel delete mode 100644 internal/gitaly/vendored/structerr/error.go delete mode 100644 internal/module/agent_configuration/server/server.go delete mode 100644 internal/module/agent_configuration/server/server_test.go delete mode 100644 internal/module/configuration_project/server/factory.go delete mode 100644 internal/module/configuration_project/server/server.go delete mode 100644 internal/module/configuration_project/server/server_test.go delete mode 100644 internal/module/gitops/BUILD.bazel delete mode 100644 internal/module/gitops/agent/manifestops/BUILD.bazel delete mode 100644 internal/module/gitops/agent/manifestops/doc.go delete mode 100644 internal/module/gitops/agent/manifestops/factory.go delete mode 100644 internal/module/gitops/agent/manifestops/mock_for_test.go delete mode 100644 internal/module/gitops/agent/manifestops/module.go delete mode 100644 internal/module/gitops/agent/manifestops/module_test.go delete mode 100644 internal/module/gitops/agent/manifestops/retry_pipeline.go delete mode 100644 internal/module/gitops/agent/manifestops/retry_pipeline_test.go delete mode 100644 internal/module/gitops/agent/manifestops/sync_decoder.go delete mode 100644 internal/module/gitops/agent/manifestops/sync_decoder_test.go delete mode 100644 internal/module/gitops/agent/manifestops/worker.go delete mode 100644 internal/module/gitops/agent/manifestops/worker_1_watch.go delete mode 100644 internal/module/gitops/agent/manifestops/worker_2_decode.go delete mode 100644 internal/module/gitops/agent/manifestops/worker_3_apply.go delete mode 100644 internal/module/gitops/agent/manifestops/worker_factory.go delete mode 100644 internal/module/gitops/agent/manifestops/worker_test.go delete mode 100644 internal/module/gitops/api.go delete mode 100644 internal/module/gitops/rpc/BUILD.bazel delete mode 100644 internal/module/gitops/rpc/obj_to_sync_watcher.go delete mode 100644 internal/module/gitops/rpc/obj_to_sync_watcher_test.go delete mode 100644 internal/module/gitops/rpc/rpc.pb.go delete mode 100644 internal/module/gitops/rpc/rpc.pb.validate.go delete mode 100644 internal/module/gitops/rpc/rpc.proto delete mode 100644 internal/module/gitops/rpc/rpc_extra.go delete mode 100644 internal/module/gitops/rpc/rpc_extra_test.go delete mode 100644 internal/module/gitops/rpc/rpc_grpc.pb.go delete mode 100644 internal/module/gitops/server/BUILD.bazel delete mode 100644 internal/module/gitops/server/defaulting.go delete mode 100644 internal/module/gitops/server/factory.go delete mode 100644 internal/module/gitops/server/module.go delete mode 100644 internal/module/gitops/server/module_test.go delete mode 100644 internal/module/gitops/server/project_info_client.go delete mode 100644 internal/module/gitops/server/server.go delete mode 100644 internal/module/gitops/server/server_test.go delete mode 100644 internal/module/gitops/server/visitor.go delete mode 100644 internal/module/gitops/server/visitor_test.go delete mode 100644 pkg/entity/entity_extra.go diff --git a/cmd/kas/kasapp/configured_app.go b/cmd/kas/kasapp/configured_app.go index c61bba8e..ab702386 100644 --- a/cmd/kas/kasapp/configured_app.go +++ b/cmd/kas/kasapp/configured_app.go @@ -62,6 +62,8 @@ import ( observability_server "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/observability/server" reverse_tunnel_server "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/reverse_tunnel/server" "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/reverse_tunnel/tunnel" + "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/usage_metrics" + usage_metrics_server "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/usage_metrics/server" "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/cache" "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/errz" "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/grpctool" @@ -74,6 +76,22 @@ import ( "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/retry" "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/tlstool" "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/pkg/kascfg" + "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp" + promexp "go.opentelemetry.io/otel/exporters/prometheus" + otelmetric "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/propagation" + metricsdk "go.opentelemetry.io/otel/sdk/metric" + "go.opentelemetry.io/otel/sdk/resource" + tracesdk "go.opentelemetry.io/otel/sdk/trace" + semconv "go.opentelemetry.io/otel/semconv/v1.21.0" + "go.opentelemetry.io/otel/trace" + "go.uber.org/zap" + "golang.org/x/time/rate" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" + _ "google.golang.org/grpc/encoding/gzip" // Install the gzip compressor ) const ( @@ -233,6 +251,9 @@ func (a *ConfiguredApp) Run(ctx context.Context) (retErr error) { // Agent tracker agentTracker := a.constructAgentTracker(errRep, redisClient) + // Usage tracker + usageTracker := usage_metrics.NewUsageTracker() + // Gitaly client gitalyClientPool, err := a.constructGitalyPool(csh, dt, dm, tp, mp, p, streamClientProm, unaryClientProm) if err != nil { @@ -256,6 +277,9 @@ func (a *ConfiguredApp) Run(ctx context.Context) (retErr error) { }, &flux_server.Factory{}, &gitops_server.Factory{}, + &usage_metrics_server.Factory{ + UsageTracker: usageTracker, + }, &gitlab_access_server.Factory{}, &agent_registrar_server.Factory{ AgentRegisterer: agentTracker, @@ -284,6 +308,7 @@ func (a *ConfiguredApp) Run(ctx context.Context) (retErr error) { Config: a.Configuration, GitLabClient: gitLabClient, Registerer: reg, + UsageTracker: usageTracker, AgentServer: agentSrv.server, ApiServer: apiSrv.server, RegisterAgentApi: kasToAgentRouter.RegisterAgentApi, diff --git a/cmd/kas/kasapp/defaulting.go b/cmd/kas/kasapp/defaulting.go index b0f3c3ed..5cfdbfb0 100644 --- a/cmd/kas/kasapp/defaulting.go +++ b/cmd/kas/kasapp/defaulting.go @@ -4,7 +4,6 @@ import ( "time" agent_configuration_server "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/agent_configuration/server" - gitops_server "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/gitops/server" google_profiler_server "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/google_profiler/server" kubernetes_api_server "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/kubernetes_api/server" "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/modserver" @@ -55,7 +54,11 @@ var ( observability_server.ApplyDefaults, google_profiler_server.ApplyDefaults, agent_configuration_server.ApplyDefaults, +<<<<<<< HEAD gitops_server.ApplyDefaults, +======= + usage_metrics_server.ApplyDefaults, +>>>>>>> ee890343 (cleanup gitops) kubernetes_api_server.ApplyDefaults, } ) diff --git a/internal/api/types.go b/internal/api/types.go index 5b3ce4ba..f1970b6d 100644 --- a/internal/api/types.go +++ b/internal/api/types.go @@ -3,7 +3,6 @@ package api import ( "crypto/sha256" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/gitalypb" "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/pkg/entity" "go.opentelemetry.io/otel/attribute" ) @@ -27,7 +26,6 @@ type AgentInfo struct { // Can contain only /a-z\d-/ Name string GitalyInfo *entity.GitalyInfo - Repository *gitalypb.Repository // DefaultBranch is the name of the default branch in the agent's configuration repository. DefaultBranch string } @@ -35,7 +33,6 @@ type AgentInfo struct { type ProjectInfo struct { ProjectId int64 GitalyInfo *entity.GitalyInfo - Repository *gitalypb.Repository // DefaultBranch is the name of the default branch in a repository. DefaultBranch string } diff --git a/internal/fake/api/get_agent_info.go b/internal/fake/api/get_agent_info.go index 40c0dec5..ff7bec6e 100644 --- a/internal/fake/api/get_agent_info.go +++ b/internal/fake/api/get_agent_info.go @@ -18,7 +18,6 @@ func GetAgentInfo(ctx context.Context, agentToken api.AgentToken, opts ...gitlab Id: 123456, ProjectId: 0, Name: "fake-agent", - Repository: nil, DefaultBranch: "", GitalyInfo: &entity.GitalyInfo{ Address: "127.0.0.1", diff --git a/internal/gitaly/BUILD.bazel b/internal/gitaly/BUILD.bazel deleted file mode 100644 index 7e4cff60..00000000 --- a/internal/gitaly/BUILD.bazel +++ /dev/null @@ -1,51 +0,0 @@ -load("//build:build.bzl", "go_custom_test") -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "gitaly", - srcs = [ - "error.go", - "feature_flags.go", - "fetch_visitors.go", - "path_fetcher.go", - "path_visitor.go", - "poller.go", - "pool.go", - ], - importpath = "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly", - visibility = ["//:__subpackages__"], - deps = [ - "//internal/gitaly/vendored/gitalypb", - "//internal/gitaly/vendored/stats", - "//internal/tool/ioz", - "//pkg/entity", - "@com_github_bmatcuk_doublestar_v2//:doublestar", - "@org_golang_google_grpc//:grpc", - "@org_golang_google_grpc//codes", - "@org_golang_google_grpc//metadata", - "@org_golang_google_grpc//status", - ], -) - -go_custom_test( - name = "gitaly_test", - srcs = [ - "error_test.go", - "fetch_visitors_test.go", - "path_fetcher_test.go", - "path_visitor_test.go", - "poller_test.go", - ], - embed = [":gitaly"], - deps = [ - "//internal/gitaly/vendored/gitalypb", - "//internal/tool/testing/matcher", - "//internal/tool/testing/mock_gitaly", - "//internal/tool/testing/mock_internalgitaly", - "@com_github_stretchr_testify//assert", - "@com_github_stretchr_testify//require", - "@org_golang_google_grpc//codes", - "@org_golang_google_grpc//status", - "@org_uber_go_mock//gomock", - ], -) diff --git a/internal/gitaly/error.go b/internal/gitaly/error.go deleted file mode 100644 index 0d8feb6b..00000000 --- a/internal/gitaly/error.go +++ /dev/null @@ -1,161 +0,0 @@ -package gitaly - -import ( - "errors" - "fmt" - - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/gitalypb" - "google.golang.org/grpc/status" -) - -type ErrorCode int - -const ( - // UnknownError - what happened is unknown - UnknownError ErrorCode = iota - // NotFound - file/directory/ref was not found - NotFound - // FileTooBig - file is too big - FileTooBig - // RpcError - gRPC returned an error - RpcError - // ProtocolError - protocol violation, an unexpected situation occurred. - ProtocolError - // UnexpectedTreeEntryType - returned when TreeEntryResponse has an unexpected type. - UnexpectedTreeEntryType - // InvalidArgument - returned when Gitaly responds with InvalidArgument status code. - InvalidArgument -) - -func (e ErrorCode) String() string { - switch e { - case UnknownError: - return "UnknownErr" - case NotFound: - return "NotFound" - case FileTooBig: - return "FileTooBig" - case RpcError: - return "RpcError" - case ProtocolError: - return "ProtocolError" - case UnexpectedTreeEntryType: - return "UnexpectedTreeEntryType" - case InvalidArgument: - return "InvalidArgument" - default: - return fmt.Sprintf("invalid ErrorCode: %d", e) - } -} - -type Error struct { - Code ErrorCode - Cause error - Message string - // RpcName is the name of gRPC method that failed. - RpcName string - // Path contains name of the file or directory the operation was being carried on. - Path string -} - -func NewNotFoundError(rpcName, path string) error { - return &Error{ - Code: NotFound, - Message: "file/directory/ref not found", - RpcName: rpcName, - Path: path, - } -} - -func NewFileTooBigError(err error, rpcName, path string) error { - return &Error{ - Code: FileTooBig, - Cause: err, - Message: "file is too big", - RpcName: rpcName, - Path: path, - } -} - -func NewUnexpectedTreeEntryTypeError(rpcName, path string) error { - return &Error{ - Code: UnexpectedTreeEntryType, - Message: "file is not a usual file", - RpcName: rpcName, - Path: path, - } -} - -func NewRpcError(err error, rpcName, path string) error { - return &Error{ - Code: RpcError, - Cause: err, - Message: "RPC failed", - RpcName: rpcName, - Path: path, - } -} - -func NewProtocolError(err error, message, rpcName, path string) error { - return &Error{ - Code: ProtocolError, - Cause: err, - Message: message, - RpcName: rpcName, - Path: path, - } -} - -func NewInvalidArgument(err error, rpcName, path string) error { - return &Error{ - Code: InvalidArgument, - Cause: err, - Message: "invalid argument", - RpcName: rpcName, - Path: path, - } -} - -func (e *Error) Error() string { - format := "%s" - args := []interface{}{e.Code} - if e.RpcName != "" { - format += ": %s" - args = append(args, e.RpcName) - } - format += ": %s" - args = append(args, e.Message) - if e.Path != "" { - format += ": %s" - args = append(args, e.Path) - } - if e.Cause != nil { - format += ": %v" - args = append(args, e.Cause) - } - return fmt.Sprintf(format, args...) -} - -func (e *Error) Unwrap() error { - return e.Cause -} - -func ErrorCodeFromError(err error) ErrorCode { - var e *Error - if !errors.As(err, &e) { - return UnknownError - } - return e.Code -} - -func isInvalidRevisionOrPath(err error) bool { - s := status.Convert(err) - for _, d := range s.Details() { - if e, ok := d.(*gitalypb.GetTreeEntriesError); ok { - if _, ok = e.Error.(*gitalypb.GetTreeEntriesError_ResolveTree); ok { - return true - } - } - } - return false -} diff --git a/internal/gitaly/error_test.go b/internal/gitaly/error_test.go deleted file mode 100644 index c88cb6bc..00000000 --- a/internal/gitaly/error_test.go +++ /dev/null @@ -1,115 +0,0 @@ -package gitaly - -import ( - "context" - "errors" - "fmt" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -var ( - _ error = &Error{} -) - -func TestErrorUnwrap(t *testing.T) { - e := &Error{ - Code: RpcError, - Cause: context.Canceled, - Message: "bla", - } - assert.Equal(t, context.Canceled, e.Unwrap()) - assert.True(t, errors.Is(e, context.Canceled)) -} - -func TestErrorString(t *testing.T) { - e := &Error{ - Code: RpcError, - Message: "bla", - } - assert.EqualError(t, e, "RpcError: bla") - - e = &Error{ - Code: RpcError, - Cause: context.Canceled, - Message: "bla", - } - assert.EqualError(t, e, "RpcError: bla: context canceled") - - e = &Error{ - Code: RpcError, - Cause: context.Canceled, - Message: "bla", - Path: "path", - } - assert.EqualError(t, e, "RpcError: bla: path: context canceled") - - e = &Error{ - Code: RpcError, - Message: "bla", - Path: "path", - } - assert.EqualError(t, e, "RpcError: bla: path") - - e = &Error{ - Code: RpcError, - Cause: context.Canceled, - Message: "bla", - RpcName: "GetFoo", - Path: "path", - } - assert.EqualError(t, e, "RpcError: GetFoo: bla: path: context canceled") - - e = &Error{ - Code: RpcError, - Message: "bla", - RpcName: "GetFoo", - Path: "path", - } - assert.EqualError(t, e, "RpcError: GetFoo: bla: path") - - e = &Error{ - Code: RpcError, - Message: "bla", - Path: "path", - } - assert.EqualError(t, e, "RpcError: bla: path") -} - -func TestUnknownErrorCode(t *testing.T) { - var e ErrorCode = -1 - assert.Equal(t, "invalid ErrorCode: -1", e.String()) -} - -func TestErrorCodeFromError(t *testing.T) { - e := &Error{ - Code: RpcError, - } - assert.Equal(t, RpcError, ErrorCodeFromError(e)) - - err := fmt.Errorf("%w", e) - assert.Equal(t, RpcError, ErrorCodeFromError(err)) - - err = errors.New("bla") - assert.Equal(t, UnknownError, ErrorCodeFromError(err)) -} - -func TestErrorToGrpcError(t *testing.T) { - e := &Error{ - Code: RpcError, - Cause: status.Error(codes.DataLoss, "oh no"), - Message: "msg", - RpcName: "/gitlab.agent.grpctool.test.Testing/RequestResponse", - Path: "path", - } - - s, ok := status.FromError(e) - require.True(t, ok) - assert.Equal(t, codes.DataLoss, s.Code()) - assert.Equal(t, "RpcError: /gitlab.agent.grpctool.test.Testing/RequestResponse: msg: path: rpc error: code = DataLoss desc = oh no", s.Message()) - assert.EqualError(t, s.Err(), "rpc error: code = DataLoss desc = RpcError: /gitlab.agent.grpctool.test.Testing/RequestResponse: msg: path: rpc error: code = DataLoss desc = oh no") -} diff --git a/internal/gitaly/feature_flags.go b/internal/gitaly/feature_flags.go deleted file mode 100644 index b5617e97..00000000 --- a/internal/gitaly/feature_flags.go +++ /dev/null @@ -1,18 +0,0 @@ -package gitaly - -import ( - "context" - - "google.golang.org/grpc/metadata" -) - -func appendFeatureFlagsToContext(ctx context.Context, features map[string]string) context.Context { - if len(features) == 0 { - return ctx - } - kv := make([]string, 0, len(features)*2) - for k, v := range features { - kv = append(kv, k, v) - } - return metadata.AppendToOutgoingContext(ctx, kv...) -} diff --git a/internal/gitaly/fetch_visitors.go b/internal/gitaly/fetch_visitors.go deleted file mode 100644 index 50cb03c0..00000000 --- a/internal/gitaly/fetch_visitors.go +++ /dev/null @@ -1,245 +0,0 @@ -package gitaly - -import ( - "fmt" - "path" - "strings" - - "github.com/bmatcuk/doublestar/v2" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/gitalypb" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -type DupBehavior byte - -const ( - // DupError means "return error on duplicate file". - DupError DupBehavior = 1 - // DupSkip means "skip duplicate files". - DupSkip DupBehavior = 2 -) - -type ChunkingFetchVisitor struct { - FetchVisitor - maxChunkSize int -} - -func NewChunkingFetchVisitor(delegate FetchVisitor, maxChunkSize int) *ChunkingFetchVisitor { - return &ChunkingFetchVisitor{ - FetchVisitor: delegate, - maxChunkSize: maxChunkSize, - } -} - -func (v ChunkingFetchVisitor) StreamChunk(path []byte, data []byte) (bool /* done? */, error) { - for { - bytesToSend := minInt(len(data), v.maxChunkSize) - done, err := v.FetchVisitor.StreamChunk(path, data[:bytesToSend]) - if err != nil || done { - return done, err - } - data = data[bytesToSend:] - if len(data) == 0 { - break - } - } - return false, nil -} - -type MaxNumberOfFilesError struct { - MaxNumberOfFiles uint32 -} - -func (e *MaxNumberOfFilesError) Error() string { - return fmt.Sprintf("maximum number of files limit reached: %d", e.MaxNumberOfFiles) -} - -type EntryCountLimitingFetchVisitor struct { - FetchVisitor - maxNumberOfFiles uint32 - FilesVisited uint32 - FilesSent uint32 -} - -func NewEntryCountLimitingFetchVisitor(delegate FetchVisitor, maxNumberOfFiles uint32) *EntryCountLimitingFetchVisitor { - return &EntryCountLimitingFetchVisitor{ - FetchVisitor: delegate, - maxNumberOfFiles: maxNumberOfFiles, - } -} - -func (v *EntryCountLimitingFetchVisitor) Entry(entry *gitalypb.TreeEntry) (bool /* download? */, int64 /* max size */, error) { - if v.FilesVisited == v.maxNumberOfFiles { - return false, 0, &MaxNumberOfFilesError{ - MaxNumberOfFiles: v.maxNumberOfFiles, - } - } - v.FilesVisited++ - return v.FetchVisitor.Entry(entry) -} - -func (v *EntryCountLimitingFetchVisitor) EntryDone(entry *gitalypb.TreeEntry, err error) { - v.FetchVisitor.EntryDone(entry, err) - if err != nil { - return - } - v.FilesSent++ -} - -type TotalSizeLimitingFetchVisitor struct { - FetchVisitor - RemainingTotalFileSize int64 -} - -func NewTotalSizeLimitingFetchVisitor(delegate FetchVisitor, maxTotalFileSize int64) *TotalSizeLimitingFetchVisitor { - return &TotalSizeLimitingFetchVisitor{ - FetchVisitor: delegate, - RemainingTotalFileSize: maxTotalFileSize, - } -} - -func (v *TotalSizeLimitingFetchVisitor) Entry(entry *gitalypb.TreeEntry) (bool /* download? */, int64 /* max size */, error) { - shouldDownload, maxSize, err := v.FetchVisitor.Entry(entry) - if err != nil || !shouldDownload { - return false, 0, err - } - return true, minInt64(v.RemainingTotalFileSize, maxSize), nil -} - -func (v *TotalSizeLimitingFetchVisitor) StreamChunk(path []byte, data []byte) (bool /* done? */, error) { - v.RemainingTotalFileSize -= int64(len(data)) - if v.RemainingTotalFileSize < 0 { - // This should never happen because we told Gitaly the maximum file size that we'd like to get. - // i.e. we should have gotten an error from Gitaly if file is bigger than the limit. - return false, status.Error(codes.Internal, "unexpected negative remaining total file size") - } - return v.FetchVisitor.StreamChunk(path, data) -} - -type HiddenDirFilteringFetchVisitor struct { - FetchVisitor -} - -func NewHiddenDirFilteringFetchVisitor(delegate FetchVisitor) *HiddenDirFilteringFetchVisitor { - return &HiddenDirFilteringFetchVisitor{ - FetchVisitor: delegate, - } -} - -func (v HiddenDirFilteringFetchVisitor) Entry(entry *gitalypb.TreeEntry) (bool /* download? */, int64 /* max size */, error) { - if isHiddenDir(string(entry.Path)) { - return false, 0, nil - } - return v.FetchVisitor.Entry(entry) -} - -type GlobMatchFailedError struct { - Cause error - Glob string -} - -func (e *GlobMatchFailedError) Error() string { - return fmt.Sprintf("glob %s match failed: %v", e.Glob, e.Cause) -} - -func (e *GlobMatchFailedError) Unwrap() error { - return e.Cause -} - -type GlobFilteringFetchVisitor struct { - FetchVisitor - Glob string -} - -func NewGlobFilteringFetchVisitor(delegate FetchVisitor, glob string) *GlobFilteringFetchVisitor { - return &GlobFilteringFetchVisitor{ - FetchVisitor: delegate, - Glob: glob, - } -} - -func (v GlobFilteringFetchVisitor) Entry(entry *gitalypb.TreeEntry) (bool /* download? */, int64 /* max size */, error) { - shouldDownload, err := doublestar.Match(v.Glob, string(entry.Path)) - if err != nil { - return false, 0, &GlobMatchFailedError{ - Cause: err, - Glob: v.Glob, - } - } - if !shouldDownload { - return false, 0, nil - } - return v.FetchVisitor.Entry(entry) -} - -type DuplicatePathFoundError struct { - Path string -} - -func (e *DuplicatePathFoundError) Error() string { - return fmt.Sprintf("path visited more than once: %s", e.Path) -} - -type DuplicatePathDetectingVisitor struct { - FetchVisitor - visited map[string]struct{} - DupBehavior DupBehavior -} - -func NewDuplicateFileDetectingVisitor(delegate FetchVisitor, dupBehavior DupBehavior) DuplicatePathDetectingVisitor { - return DuplicatePathDetectingVisitor{ - FetchVisitor: delegate, - visited: map[string]struct{}{}, - DupBehavior: dupBehavior, - } -} - -func (v DuplicatePathDetectingVisitor) Entry(entry *gitalypb.TreeEntry) (bool /* download? */, int64 /* max size */, error) { - p := string(entry.Path) - if _, visited := v.visited[p]; visited { - switch v.DupBehavior { - case DupError: - return false, 0, &DuplicatePathFoundError{ - Path: p, - } - case DupSkip: - return false, 0, nil - default: - panic(fmt.Errorf("unknown dup behavior: %d", v.DupBehavior)) - } - } - v.visited[p] = struct{}{} - return v.FetchVisitor.Entry(entry) -} - -// isHiddenDir checks if a file is in a directory, which name starts with a dot. -func isHiddenDir(filename string) bool { - dir := path.Dir(filename) - if dir == "." { // root directory special case - return false - } - parts := strings.Split(dir, "/") - for _, part := range parts { - if strings.HasPrefix(part, ".") { - return true - } - } - return false -} - -func minInt64(a, b int64) int64 { - if a < b { - return a - } - - return b -} - -func minInt(a, b int) int { - if a < b { - return a - } - - return b -} diff --git a/internal/gitaly/fetch_visitors_test.go b/internal/gitaly/fetch_visitors_test.go deleted file mode 100644 index c75af585..00000000 --- a/internal/gitaly/fetch_visitors_test.go +++ /dev/null @@ -1,340 +0,0 @@ -package gitaly_test - -import ( - "errors" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/gitalypb" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/matcher" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/mock_internalgitaly" - "go.uber.org/mock/gomock" -) - -const ( - defaultGitOpsManifestPathGlob = "**/*.{yaml,yml,json}" -) - -var ( - _ gitaly.FetchVisitor = gitaly.ChunkingFetchVisitor{} - _ gitaly.FetchVisitor = &gitaly.EntryCountLimitingFetchVisitor{} - _ gitaly.FetchVisitor = &gitaly.TotalSizeLimitingFetchVisitor{} - _ gitaly.FetchVisitor = gitaly.HiddenDirFilteringFetchVisitor{} - _ gitaly.FetchVisitor = gitaly.GlobFilteringFetchVisitor{} - _ gitaly.FetchVisitor = gitaly.DuplicatePathDetectingVisitor{} - _ error = &gitaly.GlobMatchFailedError{} - _ error = &gitaly.MaxNumberOfFilesError{} - _ error = &gitaly.DuplicatePathFoundError{} -) - -func TestChunkingFetchVisitor_Entry(t *testing.T) { - entry, fv := delegate(t) - v := gitaly.NewChunkingFetchVisitor(fv, 10) - download, maxSize, err := v.Entry(entry) - assert.True(t, download) - assert.EqualValues(t, 100, maxSize) - assert.NoError(t, err) -} - -func TestChunkingFetchVisitor_StreamChunk(t *testing.T) { - t.Run("empty data", func(t *testing.T) { - p := []byte{} - data := []byte{} - ctrl := gomock.NewController(t) - fv := mock_internalgitaly.NewMockFetchVisitor(ctrl) - fv.EXPECT(). - StreamChunk(p, data) - v := gitaly.NewChunkingFetchVisitor(fv, 10) - done, err := v.StreamChunk(p, data) - assert.False(t, done) - assert.NoError(t, err) - }) - t.Run("no chunking", func(t *testing.T) { - p := []byte{1, 2, 3} - data := []byte{4, 5, 6} - ctrl := gomock.NewController(t) - fv := mock_internalgitaly.NewMockFetchVisitor(ctrl) - fv.EXPECT(). - StreamChunk(p, data) - v := gitaly.NewChunkingFetchVisitor(fv, 10) - done, err := v.StreamChunk(p, data) - assert.False(t, done) - assert.NoError(t, err) - }) - t.Run("chunking", func(t *testing.T) { - p := []byte{1, 2, 3} - data := []byte{4, 5, 6} - ctrl := gomock.NewController(t) - fv := mock_internalgitaly.NewMockFetchVisitor(ctrl) - gomock.InOrder( - fv.EXPECT(). - StreamChunk(p, data[:2]), - fv.EXPECT(). - StreamChunk(p, data[2:]), - ) - v := gitaly.NewChunkingFetchVisitor(fv, 2) - done, err := v.StreamChunk(p, data) - assert.False(t, done) - assert.NoError(t, err) - }) - t.Run("done", func(t *testing.T) { - p := []byte{1, 2, 3} - data := []byte{4, 5, 6} - ctrl := gomock.NewController(t) - fv := mock_internalgitaly.NewMockFetchVisitor(ctrl) - fv.EXPECT(). - StreamChunk(p, data[:2]). - Return(true, nil) - v := gitaly.NewChunkingFetchVisitor(fv, 2) - done, err := v.StreamChunk(p, data) - assert.True(t, done) - assert.NoError(t, err) - }) - t.Run("error", func(t *testing.T) { - p := []byte{1, 2, 3} - data := []byte{4, 5, 6} - ctrl := gomock.NewController(t) - fv := mock_internalgitaly.NewMockFetchVisitor(ctrl) - fv.EXPECT(). - StreamChunk(p, data[:2]). - Return(false, errors.New("boom!")) - v := gitaly.NewChunkingFetchVisitor(fv, 2) - done, err := v.StreamChunk(p, data) - assert.False(t, done) - assert.EqualError(t, err, "boom!") - }) -} - -func TestEntryCountLimitingFetchVisitor(t *testing.T) { - p := []byte{1, 2, 3} - data := []byte{4, 5, 6} - entry, fv := delegate(t) - fv.EXPECT(). - StreamChunk(p, data) - fv.EXPECT(). - EntryDone(matcher.ProtoEq(t, entry), nil) - - v := gitaly.NewEntryCountLimitingFetchVisitor(fv, 1) - download, maxSize, err := v.Entry(entry) - require.NoError(t, err) - assert.EqualValues(t, 100, maxSize) - assert.True(t, download) - assert.EqualValues(t, 1, v.FilesVisited) - assert.Zero(t, v.FilesSent) - - done, err := v.StreamChunk(p, data) - require.NoError(t, err) - assert.False(t, done) - assert.Zero(t, v.FilesSent) - - v.EntryDone(entry, nil) - assert.EqualValues(t, 1, v.FilesSent) - - _, _, err = v.Entry(&gitalypb.TreeEntry{}) - assert.EqualError(t, err, "maximum number of files limit reached: 1") - assert.EqualValues(t, 1, v.FilesVisited) // still 1 - assert.EqualValues(t, 1, v.FilesSent) // still 1 -} - -func TestTotalSizeLimitingFetchVisitor(t *testing.T) { - p := []byte{1, 2, 3} - data := []byte{4, 5, 6} - entry, fv := delegate(t) - fv.EXPECT(). - StreamChunk(p, data) - - v := gitaly.NewTotalSizeLimitingFetchVisitor(fv, 50) - download, maxSize, err := v.Entry(entry) - require.NoError(t, err) - assert.EqualValues(t, 50, maxSize) - assert.True(t, download) - assert.EqualValues(t, 50, v.RemainingTotalFileSize) // still 50 - - done, err := v.StreamChunk(p, data) - require.NoError(t, err) - assert.False(t, done) - assert.EqualValues(t, 47, v.RemainingTotalFileSize) -} - -func TestTotalSizeLimitingFetchVisitor_Underflow(t *testing.T) { - p := []byte{1, 2, 3} - data := []byte{4, 5, 6} - entry, fv := delegate(t) - - v := gitaly.NewTotalSizeLimitingFetchVisitor(fv, 2) - _, _, err := v.Entry(entry) - require.NoError(t, err) - - _, err = v.StreamChunk(p, data) - assert.EqualError(t, err, "rpc error: code = Internal desc = unexpected negative remaining total file size") -} - -func TestHiddenDirFilteringFetchVisitor(t *testing.T) { - tests := []struct { - name string - path string - expectedDownload bool - }{ - { - path: ".dir/manifest1.yaml", - expectedDownload: false, - }, - { - path: "dir1/.dir2/manifest1.yaml", - expectedDownload: false, - }, - { - path: "manifest1.yaml", - expectedDownload: true, - }, - { - path: "dir1/manifest1.yaml", - expectedDownload: true, - }, - } - for _, tc := range tests { - t.Run(tc.path, func(t *testing.T) { - entry := &gitalypb.TreeEntry{ - Path: []byte(tc.path), // nolint: scopelint - } - ctrl := gomock.NewController(t) - fv := mock_internalgitaly.NewMockFetchVisitor(ctrl) - if tc.expectedDownload { // nolint: scopelint - fv.EXPECT(). - Entry(matcher.ProtoEq(t, entry)). - Return(true, int64(100), nil) - } - v := gitaly.NewHiddenDirFilteringFetchVisitor(fv) - download, _, err := v.Entry(entry) - require.NoError(t, err) - assert.Equal(t, tc.expectedDownload, download) // nolint: scopelint - }) - } -} - -func TestGlobFilteringFetchVisitor(t *testing.T) { - tests := []struct { - path string - glob string - expectedDownload bool - }{ - { - path: "manifest1.yaml", - glob: defaultGitOpsManifestPathGlob, - expectedDownload: true, - }, - { - path: "manifest1.yml", - glob: defaultGitOpsManifestPathGlob, - expectedDownload: true, - }, - { - path: "manifest1.json", - glob: defaultGitOpsManifestPathGlob, - expectedDownload: true, - }, - { - path: "dir/manifest1.yaml", - glob: defaultGitOpsManifestPathGlob, - expectedDownload: true, - }, - { - path: "dir/manifest1.yml", - glob: defaultGitOpsManifestPathGlob, - expectedDownload: true, - }, - { - path: "dir/manifest1.json", - glob: defaultGitOpsManifestPathGlob, - expectedDownload: true, - }, - { - path: "manifest1.txt", - glob: defaultGitOpsManifestPathGlob, - expectedDownload: false, - }, - { - path: "dir/manifest1.txt", - glob: defaultGitOpsManifestPathGlob, - expectedDownload: false, - }, - { - path: "dir1/manifest1.yaml", - glob: "**.yaml", // yes, this does not match "dir/file" names. See https://github.com/bmatcuk/doublestar/issues/48 - expectedDownload: false, - }, - { - path: "dir1/manifest1.yaml", - glob: "dir2/*.yml", - expectedDownload: false, - }, - { - path: "manifest1.yaml", - glob: "**.yaml", - expectedDownload: true, - }, - { - path: "manifest1.yaml", - glob: "**", - expectedDownload: true, - }, - { - path: "dir1/manifest1.yaml", - glob: "**", - expectedDownload: true, - }, - } - for _, tc := range tests { - t.Run(tc.path, func(t *testing.T) { - entry := &gitalypb.TreeEntry{ - Path: []byte(tc.path), // nolint: scopelint - } - ctrl := gomock.NewController(t) - fv := mock_internalgitaly.NewMockFetchVisitor(ctrl) - if tc.expectedDownload { // nolint: scopelint - fv.EXPECT(). - Entry(matcher.ProtoEq(t, entry)). - Return(true, int64(100), nil) - } - v := gitaly.NewGlobFilteringFetchVisitor(fv, tc.glob) // nolint: scopelint - download, _, err := v.Entry(entry) - require.NoError(t, err) - assert.Equal(t, tc.expectedDownload, download) // nolint: scopelint - }) - } -} - -func TestDuplicatePathDetectingVisitor(t *testing.T) { - entry, fv := delegate(t) - - v := gitaly.NewDuplicateFileDetectingVisitor(fv, gitaly.DupError) - download, maxSize, err := v.Entry(entry) - require.NoError(t, err) - assert.EqualValues(t, 100, maxSize) - assert.True(t, download) - - _, _, err = v.Entry(entry) - require.EqualError(t, err, "path visited more than once: manifest.yaml") - - v.DupBehavior = gitaly.DupSkip - - download, _, err = v.Entry(entry) - require.NoError(t, err) - assert.False(t, download) -} - -func delegate(t *testing.T) (*gitalypb.TreeEntry, *mock_internalgitaly.MockFetchVisitor) { - entry := &gitalypb.TreeEntry{ - Path: []byte("manifest.yaml"), - Type: gitalypb.TreeEntry_BLOB, - CommitOid: manifestRevision, - } - ctrl := gomock.NewController(t) - fv := mock_internalgitaly.NewMockFetchVisitor(ctrl) - fv.EXPECT(). - Entry(matcher.ProtoEq(t, entry)). - Return(true, int64(100), nil) - return entry, fv -} diff --git a/internal/gitaly/path_fetcher.go b/internal/gitaly/path_fetcher.go deleted file mode 100644 index ea47c96b..00000000 --- a/internal/gitaly/path_fetcher.go +++ /dev/null @@ -1,153 +0,0 @@ -package gitaly - -import ( - "context" - "io" - - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/gitalypb" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -type PathFetcherInterface interface { - // Visit returns a wrapped context.Canceled, context.DeadlineExceeded or gRPC error if ctx signals done and interrupts a running gRPC call. - // Visit returns *Error when an error occurs. - Visit(ctx context.Context, repo *gitalypb.Repository, revision, repoPath []byte, recursive bool, visitor FetchVisitor) error - // VisitSingleFile returns a wrapped context.Canceled, context.DeadlineExceeded or gRPC error if ctx signals done and interrupts a running gRPC call. - // VisitSingleFile returns *Error when an error occurs. - VisitSingleFile(ctx context.Context, repo *gitalypb.Repository, revision, repoPath []byte, visitor FetchVisitor) error - // StreamFile streams the specified revision of the file. - // The passed visitor is never called if file was not found. - // StreamFile returns a wrapped context.Canceled, context.DeadlineExceeded or gRPC error if ctx signals done and interrupts a running gRPC call. - // StreamFile returns *Error when an error occurs. - StreamFile(ctx context.Context, repo *gitalypb.Repository, revision, repoPath []byte, sizeLimit int64, v FileVisitor) error - // FetchFile fetches the specified revision of a file. - // FetchFile returns a wrapped context.Canceled, context.DeadlineExceeded or gRPC error if ctx signals done and interrupts a running gRPC call. - // FetchFile returns *Error when an error occurs. - FetchFile(ctx context.Context, repo *gitalypb.Repository, revision, repoPath []byte, sizeLimit int64) ([]byte, error) -} - -// FileVisitor is the visitor callback, invoked for each chunk of a file. -type FileVisitor interface { - Chunk(data []byte) (bool /* done? */, error) -} - -// FetchVisitor is the visitor callback, invoked for each chunk of each path entry. -type FetchVisitor interface { - Entry(*gitalypb.TreeEntry) (bool /* download? */, int64 /* max size */, error) - StreamChunk(path []byte, data []byte) (bool /* done? */, error) - // EntryDone is called after the entry has been fully streamed. - // It's not called for entries that are not streamed i.e. skipped. - EntryDone(*gitalypb.TreeEntry, error) -} - -type PathFetcher struct { - Client gitalypb.CommitServiceClient - Features map[string]string -} - -func (f *PathFetcher) Visit(ctx context.Context, repo *gitalypb.Repository, revision, repoPath []byte, recursive bool, visitor FetchVisitor) error { - v := PathVisitor{ - Client: f.Client, - Features: f.Features, - } - return v.Visit(ctx, repo, revision, repoPath, recursive, fetcherPathEntryVisitor(func(entry *gitalypb.TreeEntry) (bool /* done? */, error) { - return f.visitEntry(ctx, repo, entry, visitor) - })) -} - -func (f *PathFetcher) VisitSingleFile(ctx context.Context, repo *gitalypb.Repository, revision, repoPath []byte, visitor FetchVisitor) error { - entry := &gitalypb.TreeEntry{ - Path: repoPath, - Type: gitalypb.TreeEntry_BLOB, - CommitOid: string(revision), - } - _, err := f.visitEntry(ctx, repo, entry, visitor) - return err -} - -func (f *PathFetcher) visitEntry(ctx context.Context, repo *gitalypb.Repository, entry *gitalypb.TreeEntry, visitor FetchVisitor) (bool /* done? */, error) { - if entry.Type != gitalypb.TreeEntry_BLOB { - return false, nil - } - shouldFetch, maxSize, err := visitor.Entry(entry) - if err != nil || !shouldFetch { - return false, err - } - err = f.StreamFile(ctx, repo, []byte(entry.CommitOid), entry.Path, maxSize, fetcherFileVisitor(func(data []byte) (bool /* done? */, error) { - return visitor.StreamChunk(entry.Path, data) - })) - visitor.EntryDone(entry, err) - return false, err -} - -func (f *PathFetcher) StreamFile(ctx context.Context, repo *gitalypb.Repository, revision, repoPath []byte, sizeLimit int64, v FileVisitor) error { - ctx, cancel := context.WithCancel(appendFeatureFlagsToContext(ctx, f.Features)) - defer cancel() // ensure streaming call is canceled - teResp, err := f.Client.TreeEntry(ctx, &gitalypb.TreeEntryRequest{ - Repository: repo, - Revision: revision, - Path: repoPath, - MaxSize: sizeLimit, - }) - if err != nil { - return NewRpcError(err, "TreeEntry", string(repoPath)) - } - firstMessage := true - for { - entry, err := teResp.Recv() - if err != nil { - code := status.Code(err) - switch { - case code == codes.FailedPrecondition: - return NewFileTooBigError(err, "TreeEntry", string(repoPath)) - case code == codes.NotFound: - return NewNotFoundError("TreeEntry.Recv", string(repoPath)) - case err == io.EOF: // nolint:errorlint - return nil - default: - return NewRpcError(err, "TreeEntry.Recv", string(repoPath)) - } - } - if firstMessage { - firstMessage = false - if entry.Type != gitalypb.TreeEntryResponse_BLOB { - return NewUnexpectedTreeEntryTypeError("TreeEntry.Recv", string(repoPath)) - } - } - done, err := v.Chunk(entry.Data) - if err != nil || done { - return err - } - } -} - -func (f *PathFetcher) FetchFile(ctx context.Context, repo *gitalypb.Repository, revision, repoPath []byte, sizeLimit int64) ([]byte, error) { - v := &AccumulatingFileVisitor{} - err := f.StreamFile(ctx, repo, revision, repoPath, sizeLimit, v) - if err != nil { - return nil, err - } - return v.Data, nil -} - -type fetcherPathEntryVisitor func(*gitalypb.TreeEntry) (bool /* done? */, error) - -func (v fetcherPathEntryVisitor) Entry(entry *gitalypb.TreeEntry) (bool /* done? */, error) { - return v(entry) -} - -type fetcherFileVisitor func(data []byte) (bool /* done? */, error) - -func (v fetcherFileVisitor) Chunk(data []byte) (bool /* done? */, error) { - return v(data) -} - -type AccumulatingFileVisitor struct { - Data []byte -} - -func (a *AccumulatingFileVisitor) Chunk(data []byte) (bool /* done? */, error) { - a.Data = append(a.Data, data...) - return false, nil -} diff --git a/internal/gitaly/path_fetcher_test.go b/internal/gitaly/path_fetcher_test.go deleted file mode 100644 index bbabdc47..00000000 --- a/internal/gitaly/path_fetcher_test.go +++ /dev/null @@ -1,210 +0,0 @@ -package gitaly_test - -import ( - "context" - "io" - "testing" - - "github.com/stretchr/testify/require" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/gitalypb" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/matcher" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/mock_gitaly" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/mock_internalgitaly" - "go.uber.org/mock/gomock" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -const ( - fileMaxSize int64 = 1000 -) - -var ( - _ gitaly.FileVisitor = &gitaly.AccumulatingFileVisitor{} - _ gitaly.PathFetcherInterface = &gitaly.PathFetcher{} -) - -func TestPathFetcher_HappyPath(t *testing.T) { - ctrl := gomock.NewController(t) - r := repo() - treeEntriesReq := &gitalypb.GetTreeEntriesRequest{ - Repository: r, - Revision: []byte(revision), - Path: []byte(repoPath), - Recursive: false, - } - commitClient := mock_gitaly.NewMockCommitServiceClient(ctrl) - expectedEntry1 := &gitalypb.TreeEntry{ - Path: []byte("manifest1.yaml"), - Type: gitalypb.TreeEntry_BLOB, - CommitOid: manifestRevision, - } - data1 := []byte("data1") - treeEntry := &gitalypb.TreeEntry{ - Path: []byte("some_dir"), - Type: gitalypb.TreeEntry_TREE, - CommitOid: manifestRevision, - } - expectedEntry2 := &gitalypb.TreeEntry{ - Path: []byte("manifest2.yaml"), - Type: gitalypb.TreeEntry_BLOB, - CommitOid: manifestRevision, - } - data2 := []byte("data2") - features := map[string]string{ - "f1": "true", - } - ctxMatch := matcher.GrpcOutgoingCtx(features) - mockGetTreeEntries(t, ctrl, ctxMatch, commitClient, treeEntriesReq, []*gitalypb.TreeEntry{expectedEntry1, treeEntry, expectedEntry2}) - mockTreeEntry(t, ctrl, ctxMatch, commitClient, data1, &gitalypb.TreeEntryRequest{ - Repository: r, - Revision: []byte(expectedEntry1.CommitOid), - Path: expectedEntry1.Path, - MaxSize: fileMaxSize, - }) - mockTreeEntry(t, ctrl, ctxMatch, commitClient, data2, &gitalypb.TreeEntryRequest{ - Repository: r, - Revision: []byte(expectedEntry2.CommitOid), - Path: expectedEntry2.Path, - MaxSize: fileMaxSize, - }) - mockVisitor := mock_internalgitaly.NewMockFetchVisitor(ctrl) - gomock.InOrder( - mockVisitor.EXPECT(). - Entry(matcher.ProtoEq(t, expectedEntry1)). - Return(true, fileMaxSize, nil), - mockVisitor.EXPECT(). - StreamChunk(expectedEntry1.Path, data1[:1]), - mockVisitor.EXPECT(). - StreamChunk(expectedEntry1.Path, data1[1:]), - mockVisitor.EXPECT(). - EntryDone(matcher.ProtoEq(t, expectedEntry1), nil), - mockVisitor.EXPECT(). - Entry(matcher.ProtoEq(t, expectedEntry2)). - Return(true, fileMaxSize, nil), - mockVisitor.EXPECT(). - StreamChunk(expectedEntry2.Path, data2[:1]), - mockVisitor.EXPECT(). - StreamChunk(expectedEntry2.Path, data2[1:]), - mockVisitor.EXPECT(). - EntryDone(matcher.ProtoEq(t, expectedEntry2), nil), - ) - v := gitaly.PathFetcher{ - Client: commitClient, - Features: features, - } - err := v.Visit(context.Background(), r, []byte(revision), []byte(repoPath), false, mockVisitor) - require.NoError(t, err) -} - -func TestPathFetcher_StreamFile_NotFound(t *testing.T) { - ctrl := gomock.NewController(t) - commitClient := mock_gitaly.NewMockCommitServiceClient(ctrl) - treeEntryClient := mock_gitaly.NewMockCommitService_TreeEntryClient(ctrl) - mockVisitor := mock_internalgitaly.NewMockFileVisitor(ctrl) - r := repo() - req := &gitalypb.TreeEntryRequest{ - Repository: r, - Revision: []byte(revision), - Path: []byte(repoPath), - MaxSize: fileMaxSize, - } - gomock.InOrder( - commitClient.EXPECT(). - TreeEntry(gomock.Any(), matcher.ProtoEq(t, req)). - Return(treeEntryClient, nil), - treeEntryClient.EXPECT(). - Recv(). - Return(nil, status.Error(codes.NotFound, "file is not here")), - ) - v := gitaly.PathFetcher{ - Client: commitClient, - } - err := v.StreamFile(context.Background(), r, []byte(revision), []byte(repoPath), fileMaxSize, mockVisitor) - require.EqualError(t, err, "NotFound: TreeEntry.Recv: file/directory/ref not found: dir") -} - -func TestPathFetcher_StreamFile_TooBig(t *testing.T) { - ctrl := gomock.NewController(t) - commitClient := mock_gitaly.NewMockCommitServiceClient(ctrl) - treeEntryClient := mock_gitaly.NewMockCommitService_TreeEntryClient(ctrl) - mockVisitor := mock_internalgitaly.NewMockFileVisitor(ctrl) - r := repo() - req := &gitalypb.TreeEntryRequest{ - Repository: r, - Revision: []byte(revision), - Path: []byte(repoPath), - MaxSize: fileMaxSize, - } - gomock.InOrder( - commitClient.EXPECT(). - TreeEntry(gomock.Any(), matcher.ProtoEq(t, req)). - Return(treeEntryClient, nil), - treeEntryClient.EXPECT(). - Recv(). - Return(nil, status.Error(codes.FailedPrecondition, "file is too big")), - ) - v := gitaly.PathFetcher{ - Client: commitClient, - } - err := v.StreamFile(context.Background(), r, []byte(revision), []byte(repoPath), fileMaxSize, mockVisitor) - require.EqualError(t, err, "FileTooBig: TreeEntry: file is too big: dir: rpc error: code = FailedPrecondition desc = file is too big") -} - -func TestPathFetcher_StreamFile_InvalidType(t *testing.T) { - ctrl := gomock.NewController(t) - commitClient := mock_gitaly.NewMockCommitServiceClient(ctrl) - treeEntryClient := mock_gitaly.NewMockCommitService_TreeEntryClient(ctrl) - mockVisitor := mock_internalgitaly.NewMockFileVisitor(ctrl) - r := repo() - req := &gitalypb.TreeEntryRequest{ - Repository: r, - Revision: []byte(revision), - Path: []byte(repoPath), - MaxSize: fileMaxSize, - } - resp := &gitalypb.TreeEntryResponse{ - Type: gitalypb.TreeEntryResponse_COMMIT, - Oid: manifestRevision, - } - gomock.InOrder( - commitClient.EXPECT(). - TreeEntry(gomock.Any(), matcher.ProtoEq(t, req)). - Return(treeEntryClient, nil), - treeEntryClient.EXPECT(). - Recv(). - Return(resp, nil), - ) - v := gitaly.PathFetcher{ - Client: commitClient, - } - err := v.StreamFile(context.Background(), r, []byte(revision), []byte(repoPath), fileMaxSize, mockVisitor) - require.EqualError(t, err, "UnexpectedTreeEntryType: TreeEntry.Recv: file is not a usual file: dir") -} - -func mockTreeEntry(t *testing.T, ctrl *gomock.Controller, ctx gomock.Matcher, commitClient *mock_gitaly.MockCommitServiceClient, data []byte, req *gitalypb.TreeEntryRequest) { - treeEntryClient := mock_gitaly.NewMockCommitService_TreeEntryClient(ctrl) - // Emulate streaming response - resp1 := &gitalypb.TreeEntryResponse{ - Type: gitalypb.TreeEntryResponse_BLOB, // only the first response has the type set! - Data: data[:1], - } - resp2 := &gitalypb.TreeEntryResponse{ - Data: data[1:], - } - gomock.InOrder( - commitClient.EXPECT(). - TreeEntry(ctx, matcher.ProtoEq(t, req)). - Return(treeEntryClient, nil), - treeEntryClient.EXPECT(). - Recv(). - Return(resp1, nil), - treeEntryClient.EXPECT(). - Recv(). - Return(resp2, nil), - treeEntryClient.EXPECT(). - Recv(). - Return(nil, io.EOF), - ) -} diff --git a/internal/gitaly/path_visitor.go b/internal/gitaly/path_visitor.go deleted file mode 100644 index 2eb76420..00000000 --- a/internal/gitaly/path_visitor.go +++ /dev/null @@ -1,61 +0,0 @@ -package gitaly - -import ( - "context" - "io" - - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/gitalypb" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -type PathEntryVisitor interface { - Entry(*gitalypb.TreeEntry) (bool /* done? */, error) -} - -type PathVisitor struct { - Client gitalypb.CommitServiceClient - Features map[string]string -} - -func (v *PathVisitor) Visit(ctx context.Context, repo *gitalypb.Repository, revision, repoPath []byte, recursive bool, visitor PathEntryVisitor) error { - ctx, cancel := context.WithCancel(appendFeatureFlagsToContext(ctx, v.Features)) - defer cancel() // ensure streaming call is canceled - entries, err := v.Client.GetTreeEntries(ctx, &gitalypb.GetTreeEntriesRequest{ - Repository: repo, - Revision: revision, - Path: repoPath, - Recursive: recursive, - }) - if err != nil { - return NewRpcError(err, "GetTreeEntries", string(repoPath)) - } -entriesLoop: - for { - resp, err := entries.Recv() - if err != nil { - if err == io.EOF { // nolint:errorlint - break - } - switch status.Code(err) { // nolint:exhaustive - case codes.InvalidArgument: - if isInvalidRevisionOrPath(err) { - return NewNotFoundError("GetTreeEntries.Recv", string(repoPath)) - } - return NewInvalidArgument(err, "GetTreeEntries.Recv", string(repoPath)) - default: - return NewRpcError(err, "GetTreeEntries.Recv", string(repoPath)) - } - } - for _, entry := range resp.Entries { - done, err := visitor.Entry(entry) - if err != nil { - return err // don't wrap - } - if done { - break entriesLoop - } - } - } - return nil -} diff --git a/internal/gitaly/path_visitor_test.go b/internal/gitaly/path_visitor_test.go deleted file mode 100644 index c3974829..00000000 --- a/internal/gitaly/path_visitor_test.go +++ /dev/null @@ -1,76 +0,0 @@ -package gitaly_test - -import ( - "context" - "io" - "testing" - - "github.com/stretchr/testify/require" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/gitalypb" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/matcher" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/mock_gitaly" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/mock_internalgitaly" - "go.uber.org/mock/gomock" -) - -const ( - revision = "507ebc6de9bcac25628aa7afd52802a91a0685d8" - manifestRevision = "7afd52802a91a0685d8507ebc6de9bcac25628aa" - repoPath = "dir" -) - -func TestPathVisitor_HappyPath(t *testing.T) { - ctrl := gomock.NewController(t) - r := repo() - treeEntriesReq := &gitalypb.GetTreeEntriesRequest{ - Repository: r, - Revision: []byte(revision), - Path: []byte(repoPath), - Recursive: false, - } - commitClient := mock_gitaly.NewMockCommitServiceClient(ctrl) - expectedEntry := &gitalypb.TreeEntry{ - Path: []byte("manifest.yaml"), - Type: gitalypb.TreeEntry_BLOB, - CommitOid: manifestRevision, - } - features := map[string]string{ - "f1": "true", - } - mockGetTreeEntries(t, ctrl, matcher.GrpcOutgoingCtx(features), commitClient, treeEntriesReq, []*gitalypb.TreeEntry{expectedEntry}) - mockVisitor := mock_internalgitaly.NewMockPathEntryVisitor(ctrl) - mockVisitor.EXPECT(). - Entry(matcher.ProtoEq(t, expectedEntry)) - v := gitaly.PathVisitor{ - Client: commitClient, - Features: features, - } - err := v.Visit(context.Background(), r, []byte(revision), []byte(repoPath), false, mockVisitor) - require.NoError(t, err) -} - -func mockGetTreeEntries(t *testing.T, ctrl *gomock.Controller, ctx gomock.Matcher, commitClient *mock_gitaly.MockCommitServiceClient, req *gitalypb.GetTreeEntriesRequest, entries []*gitalypb.TreeEntry) { - treeEntriesClient := mock_gitaly.NewMockCommitService_GetTreeEntriesClient(ctrl) - gomock.InOrder( - commitClient.EXPECT(). - GetTreeEntries(ctx, matcher.ProtoEq(t, req), gomock.Any()). - Return(treeEntriesClient, nil), - treeEntriesClient.EXPECT(). - Recv(). - Return(&gitalypb.GetTreeEntriesResponse{Entries: entries}, nil), - treeEntriesClient.EXPECT(). - Recv(). - Return(nil, io.EOF), - ) -} - -func repo() *gitalypb.Repository { - return &gitalypb.Repository{ - StorageName: "StorageName1", - RelativePath: "RelativePath1", - GitObjectDirectory: "GitObjectDirectory1", - GlRepository: "GlRepository1", - GlProjectPath: "GlProjectPath1", - } -} diff --git a/internal/gitaly/poller.go b/internal/gitaly/poller.go deleted file mode 100644 index f52a5d18..00000000 --- a/internal/gitaly/poller.go +++ /dev/null @@ -1,142 +0,0 @@ -package gitaly - -import ( - "bytes" - "context" - "io" - - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/gitalypb" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/stats" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/ioz" -) - -const ( - DefaultBranch = "HEAD" - // Same as Gitaly, - //see https://gitlab.com/gitlab-org/gitaly/blob/2cb0d9f0604daabe63edc2c8271e65ef36ff6483/internal/git/repository.go#L16-16 - DefaultRef = "refs/heads/main" - // Same as Gitaly, - // see https://gitlab.com/gitlab-org/gitaly/blob/2cb0d9f0604daabe63edc2c8271e65ef36ff6483/internal/git/repository.go#L21-21 - LegacyDefaultRef = "refs/heads/master" -) - -// PollerInterface does the following: -// - polls ref advertisement for updates to the repository -// - detects which is the main branch, if branch or tag name is not specified -// - compares the commit id the branch or tag is referring to with the last processed one -// - returns the information about the change -type PollerInterface interface { - // Poll performs a poll on the repository. - // revision can be a branch name or a tag. - // Poll returns a wrapped context.Canceled, context.DeadlineExceeded or gRPC error if ctx signals done and interrupts a running gRPC call. - // Poll returns *Error when a error occurs. - Poll(ctx context.Context, repo *gitalypb.Repository, lastProcessedCommitId, refName string) (*PollInfo, error) -} - -type Poller struct { - Client gitalypb.SmartHTTPServiceClient - Features map[string]string -} - -type PollInfo struct { - CommitId string - UpdateAvailable bool - // EmptyRepository is true when polling the default branch but no refs were found. - // When polling non-default branch and no refs were found the NotFound error is returned. - EmptyRepository bool -} - -// Poll searched the given repository for the given fullRefName and returns a PollInfo containing a resolved Commit Object ID. -// Valid fullRefNames are: -// * `refs/heads/*` => for branches -// * `refs/tags/*` => for tags -// * `HEAD` => for the repository's default branch -func (p *Poller) Poll(ctx context.Context, repo *gitalypb.Repository, lastProcessedCommitId, fullRefName string) (*PollInfo, error) { - noRefs := true - var wanted, defaultRef, legacyDefaultRef *stats.Reference - err := p.fetchRefs(ctx, repo, func(ref stats.Reference) bool { - noRefs = false - // We implement a similar logic here to what Gitaly does in their `GetDefaultBranch` logic - // to find the default branch. - // see https://gitlab.com/gitlab-org/gitaly/blob/2cb0d9f0604daabe63edc2c8271e65ef36ff6483/internal/git/localrepo/refs.go#L345-345 - switch string(ref.Name) { - case fullRefName: - wanted = cloneReference(ref) - return true - case DefaultRef: - defaultRef = cloneReference(ref) - case LegacyDefaultRef: - legacyDefaultRef = cloneReference(ref) - } - return false - }) - if err != nil { - return nil, err // don't wrap - } - if noRefs { - return &PollInfo{ - EmptyRepository: true, - }, nil - } - - if wanted == nil { // not found - if fullRefName != DefaultBranch { // was looking for arbitrary branch, but didn't find it. - return nil, NewNotFoundError("InfoRefsUploadPack", fullRefName) - } - - // we have been searching for the default branch - switch { - case defaultRef != nil: - wanted = defaultRef - case legacyDefaultRef != nil: - wanted = legacyDefaultRef - default: - return nil, NewNotFoundError("InfoRefsUploadPack", "default branch") - } - } - oid := string(wanted.Oid) - return &PollInfo{ - CommitId: oid, - UpdateAvailable: oid != lastProcessedCommitId, - }, nil -} - -// fetchRefs returns a wrapped context.Canceled, context.DeadlineExceeded or gRPC error if ctx signals done and interrupts a running gRPC call. -// fetchRefs returns *Error when a error occurs. -func (p *Poller) fetchRefs(ctx context.Context, repo *gitalypb.Repository, cb stats.ReferenceCb) error { - ctx, cancel := context.WithCancel(appendFeatureFlagsToContext(ctx, p.Features)) - defer cancel() // ensure streaming call is canceled - uploadPackReq := &gitalypb.InfoRefsRequest{ - Repository: repo, - // Do not set GitConfigOptions or GitProtocol because that would disable cache in Gitaly. - // See https://gitlab.com/gitlab-org/gitaly/-/blob/bea500b301bbec8535fbcae58c1da2d29377c666/internal/gitaly/service/smarthttp/cache.go#L53-56 - } - uploadPackResp, err := p.Client.InfoRefsUploadPack(ctx, uploadPackReq) - if err != nil { - return NewRpcError(err, "InfoRefsUploadPack", "") - } - err = stats.ParseReferenceDiscovery(ioz.NewReceiveReader(func() ([]byte, error) { - entry, err := uploadPackResp.Recv() // nolint: govet - if err != nil { - if err == io.EOF { // nolint:errorlint - return nil, io.EOF - } - return nil, NewRpcError(err, "InfoRefsUploadPack.Recv", "") - } - return entry.Data, nil - }), cb) - if err != nil { - if _, ok := err.(*Error); ok { // nolint: errorlint - return err // A wrapped error already - } - return NewProtocolError(err, "failed to parse reference discovery", "", "") - } - return nil -} - -func cloneReference(ref stats.Reference) *stats.Reference { - return &stats.Reference{ - Oid: bytes.Clone(ref.Oid), - Name: bytes.Clone(ref.Name), - } -} diff --git a/internal/gitaly/poller_test.go b/internal/gitaly/poller_test.go deleted file mode 100644 index e72e3eda..00000000 --- a/internal/gitaly/poller_test.go +++ /dev/null @@ -1,267 +0,0 @@ -package gitaly - -import ( - "context" - "io" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/gitalypb" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/matcher" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/mock_gitaly" - "go.uber.org/mock/gomock" -) - -const ( - revision1 = "507ebc6de9bcac25628aa7afd52802a91a0685d8" - revision2 = "28aa7afd52802a91a0685d8507ebc6de9bcac256" - revision3 = "e9bcac25628aa7afd5507ebc6d2800685d82a91a" - - branch = "refs/heads/test-branch" - - infoRefsData = `001e# service=git-upload-pack -00000148` + revision1 + ` HEAD` + "\x00" + `multi_ack thin-pack side-band side-band-64k ofs-delta shallow deepen-since deepen-not deepen-relative no-progress include-tag multi_ack_detailed allow-tip-sha1-in-want allow-reachable-sha1-in-want no-done symref=HEAD:refs/heads/master filter object-format=sha1 agent=git/2.28.0 -003f` + revision1 + ` refs/heads/master -003d` + revision3 + ` refs/heads/main -0044` + revision2 + ` refs/heads/test-branch -0000` - - infoRefsMainMasterData = `001e# service=git-upload-pack -00000040` + revision1 + ` refs/heads/master` + "\x00" + ` -003d` + revision3 + ` refs/heads/main -0044` + revision2 + ` refs/heads/test-branch -0000` - - infoRefsEmptyData = `001e# service=git-upload-pack -00000000` -) - -var ( - _ PollerInterface = &Poller{} -) - -func TestPoller(t *testing.T) { - tests := []struct { - name string - data []byte - ref string - lastProcessedCommit string - expectedInfoCommit string - expectedInfoUpdate bool - }{ - { - name: "default branch same commit", - ref: DefaultBranch, - lastProcessedCommit: revision1, - expectedInfoCommit: revision1, - expectedInfoUpdate: false, - }, - { - name: "main branch same commit", - ref: "refs/heads/main", - lastProcessedCommit: revision3, - expectedInfoCommit: revision3, - expectedInfoUpdate: false, - }, - { - name: "master branch same commit", - ref: "refs/heads/master", - lastProcessedCommit: revision1, - expectedInfoCommit: revision1, - expectedInfoUpdate: false, - }, - { - name: "custom branch same commit", - ref: branch, - lastProcessedCommit: revision2, - expectedInfoCommit: revision2, - expectedInfoUpdate: false, - }, - { - name: "default branch no commit", - ref: DefaultBranch, - lastProcessedCommit: "", - expectedInfoCommit: revision1, - expectedInfoUpdate: true, - }, - { - name: "master branch no commit", - ref: "refs/heads/master", - lastProcessedCommit: "", - expectedInfoCommit: revision1, - expectedInfoUpdate: true, - }, - { - name: "custom branch no commit", - ref: branch, - lastProcessedCommit: "", - expectedInfoCommit: revision2, - expectedInfoUpdate: true, - }, - { - name: "default branch another commit", - ref: DefaultBranch, - lastProcessedCommit: "1231232", - expectedInfoCommit: revision1, - expectedInfoUpdate: true, - }, - { - name: "main branch another commit", - ref: "refs/heads/main", - lastProcessedCommit: "123123123", - expectedInfoCommit: revision3, - expectedInfoUpdate: true, - }, - { - name: "master branch another commit", - ref: "refs/heads/master", - lastProcessedCommit: "123123123", - expectedInfoCommit: revision1, - expectedInfoUpdate: true, - }, - { - name: "custom branch another commit", - ref: branch, - lastProcessedCommit: "13213123", - expectedInfoCommit: revision2, - expectedInfoUpdate: true, - }, - { - name: "no HEAD, main preferred to master", - data: []byte(infoRefsMainMasterData), - ref: DefaultBranch, - lastProcessedCommit: "13213123", - expectedInfoCommit: revision3, - expectedInfoUpdate: true, - }, - } - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - ctrl := gomock.NewController(t) - r := repo() - infoRefsReq := &gitalypb.InfoRefsRequest{Repository: r} - httpClient := mock_gitaly.NewMockSmartHTTPServiceClient(ctrl) - features := map[string]string{ - "f1": "true", - } - if tc.data == nil { - tc.data = []byte(infoRefsData) - } - mockInfoRefsUploadPack(t, ctrl, matcher.GrpcOutgoingCtx(features), httpClient, infoRefsReq, tc.data) - p := Poller{ - Client: httpClient, - Features: features, - } - pollInfo, err := p.Poll(context.Background(), r, tc.lastProcessedCommit, tc.ref) - require.NoError(t, err) - assert.Equal(t, tc.expectedInfoUpdate, pollInfo.UpdateAvailable) - assert.Equal(t, tc.expectedInfoCommit, pollInfo.CommitId) - }) - } -} - -func TestPoller_EmptyRepository(t *testing.T) { - for _, branch := range []string{DefaultBranch, "refs/heads/some_branch"} { - t.Run(branch, func(t *testing.T) { - ctrl := gomock.NewController(t) - r := repo() - infoRefsReq := &gitalypb.InfoRefsRequest{Repository: r} - httpClient := mock_gitaly.NewMockSmartHTTPServiceClient(ctrl) - mockInfoRefsUploadPack(t, ctrl, gomock.Any(), httpClient, infoRefsReq, []byte(infoRefsEmptyData)) - p := Poller{ - Client: httpClient, - } - pollInfo, err := p.Poll(context.Background(), r, "", branch) - require.NoError(t, err) - assert.False(t, pollInfo.UpdateAvailable) - assert.True(t, pollInfo.EmptyRepository) - assert.Empty(t, pollInfo.CommitId) - }) - } -} - -func TestPoller_Errors(t *testing.T) { - t.Run("branch not found", func(t *testing.T) { - ctrl := gomock.NewController(t) - r := repo() - infoRefsReq := &gitalypb.InfoRefsRequest{Repository: r} - httpClient := mock_gitaly.NewMockSmartHTTPServiceClient(ctrl) - mockInfoRefsUploadPack(t, ctrl, gomock.Any(), httpClient, infoRefsReq, []byte(infoRefsData)) - p := Poller{ - Client: httpClient, - } - _, err := p.Poll(context.Background(), r, "", "some_branch") - require.EqualError(t, err, "NotFound: InfoRefsUploadPack: file/directory/ref not found: some_branch") - }) - t.Run("no HEAD", func(t *testing.T) { - noHEAD := `001e# service=git-upload-pack -00000155` + revision1 + ` refs/heads/master` + "\x00" + `multi_ack thin-pack side-band side-band-64k ofs-delta shallow deepen-since deepen-not deepen-relative no-progress include-tag multi_ack_detailed allow-tip-sha1-in-want allow-reachable-sha1-in-want no-done symref=HEAD:refs/heads/master filter object-format=sha1 agent=git/2.28.0 -0044` + revision2 + ` refs/heads/test-branch -0000` - ctrl := gomock.NewController(t) - r := repo() - infoRefsReq := &gitalypb.InfoRefsRequest{Repository: r} - httpClient := mock_gitaly.NewMockSmartHTTPServiceClient(ctrl) - mockInfoRefsUploadPack(t, ctrl, gomock.Any(), httpClient, infoRefsReq, []byte(noHEAD)) - p := Poller{ - Client: httpClient, - } - pollInfo, err := p.Poll(context.Background(), r, "", DefaultBranch) - require.NoError(t, err) - assert.True(t, pollInfo.UpdateAvailable) - assert.Equal(t, revision1, pollInfo.CommitId) - }) - t.Run("no HEAD no master", func(t *testing.T) { - noHEAD := `001e# service=git-upload-pack -00000155` + revision1 + ` refs/heads/bababa` + "\x00" + `multi_ack thin-pack side-band side-band-64k ofs-delta shallow deepen-since deepen-not deepen-relative no-progress include-tag multi_ack_detailed allow-tip-sha1-in-want allow-reachable-sha1-in-want no-done symref=HEAD:refs/heads/master filter object-format=sha1 agent=git/2.28.0 -0044` + revision2 + ` refs/heads/test-branch -0000` - ctrl := gomock.NewController(t) - r := repo() - infoRefsReq := &gitalypb.InfoRefsRequest{Repository: r} - httpClient := mock_gitaly.NewMockSmartHTTPServiceClient(ctrl) - mockInfoRefsUploadPack(t, ctrl, gomock.Any(), httpClient, infoRefsReq, []byte(noHEAD)) - p := Poller{ - Client: httpClient, - } - _, err := p.Poll(context.Background(), r, "", DefaultBranch) - require.EqualError(t, err, "NotFound: InfoRefsUploadPack: file/directory/ref not found: default branch") - }) -} - -func mockInfoRefsUploadPack(t *testing.T, ctrl *gomock.Controller, ctx gomock.Matcher, httpClient *mock_gitaly.MockSmartHTTPServiceClient, infoRefsReq *gitalypb.InfoRefsRequest, data []byte) { - infoRefsClient := mock_gitaly.NewMockSmartHTTPService_InfoRefsUploadPackClient(ctrl) - // Emulate streaming response - resp1 := &gitalypb.InfoRefsResponse{ - Data: data[:1], - } - resp2 := &gitalypb.InfoRefsResponse{ - Data: data[1:], - } - gomock.InOrder( - infoRefsClient.EXPECT(). - Recv(). - Return(resp1, nil), - infoRefsClient.EXPECT(). - Recv(). - Return(resp2, nil), - infoRefsClient.EXPECT(). - Recv(). - Return(nil, io.EOF). - MaxTimes(1), - ) - httpClient.EXPECT(). - InfoRefsUploadPack(ctx, matcher.ProtoEq(t, infoRefsReq)). - Return(infoRefsClient, nil) -} - -func repo() *gitalypb.Repository { - return &gitalypb.Repository{ - StorageName: "StorageName", - RelativePath: "RelativePath", - GitObjectDirectory: "GitObjectDirectory", - GlRepository: "GlRepository", - GlProjectPath: "GlProjectPath", - } -} diff --git a/internal/gitaly/pool.go b/internal/gitaly/pool.go deleted file mode 100644 index a3489698..00000000 --- a/internal/gitaly/pool.go +++ /dev/null @@ -1,65 +0,0 @@ -package gitaly - -import ( - "context" - - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/gitalypb" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/pkg/entity" - "google.golang.org/grpc" -) - -var ( - _ PoolInterface = &Pool{} -) - -type PoolInterface interface { - Poller(context.Context, *entity.GitalyInfo) (PollerInterface, error) - PathFetcher(context.Context, *entity.GitalyInfo) (PathFetcherInterface, error) -} - -// ClientPool abstracts gitlab.com/gitlab-org/gitaly/client.Pool. -type ClientPool interface { - Dial(ctx context.Context, address, token string) (*grpc.ClientConn, error) -} - -type Pool struct { - ClientPool ClientPool -} - -func (p *Pool) commitServiceClient(ctx context.Context, info *entity.GitalyInfo) (gitalypb.CommitServiceClient, error) { - conn, err := p.ClientPool.Dial(ctx, info.Address, info.Token) - if err != nil { - return nil, err // don't wrap - } - return gitalypb.NewCommitServiceClient(conn), nil -} - -func (p *Pool) smartHTTPServiceClient(ctx context.Context, info *entity.GitalyInfo) (gitalypb.SmartHTTPServiceClient, error) { - conn, err := p.ClientPool.Dial(ctx, info.Address, info.Token) - if err != nil { - return nil, err // don't wrap - } - return gitalypb.NewSmartHTTPServiceClient(conn), nil -} - -func (p *Pool) PathFetcher(ctx context.Context, info *entity.GitalyInfo) (PathFetcherInterface, error) { - client, err := p.commitServiceClient(ctx, info) - if err != nil { - return nil, err - } - return &PathFetcher{ - Client: client, - Features: info.Features, - }, nil -} - -func (p *Pool) Poller(ctx context.Context, info *entity.GitalyInfo) (PollerInterface, error) { - client, err := p.smartHTTPServiceClient(ctx, info) - if err != nil { - return nil, err - } - return &Poller{ - Client: client, - Features: info.Features, - }, nil -} diff --git a/internal/gitaly/vendored/README.md b/internal/gitaly/vendored/README.md deleted file mode 100644 index 1956f3db..00000000 --- a/internal/gitaly/vendored/README.md +++ /dev/null @@ -1,15 +0,0 @@ -Files in this directory were copied from Gitaly and modified to: - -- Optimize memory consumption -- Handle empty repository case -- Reduce dependencies - -Instruction on refreshing the vendored gRPC client and protobufs: - -- Clone Gitaly repo somewhere. Use the directory name as `GITALY_DIR` env var value. -- Clone agent repo somewhere (this repo). Use the directory name as `AGENT_DIR` env var value. -- From the agent checkout directory run `GITALY_DIR= AGENT_DIR= ./build/vendor_gitaly.sh`. The script will copy the required protobuf and code files. -- Look at the diff and remove any bits of code that are not actually required. There are a few unrelated bits and pieces. -- Pay attention to dependencies that the code introduces, if any. -- Run `make regenerate-proto regenerate-mocks test lint` to see if everything works fine. -- Commit, push, open MR. diff --git a/internal/gitaly/vendored/backoff/BUILD.bazel b/internal/gitaly/vendored/backoff/BUILD.bazel deleted file mode 100644 index 9c2c2607..00000000 --- a/internal/gitaly/vendored/backoff/BUILD.bazel +++ /dev/null @@ -1,8 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "backoff", - srcs = ["backoff.go"], - importpath = "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/backoff", - visibility = ["//:__subpackages__"], -) diff --git a/internal/gitaly/vendored/backoff/backoff.go b/internal/gitaly/vendored/backoff/backoff.go deleted file mode 100644 index f395c40b..00000000 --- a/internal/gitaly/vendored/backoff/backoff.go +++ /dev/null @@ -1,75 +0,0 @@ -// Package backoff implements exponential backoff mechanism based on gRPC's backoff algorithm -// https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md -package backoff - -import ( - "math" - "math/rand" - "time" -) - -// Strategy implements a backoff strategy. This strategy has a single Backoff method that returns -// a time duration corresponding to the input retries. -type Strategy interface { - Backoff(retries uint) time.Duration -} - -// Exponential defines an exponential backoff strategy. It multiplicatively decreases the rate of -// retrial by increasing the wait time. The wait time is calculated to following: -// Backoff(retries) = BaseDelay * (Multiplier ^ retries) + rand(0, Jitter) -// The backoff time can never exceed the MaxDelay. -type Exponential struct { - // BaseDelay is the minimum delay for the first attempt. - BaseDelay time.Duration - // MaxDelay is the upper limit for exponential backoff. - MaxDelay time.Duration - // Multiplier is the factor determining "how fast" the delay increases after each retry. - Multiplier float64 - // Jitter defines the maximum of randomized duration added to the delay of each step. This - // randomization prevents all actors retry at the same time. - Jitter time.Duration - // Random source for randomizing delay of each step - rand *rand.Rand -} - -// NewDefaultExponential returns an exponential backoff strategy using a set of configurations good -// enough for network connection retry. -func NewDefaultExponential(r *rand.Rand) *Exponential { - // - // | Retries | Delay before jitter | - // | ------- | ------------------- | - // | 0 | 1 second | - // | 1 | 1.5 seconds | - // | 2 | 2.3 seconds | - // | 3 | 3.4 seconds | - // | 4 | 5.0 seconds | - // | 5 | 7.6 seconds | - // | 6 | 11.0 seconds | - // | 7 | 17.1 seconds | - // | 8 | 25.1 seconds | - // | 9 | 38.4 seconds | - // | 10 | 57.6 seconds | - // | 11 | 60 seconds | - // | 12 | 60 seconds | - // | ... | 60 seconds | - return &Exponential{ - BaseDelay: 1 * time.Second, - MaxDelay: 60 * time.Second, - Multiplier: 1.5, - Jitter: 200 * time.Millisecond, - rand: r, - } -} - -// Backoff returns the duration to wait before retry again. The caller is fully responsible for -// retry controlling retry attempts and timers. Typically, the caller increases the retry attempt -// and creates a timer from the result of this method. Typically, this method is called before -// increasing the attempt of the caller, which is Backoff(0). It means the backoff time after the -// first failure. -func (e *Exponential) Backoff(retries uint) time.Duration { - backoff := math.Min( - float64(e.MaxDelay), - float64(e.BaseDelay)*math.Pow(e.Multiplier, float64(retries)), - ) + float64(e.Jitter)*e.rand.Float64() - return time.Duration(backoff).Round(time.Millisecond) -} diff --git a/internal/gitaly/vendored/client/BUILD.bazel b/internal/gitaly/vendored/client/BUILD.bazel deleted file mode 100644 index 3ee2f9e2..00000000 --- a/internal/gitaly/vendored/client/BUILD.bazel +++ /dev/null @@ -1,19 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "client", - srcs = [ - "dial.go", - "pool.go", - "pool_options.go", - ], - importpath = "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/client", - visibility = ["//:__subpackages__"], - deps = [ - "//internal/gitaly/vendored/backoff", - "//internal/gitaly/vendored/dnsresolver", - "//internal/gitaly/vendored/gitalyauth", - "//internal/gitaly/vendored/grpc/client", - "@org_golang_google_grpc//:grpc", - ], -) diff --git a/internal/gitaly/vendored/client/dial.go b/internal/gitaly/vendored/client/dial.go deleted file mode 100644 index 6ca60222..00000000 --- a/internal/gitaly/vendored/client/dial.go +++ /dev/null @@ -1,46 +0,0 @@ -package client - -import ( - "context" - "math/rand" - "time" - - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/backoff" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/dnsresolver" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/grpc/client" - "google.golang.org/grpc" -) - -// DialContext dials the Gitaly at the given address with the provided options. Valid address formats are -// 'unix:' for Unix sockets, 'tcp://' for insecure TCP connections and 'tls://' -// for TCP+TLS connections. -// -// The returned ClientConns are configured with tracing and correlation id interceptors to ensure they are propagated -// correctly. They're also configured to send Keepalives with settings matching what Gitaly expects. -// -// connOpts should not contain `grpc.WithInsecure` as DialContext determines whether it is needed or not from the -// scheme. `grpc.TransportCredentials` should not be provided either as those are handled internally as well. -func DialContext(ctx context.Context, rawAddress string, connOpts []grpc.DialOption) (*grpc.ClientConn, error) { - return client.Dial(ctx, rawAddress, client.WithGrpcOptions(connOpts)) -} - -// DNSResolverBuilderConfig exposes the DNS resolver builder option. It is used to build Gitaly -// custom DNS resolver. -type DNSResolverBuilderConfig dnsresolver.BuilderConfig - -// DefaultDNSResolverBuilderConfig returns the default options for building DNS resolver. -func DefaultDNSResolverBuilderConfig() *DNSResolverBuilderConfig { - return &DNSResolverBuilderConfig{ - RefreshRate: 5 * time.Minute, - LookupTimeout: 15 * time.Second, - Backoff: backoff.NewDefaultExponential(rand.New(rand.NewSource(time.Now().UnixNano()))), // nolint: gosec - DefaultGrpcPort: "443", - } -} - -// WithGitalyDNSResolver defines a gRPC dial option for injecting Gitaly's custom DNS resolver. This -// resolver watches for the changes of target URL periodically and update the target subchannels -// accordingly. -func WithGitalyDNSResolver(opts *DNSResolverBuilderConfig) grpc.DialOption { - return grpc.WithResolvers(dnsresolver.NewBuilder((*dnsresolver.BuilderConfig)(opts))) -} diff --git a/internal/gitaly/vendored/client/pool.go b/internal/gitaly/vendored/client/pool.go deleted file mode 100644 index 302c53db..00000000 --- a/internal/gitaly/vendored/client/pool.go +++ /dev/null @@ -1,98 +0,0 @@ -package client - -import ( - "context" - "errors" - "fmt" - "sync" - - gitalyauth "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/gitalyauth" - "google.golang.org/grpc" -) - -// Dialer is used by the Pool to create a *grpc.ClientConn. -type Dialer func(ctx context.Context, address string, dialOptions []grpc.DialOption) (*grpc.ClientConn, error) - -type poolKey struct{ address, token string } - -// Pool is a pool of GRPC connections. Connections created by it are safe for -// concurrent use. -type Pool struct { - lock sync.RWMutex - conns map[poolKey]*grpc.ClientConn - dialer Dialer - dialOptions []grpc.DialOption -} - -// NewPoolWithOptions creates a new connection pool that's ready for use. -func NewPoolWithOptions(poolOptions ...PoolOption) *Pool { - opts := applyPoolOptions(poolOptions) - return &Pool{ - conns: make(map[poolKey]*grpc.ClientConn), - dialer: opts.dialer, - dialOptions: opts.dialOptions, - } -} - -// Close closes all connections tracked by the connection pool. -func (p *Pool) Close() error { - p.lock.Lock() - defer p.lock.Unlock() - - var firstError error - for addr, conn := range p.conns { - if err := conn.Close(); err != nil && firstError == nil { - firstError = err - } - - delete(p.conns, addr) - } - - return firstError -} - -// Dial creates a new client connection in case no connection to the given -// address exists already or returns an already established connection. The -// returned address must not be `Close()`d. -func (p *Pool) Dial(ctx context.Context, address, token string) (*grpc.ClientConn, error) { - return p.getOrCreateConnection(ctx, address, token) -} - -func (p *Pool) getOrCreateConnection(ctx context.Context, address, token string) (*grpc.ClientConn, error) { - if address == "" { - return nil, errors.New("address is empty") - } - - key := poolKey{address: address, token: token} - - p.lock.RLock() - cc, ok := p.conns[key] - p.lock.RUnlock() - - if ok { - return cc, nil - } - - p.lock.Lock() - defer p.lock.Unlock() - - cc, ok = p.conns[key] - if ok { - return cc, nil - } - - opts := make([]grpc.DialOption, 0, len(p.dialOptions)+1) - opts = append(opts, p.dialOptions...) - if token != "" { - opts = append(opts, grpc.WithPerRPCCredentials(gitalyauth.RPCCredentialsV2(token))) - } - - cc, err := p.dialer(ctx, address, opts) - if err != nil { - return nil, fmt.Errorf("could not dial source: %w", err) - } - - p.conns[key] = cc - - return cc, nil -} diff --git a/internal/gitaly/vendored/client/pool_options.go b/internal/gitaly/vendored/client/pool_options.go deleted file mode 100644 index a8139c1f..00000000 --- a/internal/gitaly/vendored/client/pool_options.go +++ /dev/null @@ -1,39 +0,0 @@ -package client - -import "google.golang.org/grpc" - -type poolOptions struct { - dialer Dialer - dialOptions []grpc.DialOption -} - -//nolint:revive // This is unintentionally missing documentation. -type PoolOption func(*poolOptions) - -func applyPoolOptions(options []PoolOption) *poolOptions { - opts := defaultPoolOptions() - for _, opt := range options { - opt(opts) - } - return opts -} - -func defaultPoolOptions() *poolOptions { - return &poolOptions{ - dialer: DialContext, - } -} - -// WithDialer sets the dialer that is called for each new gRPC connection the pool establishes. -func WithDialer(dialer Dialer) PoolOption { - return func(options *poolOptions) { - options.dialer = dialer - } -} - -// WithDialOptions sets gRPC options to use for the gRPC Dial call. -func WithDialOptions(dialOptions ...grpc.DialOption) PoolOption { - return func(options *poolOptions) { - options.dialOptions = dialOptions - } -} diff --git a/internal/gitaly/vendored/dnsresolver/BUILD.bazel b/internal/gitaly/vendored/dnsresolver/BUILD.bazel deleted file mode 100644 index 03e425f1..00000000 --- a/internal/gitaly/vendored/dnsresolver/BUILD.bazel +++ /dev/null @@ -1,18 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "dnsresolver", - srcs = [ - "builder.go", - "noop.go", - "resolver.go", - "target.go", - ], - importpath = "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/dnsresolver", - visibility = ["//:__subpackages__"], - deps = [ - "//internal/gitaly/vendored/backoff", - "//internal/gitaly/vendored/structerr", - "@org_golang_google_grpc//resolver", - ], -) diff --git a/internal/gitaly/vendored/dnsresolver/builder.go b/internal/gitaly/vendored/dnsresolver/builder.go deleted file mode 100644 index bfa7571d..00000000 --- a/internal/gitaly/vendored/dnsresolver/builder.go +++ /dev/null @@ -1,110 +0,0 @@ -package dnsresolver - -import ( - "context" - "strings" - "time" - - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/backoff" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/structerr" - "google.golang.org/grpc/resolver" -) - -// Default DNS desc server port. This is a de-facto convention for both UDP and TCP. -const defaultDNSNameserverPort = "53" - -// gRPC depends on the target's scheme to determine which resolver to use. Built-in DNS Resolver -// registers itself with "dns" scheme. We should use a different scheme for this resolver. However, -// Ruby, and other cares-based clients, don't support custom resolver. At GitLab, the gRPC target -// configuration is shared between components. To ensure the compatibility between clients, this -// resolver intentionally replaces the built-in resolver by itself. -// The client should use grpc.WithResolvers to inject Gitaly custom DNS resolver when resolving -// the target URL. -const dnsResolverScheme = "dns" - -// BuilderConfig defines the configuration for customizing the builder. -type BuilderConfig struct { - // RefreshRate determines the periodic refresh rate of the resolver. The resolver may issue - // the resolver earlier if client connection demands - RefreshRate time.Duration - // LookupTimeout determines the timeout of underlying DNS query. - LookupTimeout time.Duration - // Backoff defines the backoff strategy when the resolver fails to resolve or pushes new - // state to client connection - Backoff backoff.Strategy - // DefaultGrpcPort sets the gRPC port if the target URL doesn't specify a target port - DefaultGrpcPort string - // authorityFinder is to inject a custom authority finder from the authority address in - // the target URL. For example: dns://authority-host:authority-port/host:port - authorityFinder func(authority string) (dnsLookuper, error) -} - -// Builder is an object to build the resolver for a connection. A client connection uses the builder -// specified by grpc.WithResolvers dial option or the one fetched from global Resolver registry. The -// local option has higher precedence than the global one. -type Builder struct { - opts *BuilderConfig -} - -// NewBuilder creates a builder option with an input option -func NewBuilder(opts *BuilderConfig) *Builder { - return &Builder{opts: opts} -} - -// Scheme returns the scheme handled by this builder. Client connection queries the resolver based -// on the target URL scheme. This builder handles dns://*/* targets. -func (d *Builder) Scheme() string { - return dnsResolverScheme -} - -// Build returns a resolver that periodically resolves the input target. Each client connection -// maintains a resolver. It's a part of client connection's life cycle. The target follows -// gRPC desc resolution format (https://github.com/grpc/grpc/blob/master/doc/naming.md). As this -// builds a DNS resolver, we care about dns URL only: dns:[//authority/]host[:port] -// If the authority is missing (dns:host[:port]), it fallbacks to use OS resolver. -func (d *Builder) Build(target resolver.Target, cc resolver.ClientConn, _ resolver.BuildOptions) (resolver.Resolver, error) { - path := target.URL.Path - if path == "" { - path = target.URL.Opaque - } - host, port, err := parseTarget(strings.TrimPrefix(path, "/"), d.opts.DefaultGrpcPort) - if err != nil { - return nil, structerr.New("building dns resolver: %w", err).WithMetadata("target", target.URL.String()) - } - - if addr, ok := tryParseIP(host, port); ok { - // When the address is a static IP, we don't need this resolver anymore. Client - // connection is responsible for handling network error in this case. - _ = cc.UpdateState(resolver.State{Addresses: []resolver.Address{{Addr: addr}}}) - return &noopResolver{}, nil - } - - authorityFinder := findDNSLookup - if d.opts.authorityFinder != nil { - authorityFinder = d.opts.authorityFinder - } - lookup, err := authorityFinder(target.URL.Host) - if err != nil { - return nil, structerr.New("finding DNS resolver: %w", err).WithMetadata("authority", target.URL.Host) - } - - ctx, cancel := context.WithCancel(context.Background()) - dr := &dnsResolver{ - retry: d.opts.Backoff, - - ctx: ctx, - cancel: cancel, - host: host, - port: port, - cc: cc, - refreshRate: d.opts.RefreshRate, - lookupTimeout: d.opts.LookupTimeout, - lookup: lookup, - reqs: make(chan struct{}, 1), - } - - dr.wg.Add(1) - go dr.watch() - - return dr, nil -} diff --git a/internal/gitaly/vendored/dnsresolver/noop.go b/internal/gitaly/vendored/dnsresolver/noop.go deleted file mode 100644 index 6197653e..00000000 --- a/internal/gitaly/vendored/dnsresolver/noop.go +++ /dev/null @@ -1,10 +0,0 @@ -package dnsresolver - -import "google.golang.org/grpc/resolver" - -// noopResolver does nothing. It is used when a target is not resolvable. -type noopResolver struct{} - -func (noopResolver) ResolveNow(resolver.ResolveNowOptions) {} - -func (noopResolver) Close() {} diff --git a/internal/gitaly/vendored/dnsresolver/resolver.go b/internal/gitaly/vendored/dnsresolver/resolver.go deleted file mode 100644 index 05a20a13..00000000 --- a/internal/gitaly/vendored/dnsresolver/resolver.go +++ /dev/null @@ -1,130 +0,0 @@ -package dnsresolver - -import ( - "context" - "net" - "sync" - "time" - - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/backoff" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/structerr" - "google.golang.org/grpc/resolver" -) - -type dnsResolver struct { - retry backoff.Strategy - - ctx context.Context - cancel context.CancelFunc - cc resolver.ClientConn - host string - port string - refreshRate time.Duration - lookupTimeout time.Duration - lookup dnsLookuper - reqs chan struct{} - wg sync.WaitGroup -} - -var defaultLookupTimeout = 15 * time.Second - -type dnsLookuper interface { - LookupHost(context.Context, string) ([]string, error) -} - -// ResolveNow signals the resolver to perform a DNS resolution immediately. This method returns -// without waiting for the result. The resolver treats this as a hint rather than a command. The -// client connection receives the resolution result asynchronously via `clientconn.UpdateState` -// This method also skip resolver caching because it's likely the client calls this method after -// encounter an error with recent subchannels. -func (d *dnsResolver) ResolveNow(resolver.ResolveNowOptions) { - select { - case d.reqs <- struct{}{}: - default: - } -} - -// Close cancels all activities of this dns resolver. It waits until the watch goroutine exits. -func (d *dnsResolver) Close() { - d.cancel() - d.wg.Wait() -} - -func (d *dnsResolver) watch() { - defer d.wg.Done() - - // Exponential retry after failed to resolve or client connection failed to update its state - var retries uint - for { - state, err := d.resolve() - if err != nil { - d.cc.ReportError(err) - } else { - err = d.updateState(state) - } - - var timer *time.Timer - if err == nil { - timer = time.NewTimer(d.refreshRate) - retries = 0 - } else { - timer = time.NewTimer(d.retry.Backoff(retries)) - retries++ - } - - select { - case <-d.ctx.Done(): - timer.Stop() - return - case <-timer.C: - // Refresh timer expires, issue another DNS lookup. - continue - case <-d.reqs: - // If the resolver is requested to resolve now, force notify the client - // connection. Typically, client connection contacts the resolver when any - // of the subchannels change its connectivity state. - timer.Stop() - } - } -} - -func (d *dnsResolver) updateState(state *resolver.State) error { - return d.cc.UpdateState(*state) -} - -func (d *dnsResolver) resolve() (*resolver.State, error) { - timeout := d.lookupTimeout - if timeout == 0 { - timeout = defaultLookupTimeout - } - ctx, cancel := context.WithTimeout(d.ctx, timeout) - defer cancel() - - addrs, err := d.lookup.LookupHost(ctx, d.host) - if err != nil { - err = handleDNSError(err) - return &resolver.State{Addresses: []resolver.Address{}}, err - } - newAddrs := make([]resolver.Address, 0, len(addrs)) - for _, a := range addrs { - addr, ok := tryParseIP(a, d.port) - if !ok { - return nil, structerr.New("dns: error parsing dns record IP address %v", a) - } - newAddrs = append(newAddrs, resolver.Address{Addr: addr}) - } - - return &resolver.State{Addresses: newAddrs}, nil -} - -// handleDNSError massages the error to fit into expectations of the gRPC model: -// - Timeouts and temporary errors should be communicated to gRPC to attempt another DNS query (with -// Backoff). -// - Other errors should be suppressed (they may represent the absence of a TXT record). -func handleDNSError(err error) error { - if dnsErr, ok := err.(*net.DNSError); ok && !dnsErr.IsTimeout && !dnsErr.IsTemporary { // nolint: errorlint - return nil - } - - return structerr.New("dns: record resolve error: %w", err) -} diff --git a/internal/gitaly/vendored/dnsresolver/target.go b/internal/gitaly/vendored/dnsresolver/target.go deleted file mode 100644 index 53469b71..00000000 --- a/internal/gitaly/vendored/dnsresolver/target.go +++ /dev/null @@ -1,100 +0,0 @@ -package dnsresolver - -import ( - "context" - "net" - "net/url" - "strings" - - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/structerr" -) - -// ValidateURL validates Gitaly address URL having dns scheme. The URL follows three forms: -// * dns://authority-port:authority-host/host:port -// * dns:///host:port -// * dns:host:port -// Either form, the real address is the URL's path -func ValidateURL(rawAddress string) error { - if rawAddress == "" { - return structerr.New("empty address") - } - - uri, err := url.Parse(rawAddress) - if err != nil { - return structerr.New("fail to parse address: %w", err) - } - - if uri.Scheme != "dns" { - return structerr.New("unexpected scheme: %s", uri.Scheme) - } - - path := uri.Path - if path == "" { - // When "//" part is stripped - path = uri.Opaque - } - _, _, err = parseTarget(strings.TrimPrefix(path, "/"), "50051") - return err -} - -// parseTarget takes the user input target string and default port, returns formatted host and port info. -// This is a shameless copy of built-in gRPC dns resolver, because we don't want to have any -// inconsistency between our resolver and dns resolver. -// Source: https://github.com/grpc/grpc-go/blob/eeb9afa1f6b6388152955eeca8926e36ca94c768/internal/resolver/dns/dns_resolver.go#L378-L378 -func parseTarget(target, defaultPort string) (string, string, error) { - var err error - - if target == "" { - return "", "", structerr.New("dns resolver: missing address") - } - - if ip := net.ParseIP(target); ip != nil { - // target is an IPv4 or IPv6(without brackets) address - return target, defaultPort, nil - } - - if host, port, err := net.SplitHostPort(target); err == nil { // nolint: govet - if port == "" { - // If the port field is empty (target ends with colon), e.g. "[::1]:", this is an error. - return "", "", structerr.New("dns resolver: missing port after port-separator colon") - } - if host == "" { - host = "localhost" - } - return host, port, nil - } - - host, port, err := net.SplitHostPort(target + ":" + defaultPort) - if err == nil { - return host, port, nil - } - return "", "", structerr.New("dns resolver: %w", err) -} - -func tryParseIP(host, port string) (addr string, ok bool) { - ip := net.ParseIP(host) - if ip == nil { - return "", false - } - return net.JoinHostPort(host, port), true -} - -func findDNSLookup(authority string) (dnsLookuper, error) { - if authority == "" { - return net.DefaultResolver, nil - } - - host, port, err := parseTarget(authority, defaultDNSNameserverPort) - if err != nil { - return nil, err - } - - addr := net.JoinHostPort(host, port) - return &net.Resolver{ - PreferGo: true, - Dial: func(ctx context.Context, network, address string) (net.Conn, error) { - var dialer net.Dialer - return dialer.DialContext(ctx, network, addr) - }, - }, nil -} diff --git a/internal/gitaly/vendored/gitalyauth/BUILD.bazel b/internal/gitaly/vendored/gitalyauth/BUILD.bazel deleted file mode 100644 index a83b42d7..00000000 --- a/internal/gitaly/vendored/gitalyauth/BUILD.bazel +++ /dev/null @@ -1,12 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "gitalyauth", - srcs = [ - "rpccredentials.go", - "token.go", - ], - importpath = "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/gitalyauth", - visibility = ["//:__subpackages__"], - deps = ["@org_golang_google_grpc//credentials"], -) diff --git a/internal/gitaly/vendored/gitalyauth/rpccredentials.go b/internal/gitaly/vendored/gitalyauth/rpccredentials.go deleted file mode 100644 index 9ebf19d1..00000000 --- a/internal/gitaly/vendored/gitalyauth/rpccredentials.go +++ /dev/null @@ -1,33 +0,0 @@ -package gitalyauth - -import ( - "context" - "fmt" - "strconv" - "time" - - "google.golang.org/grpc/credentials" -) - -// RPCCredentialsV2 can be used with grpc.WithPerRPCCredentials to create -// a grpc.DialOption that inserts an V2 (HMAC) token with the current -// timestamp for authentication with a Gitaly server. The shared secret -// must match the one used on the Gitaly server. -func RPCCredentialsV2(sharedSecret string) credentials.PerRPCCredentials { - return &rpcCredentialsV2{sharedSecret: sharedSecret} -} - -type rpcCredentialsV2 struct { - sharedSecret string -} - -func (*rpcCredentialsV2) RequireTransportSecurity() bool { return false } - -func (rc2 *rpcCredentialsV2) GetRequestMetadata(context.Context, ...string) (map[string]string, error) { - message := strconv.FormatInt(time.Now().Unix(), 10) - signature := hmacSign([]byte(rc2.sharedSecret), message) - - return map[string]string{ - "authorization": "Bearer " + fmt.Sprintf("v2.%x.%s", signature, message), - }, nil -} diff --git a/internal/gitaly/vendored/gitalyauth/token.go b/internal/gitaly/vendored/gitalyauth/token.go deleted file mode 100644 index b1f5ecd7..00000000 --- a/internal/gitaly/vendored/gitalyauth/token.go +++ /dev/null @@ -1,14 +0,0 @@ -package gitalyauth - -import ( - "crypto/hmac" - "crypto/sha256" -) - -func hmacSign(secret []byte, message string) []byte { - mac := hmac.New(sha256.New, secret) - // hash.Hash never returns an error. - _, _ = mac.Write([]byte(message)) - - return mac.Sum(nil) -} diff --git a/internal/gitaly/vendored/gitalypb/BUILD.bazel b/internal/gitaly/vendored/gitalypb/BUILD.bazel deleted file mode 100644 index 7441909e..00000000 --- a/internal/gitaly/vendored/gitalypb/BUILD.bazel +++ /dev/null @@ -1,152 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") -load("@rules_proto//proto:defs.bzl", "proto_library") -load("@rules_proto_grpc//go:defs.bzl", "go_proto_compile") -load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_files") -load("//build:proto_def.bzl", "go_grpc_compile") - -proto_library( - name = "lint_proto", - srcs = ["lint.proto"], - strip_import_prefix = "/internal/gitaly/vendored/gitalypb", - tags = ["manual"], - deps = [ - "@com_google_protobuf//:descriptor_proto", - ], -) - -proto_library( - name = "errors_proto", - srcs = ["errors.proto"], - strip_import_prefix = "/internal/gitaly/vendored/gitalypb", - tags = ["manual"], - deps = [ - "@com_google_protobuf//:duration_proto", - ], -) - -proto_library( - name = "packfile_proto", - srcs = ["packfile.proto"], - strip_import_prefix = "/internal/gitaly/vendored/gitalypb", - tags = ["manual"], -) - -proto_library( - name = "shared_proto", - srcs = ["shared.proto"], - strip_import_prefix = "/internal/gitaly/vendored/gitalypb", - tags = ["manual"], - deps = [ - ":lint_proto", - "@com_google_protobuf//:timestamp_proto", - ], -) - -proto_library( - name = "commit_proto", - srcs = ["commit.proto"], - strip_import_prefix = "/internal/gitaly/vendored/gitalypb", - tags = ["manual"], - deps = [ - ":errors_proto", - ":lint_proto", - ":shared_proto", - "@com_google_protobuf//:timestamp_proto", - ], -) - -proto_library( - name = "service_config_proto", - srcs = ["service_config.proto"], - strip_import_prefix = "/internal/gitaly/vendored/gitalypb", - tags = ["manual"], - deps = [ - "@com_google_protobuf//:duration_proto", - "@com_google_protobuf//:wrappers_proto", - ], -) - -proto_library( - name = "smarthttp_proto", - srcs = ["smarthttp.proto"], - strip_import_prefix = "/internal/gitaly/vendored/gitalypb", - tags = ["manual"], - deps = [ - ":lint_proto", - ":packfile_proto", - ":shared_proto", - ], -) - -PROTOS = [ - "lint", - "errors", - "packfile", - "shared", - "service_config", -] - -GRPC = [ - "commit", - "smarthttp", -] - -[ - go_proto_compile( - name = "%s_proto_compile" % name, - protos = [":%s_proto" % name], - tags = ["manual"], - ) - for name in PROTOS + GRPC -] - -[ - go_grpc_compile( - name = "%s_grpc_compile" % name, - protos = [":%s_proto" % name], - tags = ["manual"], - ) - for name in GRPC -] - -write_source_files( - name = "extract_generated", - diff_test = False, - files = { - "%s.pb.go" % name: ":%s_proto_compile" % name - for name in PROTOS + GRPC - } | { - "%s_grpc.pb.go" % name: ":%s_grpc_compile" % name - for name in GRPC - }, - tags = ["manual"], - visibility = ["//visibility:public"], -) - -go_library( - name = "gitalypb", - srcs = [ - "commit.pb.go", - "commit_grpc.pb.go", - "errors.pb.go", - "lint.pb.go", - "packfile.pb.go", - "service_config.pb.go", - "shared.pb.go", - "smarthttp.pb.go", - "smarthttp_grpc.pb.go", - ], - importpath = "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/gitalypb", - visibility = ["//:__subpackages__"], - deps = [ - "@org_golang_google_grpc//:grpc", - "@org_golang_google_grpc//codes", - "@org_golang_google_grpc//status", - "@org_golang_google_protobuf//reflect/protoreflect", - "@org_golang_google_protobuf//runtime/protoimpl", - "@org_golang_google_protobuf//types/descriptorpb", - "@org_golang_google_protobuf//types/known/durationpb", - "@org_golang_google_protobuf//types/known/timestamppb", - "@org_golang_google_protobuf//types/known/wrapperspb", - ], -) diff --git a/internal/gitaly/vendored/gitalypb/commit.pb.go b/internal/gitaly/vendored/gitalypb/commit.pb.go deleted file mode 100644 index 891ff12e..00000000 --- a/internal/gitaly/vendored/gitalypb/commit.pb.go +++ /dev/null @@ -1,5385 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc v3.21.7 -// source: commit.proto - -package gitalypb - -import ( - reflect "reflect" - sync "sync" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" -) - -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 ListCommitsRequest_Order int32 - -const ( - ListCommitsRequest_NONE ListCommitsRequest_Order = 0 - ListCommitsRequest_TOPO ListCommitsRequest_Order = 1 - ListCommitsRequest_DATE ListCommitsRequest_Order = 2 -) - -// Enum value maps for ListCommitsRequest_Order. -var ( - ListCommitsRequest_Order_name = map[int32]string{ - 0: "NONE", - 1: "TOPO", - 2: "DATE", - } - ListCommitsRequest_Order_value = map[string]int32{ - "NONE": 0, - "TOPO": 1, - "DATE": 2, - } -) - -func (x ListCommitsRequest_Order) Enum() *ListCommitsRequest_Order { - p := new(ListCommitsRequest_Order) - *p = x - return p -} - -func (x ListCommitsRequest_Order) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ListCommitsRequest_Order) Descriptor() protoreflect.EnumDescriptor { - return file_commit_proto_enumTypes[0].Descriptor() -} - -func (ListCommitsRequest_Order) Type() protoreflect.EnumType { - return &file_commit_proto_enumTypes[0] -} - -func (x ListCommitsRequest_Order) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ListCommitsRequest_Order.Descriptor instead. -func (ListCommitsRequest_Order) EnumDescriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{0, 0} -} - -type TreeEntryResponse_ObjectType int32 - -const ( - TreeEntryResponse_COMMIT TreeEntryResponse_ObjectType = 0 - TreeEntryResponse_BLOB TreeEntryResponse_ObjectType = 1 - TreeEntryResponse_TREE TreeEntryResponse_ObjectType = 2 - TreeEntryResponse_TAG TreeEntryResponse_ObjectType = 3 -) - -// Enum value maps for TreeEntryResponse_ObjectType. -var ( - TreeEntryResponse_ObjectType_name = map[int32]string{ - 0: "COMMIT", - 1: "BLOB", - 2: "TREE", - 3: "TAG", - } - TreeEntryResponse_ObjectType_value = map[string]int32{ - "COMMIT": 0, - "BLOB": 1, - "TREE": 2, - "TAG": 3, - } -) - -func (x TreeEntryResponse_ObjectType) Enum() *TreeEntryResponse_ObjectType { - p := new(TreeEntryResponse_ObjectType) - *p = x - return p -} - -func (x TreeEntryResponse_ObjectType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (TreeEntryResponse_ObjectType) Descriptor() protoreflect.EnumDescriptor { - return file_commit_proto_enumTypes[1].Descriptor() -} - -func (TreeEntryResponse_ObjectType) Type() protoreflect.EnumType { - return &file_commit_proto_enumTypes[1] -} - -func (x TreeEntryResponse_ObjectType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use TreeEntryResponse_ObjectType.Descriptor instead. -func (TreeEntryResponse_ObjectType) EnumDescriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{9, 0} -} - -type TreeEntry_EntryType int32 - -const ( - TreeEntry_BLOB TreeEntry_EntryType = 0 - TreeEntry_TREE TreeEntry_EntryType = 1 - TreeEntry_COMMIT TreeEntry_EntryType = 3 -) - -// Enum value maps for TreeEntry_EntryType. -var ( - TreeEntry_EntryType_name = map[int32]string{ - 0: "BLOB", - 1: "TREE", - 3: "COMMIT", - } - TreeEntry_EntryType_value = map[string]int32{ - "BLOB": 0, - "TREE": 1, - "COMMIT": 3, - } -) - -func (x TreeEntry_EntryType) Enum() *TreeEntry_EntryType { - p := new(TreeEntry_EntryType) - *p = x - return p -} - -func (x TreeEntry_EntryType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (TreeEntry_EntryType) Descriptor() protoreflect.EnumDescriptor { - return file_commit_proto_enumTypes[2].Descriptor() -} - -func (TreeEntry_EntryType) Type() protoreflect.EnumType { - return &file_commit_proto_enumTypes[2] -} - -func (x TreeEntry_EntryType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use TreeEntry_EntryType.Descriptor instead. -func (TreeEntry_EntryType) EnumDescriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{14, 0} -} - -type GetTreeEntriesRequest_SortBy int32 - -const ( - GetTreeEntriesRequest_DEFAULT GetTreeEntriesRequest_SortBy = 0 - GetTreeEntriesRequest_TREES_FIRST GetTreeEntriesRequest_SortBy = 1 -) - -// Enum value maps for GetTreeEntriesRequest_SortBy. -var ( - GetTreeEntriesRequest_SortBy_name = map[int32]string{ - 0: "DEFAULT", - 1: "TREES_FIRST", - } - GetTreeEntriesRequest_SortBy_value = map[string]int32{ - "DEFAULT": 0, - "TREES_FIRST": 1, - } -) - -func (x GetTreeEntriesRequest_SortBy) Enum() *GetTreeEntriesRequest_SortBy { - p := new(GetTreeEntriesRequest_SortBy) - *p = x - return p -} - -func (x GetTreeEntriesRequest_SortBy) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (GetTreeEntriesRequest_SortBy) Descriptor() protoreflect.EnumDescriptor { - return file_commit_proto_enumTypes[3].Descriptor() -} - -func (GetTreeEntriesRequest_SortBy) Type() protoreflect.EnumType { - return &file_commit_proto_enumTypes[3] -} - -func (x GetTreeEntriesRequest_SortBy) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use GetTreeEntriesRequest_SortBy.Descriptor instead. -func (GetTreeEntriesRequest_SortBy) EnumDescriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{15, 0} -} - -type FindAllCommitsRequest_Order int32 - -const ( - FindAllCommitsRequest_NONE FindAllCommitsRequest_Order = 0 - FindAllCommitsRequest_TOPO FindAllCommitsRequest_Order = 1 - FindAllCommitsRequest_DATE FindAllCommitsRequest_Order = 2 -) - -// Enum value maps for FindAllCommitsRequest_Order. -var ( - FindAllCommitsRequest_Order_name = map[int32]string{ - 0: "NONE", - 1: "TOPO", - 2: "DATE", - } - FindAllCommitsRequest_Order_value = map[string]int32{ - "NONE": 0, - "TOPO": 1, - "DATE": 2, - } -) - -func (x FindAllCommitsRequest_Order) Enum() *FindAllCommitsRequest_Order { - p := new(FindAllCommitsRequest_Order) - *p = x - return p -} - -func (x FindAllCommitsRequest_Order) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (FindAllCommitsRequest_Order) Descriptor() protoreflect.EnumDescriptor { - return file_commit_proto_enumTypes[4].Descriptor() -} - -func (FindAllCommitsRequest_Order) Type() protoreflect.EnumType { - return &file_commit_proto_enumTypes[4] -} - -func (x FindAllCommitsRequest_Order) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use FindAllCommitsRequest_Order.Descriptor instead. -func (FindAllCommitsRequest_Order) EnumDescriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{26, 0} -} - -type FindCommitsRequest_Order int32 - -const ( - FindCommitsRequest_NONE FindCommitsRequest_Order = 0 - FindCommitsRequest_TOPO FindCommitsRequest_Order = 1 -) - -// Enum value maps for FindCommitsRequest_Order. -var ( - FindCommitsRequest_Order_name = map[int32]string{ - 0: "NONE", - 1: "TOPO", - } - FindCommitsRequest_Order_value = map[string]int32{ - "NONE": 0, - "TOPO": 1, - } -) - -func (x FindCommitsRequest_Order) Enum() *FindCommitsRequest_Order { - p := new(FindCommitsRequest_Order) - *p = x - return p -} - -func (x FindCommitsRequest_Order) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (FindCommitsRequest_Order) Descriptor() protoreflect.EnumDescriptor { - return file_commit_proto_enumTypes[5].Descriptor() -} - -func (FindCommitsRequest_Order) Type() protoreflect.EnumType { - return &file_commit_proto_enumTypes[5] -} - -func (x FindCommitsRequest_Order) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use FindCommitsRequest_Order.Descriptor instead. -func (FindCommitsRequest_Order) EnumDescriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{28, 0} -} - -type GetCommitSignaturesResponse_Signer int32 - -const ( - GetCommitSignaturesResponse_SIGNER_UNSPECIFIED GetCommitSignaturesResponse_Signer = 0 - GetCommitSignaturesResponse_SIGNER_USER GetCommitSignaturesResponse_Signer = 1 - GetCommitSignaturesResponse_SIGNER_SYSTEM GetCommitSignaturesResponse_Signer = 2 -) - -// Enum value maps for GetCommitSignaturesResponse_Signer. -var ( - GetCommitSignaturesResponse_Signer_name = map[int32]string{ - 0: "SIGNER_UNSPECIFIED", - 1: "SIGNER_USER", - 2: "SIGNER_SYSTEM", - } - GetCommitSignaturesResponse_Signer_value = map[string]int32{ - "SIGNER_UNSPECIFIED": 0, - "SIGNER_USER": 1, - "SIGNER_SYSTEM": 2, - } -) - -func (x GetCommitSignaturesResponse_Signer) Enum() *GetCommitSignaturesResponse_Signer { - p := new(GetCommitSignaturesResponse_Signer) - *p = x - return p -} - -func (x GetCommitSignaturesResponse_Signer) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (GetCommitSignaturesResponse_Signer) Descriptor() protoreflect.EnumDescriptor { - return file_commit_proto_enumTypes[6].Descriptor() -} - -func (GetCommitSignaturesResponse_Signer) Type() protoreflect.EnumType { - return &file_commit_proto_enumTypes[6] -} - -func (x GetCommitSignaturesResponse_Signer) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use GetCommitSignaturesResponse_Signer.Descriptor instead. -func (GetCommitSignaturesResponse_Signer) EnumDescriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{45, 0} -} - -type ListCommitsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` - Revisions []string `protobuf:"bytes,2,rep,name=revisions,proto3" json:"revisions,omitempty"` - PaginationParams *PaginationParameter `protobuf:"bytes,3,opt,name=pagination_params,json=paginationParams,proto3" json:"pagination_params,omitempty"` - Order ListCommitsRequest_Order `protobuf:"varint,4,opt,name=order,proto3,enum=gitaly.ListCommitsRequest_Order" json:"order,omitempty"` - Reverse bool `protobuf:"varint,11,opt,name=reverse,proto3" json:"reverse,omitempty"` - MaxParents uint32 `protobuf:"varint,5,opt,name=max_parents,json=maxParents,proto3" json:"max_parents,omitempty"` - DisableWalk bool `protobuf:"varint,6,opt,name=disable_walk,json=disableWalk,proto3" json:"disable_walk,omitempty"` - FirstParent bool `protobuf:"varint,7,opt,name=first_parent,json=firstParent,proto3" json:"first_parent,omitempty"` - After *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=after,proto3" json:"after,omitempty"` - Before *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=before,proto3" json:"before,omitempty"` - Author []byte `protobuf:"bytes,10,opt,name=author,proto3" json:"author,omitempty"` - IgnoreCase bool `protobuf:"varint,12,opt,name=ignore_case,json=ignoreCase,proto3" json:"ignore_case,omitempty"` - CommitMessagePatterns [][]byte `protobuf:"bytes,13,rep,name=commit_message_patterns,json=commitMessagePatterns,proto3" json:"commit_message_patterns,omitempty"` -} - -func (x *ListCommitsRequest) Reset() { - *x = ListCommitsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListCommitsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListCommitsRequest) ProtoMessage() {} - -func (x *ListCommitsRequest) ProtoReflect() protoreflect.Message { - mi := &file_commit_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 ListCommitsRequest.ProtoReflect.Descriptor instead. -func (*ListCommitsRequest) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{0} -} - -func (x *ListCommitsRequest) GetRepository() *Repository { - if x != nil { - return x.Repository - } - return nil -} - -func (x *ListCommitsRequest) GetRevisions() []string { - if x != nil { - return x.Revisions - } - return nil -} - -func (x *ListCommitsRequest) GetPaginationParams() *PaginationParameter { - if x != nil { - return x.PaginationParams - } - return nil -} - -func (x *ListCommitsRequest) GetOrder() ListCommitsRequest_Order { - if x != nil { - return x.Order - } - return ListCommitsRequest_NONE -} - -func (x *ListCommitsRequest) GetReverse() bool { - if x != nil { - return x.Reverse - } - return false -} - -func (x *ListCommitsRequest) GetMaxParents() uint32 { - if x != nil { - return x.MaxParents - } - return 0 -} - -func (x *ListCommitsRequest) GetDisableWalk() bool { - if x != nil { - return x.DisableWalk - } - return false -} - -func (x *ListCommitsRequest) GetFirstParent() bool { - if x != nil { - return x.FirstParent - } - return false -} - -func (x *ListCommitsRequest) GetAfter() *timestamppb.Timestamp { - if x != nil { - return x.After - } - return nil -} - -func (x *ListCommitsRequest) GetBefore() *timestamppb.Timestamp { - if x != nil { - return x.Before - } - return nil -} - -func (x *ListCommitsRequest) GetAuthor() []byte { - if x != nil { - return x.Author - } - return nil -} - -func (x *ListCommitsRequest) GetIgnoreCase() bool { - if x != nil { - return x.IgnoreCase - } - return false -} - -func (x *ListCommitsRequest) GetCommitMessagePatterns() [][]byte { - if x != nil { - return x.CommitMessagePatterns - } - return nil -} - -type ListCommitsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Commits []*GitCommit `protobuf:"bytes,1,rep,name=commits,proto3" json:"commits,omitempty"` -} - -func (x *ListCommitsResponse) Reset() { - *x = ListCommitsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListCommitsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListCommitsResponse) ProtoMessage() {} - -func (x *ListCommitsResponse) ProtoReflect() protoreflect.Message { - mi := &file_commit_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 ListCommitsResponse.ProtoReflect.Descriptor instead. -func (*ListCommitsResponse) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{1} -} - -func (x *ListCommitsResponse) GetCommits() []*GitCommit { - if x != nil { - return x.Commits - } - return nil -} - -type ListAllCommitsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` - PaginationParams *PaginationParameter `protobuf:"bytes,2,opt,name=pagination_params,json=paginationParams,proto3" json:"pagination_params,omitempty"` -} - -func (x *ListAllCommitsRequest) Reset() { - *x = ListAllCommitsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListAllCommitsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListAllCommitsRequest) ProtoMessage() {} - -func (x *ListAllCommitsRequest) ProtoReflect() protoreflect.Message { - mi := &file_commit_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 ListAllCommitsRequest.ProtoReflect.Descriptor instead. -func (*ListAllCommitsRequest) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{2} -} - -func (x *ListAllCommitsRequest) GetRepository() *Repository { - if x != nil { - return x.Repository - } - return nil -} - -func (x *ListAllCommitsRequest) GetPaginationParams() *PaginationParameter { - if x != nil { - return x.PaginationParams - } - return nil -} - -type ListAllCommitsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Commits []*GitCommit `protobuf:"bytes,1,rep,name=commits,proto3" json:"commits,omitempty"` -} - -func (x *ListAllCommitsResponse) Reset() { - *x = ListAllCommitsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListAllCommitsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListAllCommitsResponse) ProtoMessage() {} - -func (x *ListAllCommitsResponse) ProtoReflect() protoreflect.Message { - mi := &file_commit_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 ListAllCommitsResponse.ProtoReflect.Descriptor instead. -func (*ListAllCommitsResponse) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{3} -} - -func (x *ListAllCommitsResponse) GetCommits() []*GitCommit { - if x != nil { - return x.Commits - } - return nil -} - -type CommitStatsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` - Revision []byte `protobuf:"bytes,2,opt,name=revision,proto3" json:"revision,omitempty"` -} - -func (x *CommitStatsRequest) Reset() { - *x = CommitStatsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CommitStatsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CommitStatsRequest) ProtoMessage() {} - -func (x *CommitStatsRequest) ProtoReflect() protoreflect.Message { - mi := &file_commit_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 CommitStatsRequest.ProtoReflect.Descriptor instead. -func (*CommitStatsRequest) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{4} -} - -func (x *CommitStatsRequest) GetRepository() *Repository { - if x != nil { - return x.Repository - } - return nil -} - -func (x *CommitStatsRequest) GetRevision() []byte { - if x != nil { - return x.Revision - } - return nil -} - -type CommitStatsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Oid string `protobuf:"bytes,1,opt,name=oid,proto3" json:"oid,omitempty"` - Additions int32 `protobuf:"varint,2,opt,name=additions,proto3" json:"additions,omitempty"` - Deletions int32 `protobuf:"varint,3,opt,name=deletions,proto3" json:"deletions,omitempty"` -} - -func (x *CommitStatsResponse) Reset() { - *x = CommitStatsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CommitStatsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CommitStatsResponse) ProtoMessage() {} - -func (x *CommitStatsResponse) ProtoReflect() protoreflect.Message { - mi := &file_commit_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 CommitStatsResponse.ProtoReflect.Descriptor instead. -func (*CommitStatsResponse) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{5} -} - -func (x *CommitStatsResponse) GetOid() string { - if x != nil { - return x.Oid - } - return "" -} - -func (x *CommitStatsResponse) GetAdditions() int32 { - if x != nil { - return x.Additions - } - return 0 -} - -func (x *CommitStatsResponse) GetDeletions() int32 { - if x != nil { - return x.Deletions - } - return 0 -} - -type CommitIsAncestorRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` - AncestorId string `protobuf:"bytes,2,opt,name=ancestor_id,json=ancestorId,proto3" json:"ancestor_id,omitempty"` - ChildId string `protobuf:"bytes,3,opt,name=child_id,json=childId,proto3" json:"child_id,omitempty"` -} - -func (x *CommitIsAncestorRequest) Reset() { - *x = CommitIsAncestorRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CommitIsAncestorRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CommitIsAncestorRequest) ProtoMessage() {} - -func (x *CommitIsAncestorRequest) ProtoReflect() protoreflect.Message { - mi := &file_commit_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 CommitIsAncestorRequest.ProtoReflect.Descriptor instead. -func (*CommitIsAncestorRequest) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{6} -} - -func (x *CommitIsAncestorRequest) GetRepository() *Repository { - if x != nil { - return x.Repository - } - return nil -} - -func (x *CommitIsAncestorRequest) GetAncestorId() string { - if x != nil { - return x.AncestorId - } - return "" -} - -func (x *CommitIsAncestorRequest) GetChildId() string { - if x != nil { - return x.ChildId - } - return "" -} - -type CommitIsAncestorResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Value bool `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *CommitIsAncestorResponse) Reset() { - *x = CommitIsAncestorResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CommitIsAncestorResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CommitIsAncestorResponse) ProtoMessage() {} - -func (x *CommitIsAncestorResponse) ProtoReflect() protoreflect.Message { - mi := &file_commit_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 CommitIsAncestorResponse.ProtoReflect.Descriptor instead. -func (*CommitIsAncestorResponse) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{7} -} - -func (x *CommitIsAncestorResponse) GetValue() bool { - if x != nil { - return x.Value - } - return false -} - -type TreeEntryRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` - Revision []byte `protobuf:"bytes,2,opt,name=revision,proto3" json:"revision,omitempty"` - Path []byte `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` - Limit int64 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` - MaxSize int64 `protobuf:"varint,5,opt,name=max_size,json=maxSize,proto3" json:"max_size,omitempty"` -} - -func (x *TreeEntryRequest) Reset() { - *x = TreeEntryRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TreeEntryRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TreeEntryRequest) ProtoMessage() {} - -func (x *TreeEntryRequest) ProtoReflect() protoreflect.Message { - mi := &file_commit_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 TreeEntryRequest.ProtoReflect.Descriptor instead. -func (*TreeEntryRequest) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{8} -} - -func (x *TreeEntryRequest) GetRepository() *Repository { - if x != nil { - return x.Repository - } - return nil -} - -func (x *TreeEntryRequest) GetRevision() []byte { - if x != nil { - return x.Revision - } - return nil -} - -func (x *TreeEntryRequest) GetPath() []byte { - if x != nil { - return x.Path - } - return nil -} - -func (x *TreeEntryRequest) GetLimit() int64 { - if x != nil { - return x.Limit - } - return 0 -} - -func (x *TreeEntryRequest) GetMaxSize() int64 { - if x != nil { - return x.MaxSize - } - return 0 -} - -type TreeEntryResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Type TreeEntryResponse_ObjectType `protobuf:"varint,1,opt,name=type,proto3,enum=gitaly.TreeEntryResponse_ObjectType" json:"type,omitempty"` - Oid string `protobuf:"bytes,2,opt,name=oid,proto3" json:"oid,omitempty"` - Size int64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"` - Mode int32 `protobuf:"varint,4,opt,name=mode,proto3" json:"mode,omitempty"` - Data []byte `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"` -} - -func (x *TreeEntryResponse) Reset() { - *x = TreeEntryResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TreeEntryResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TreeEntryResponse) ProtoMessage() {} - -func (x *TreeEntryResponse) ProtoReflect() protoreflect.Message { - mi := &file_commit_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 TreeEntryResponse.ProtoReflect.Descriptor instead. -func (*TreeEntryResponse) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{9} -} - -func (x *TreeEntryResponse) GetType() TreeEntryResponse_ObjectType { - if x != nil { - return x.Type - } - return TreeEntryResponse_COMMIT -} - -func (x *TreeEntryResponse) GetOid() string { - if x != nil { - return x.Oid - } - return "" -} - -func (x *TreeEntryResponse) GetSize() int64 { - if x != nil { - return x.Size - } - return 0 -} - -func (x *TreeEntryResponse) GetMode() int32 { - if x != nil { - return x.Mode - } - return 0 -} - -func (x *TreeEntryResponse) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -type CountCommitsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` - Revision []byte `protobuf:"bytes,2,opt,name=revision,proto3" json:"revision,omitempty"` - After *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=after,proto3" json:"after,omitempty"` - Before *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=before,proto3" json:"before,omitempty"` - Path []byte `protobuf:"bytes,5,opt,name=path,proto3" json:"path,omitempty"` - MaxCount int32 `protobuf:"varint,6,opt,name=max_count,json=maxCount,proto3" json:"max_count,omitempty"` - All bool `protobuf:"varint,7,opt,name=all,proto3" json:"all,omitempty"` - FirstParent bool `protobuf:"varint,8,opt,name=first_parent,json=firstParent,proto3" json:"first_parent,omitempty"` - GlobalOptions *GlobalOptions `protobuf:"bytes,9,opt,name=global_options,json=globalOptions,proto3" json:"global_options,omitempty"` -} - -func (x *CountCommitsRequest) Reset() { - *x = CountCommitsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CountCommitsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CountCommitsRequest) ProtoMessage() {} - -func (x *CountCommitsRequest) ProtoReflect() protoreflect.Message { - mi := &file_commit_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 CountCommitsRequest.ProtoReflect.Descriptor instead. -func (*CountCommitsRequest) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{10} -} - -func (x *CountCommitsRequest) GetRepository() *Repository { - if x != nil { - return x.Repository - } - return nil -} - -func (x *CountCommitsRequest) GetRevision() []byte { - if x != nil { - return x.Revision - } - return nil -} - -func (x *CountCommitsRequest) GetAfter() *timestamppb.Timestamp { - if x != nil { - return x.After - } - return nil -} - -func (x *CountCommitsRequest) GetBefore() *timestamppb.Timestamp { - if x != nil { - return x.Before - } - return nil -} - -func (x *CountCommitsRequest) GetPath() []byte { - if x != nil { - return x.Path - } - return nil -} - -func (x *CountCommitsRequest) GetMaxCount() int32 { - if x != nil { - return x.MaxCount - } - return 0 -} - -func (x *CountCommitsRequest) GetAll() bool { - if x != nil { - return x.All - } - return false -} - -func (x *CountCommitsRequest) GetFirstParent() bool { - if x != nil { - return x.FirstParent - } - return false -} - -func (x *CountCommitsRequest) GetGlobalOptions() *GlobalOptions { - if x != nil { - return x.GlobalOptions - } - return nil -} - -type CountCommitsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Count int32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` -} - -func (x *CountCommitsResponse) Reset() { - *x = CountCommitsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CountCommitsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CountCommitsResponse) ProtoMessage() {} - -func (x *CountCommitsResponse) ProtoReflect() protoreflect.Message { - mi := &file_commit_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 CountCommitsResponse.ProtoReflect.Descriptor instead. -func (*CountCommitsResponse) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{11} -} - -func (x *CountCommitsResponse) GetCount() int32 { - if x != nil { - return x.Count - } - return 0 -} - -type CountDivergingCommitsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` - From []byte `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"` - To []byte `protobuf:"bytes,3,opt,name=to,proto3" json:"to,omitempty"` - MaxCount int32 `protobuf:"varint,7,opt,name=max_count,json=maxCount,proto3" json:"max_count,omitempty"` -} - -func (x *CountDivergingCommitsRequest) Reset() { - *x = CountDivergingCommitsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CountDivergingCommitsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CountDivergingCommitsRequest) ProtoMessage() {} - -func (x *CountDivergingCommitsRequest) ProtoReflect() protoreflect.Message { - mi := &file_commit_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 CountDivergingCommitsRequest.ProtoReflect.Descriptor instead. -func (*CountDivergingCommitsRequest) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{12} -} - -func (x *CountDivergingCommitsRequest) GetRepository() *Repository { - if x != nil { - return x.Repository - } - return nil -} - -func (x *CountDivergingCommitsRequest) GetFrom() []byte { - if x != nil { - return x.From - } - return nil -} - -func (x *CountDivergingCommitsRequest) GetTo() []byte { - if x != nil { - return x.To - } - return nil -} - -func (x *CountDivergingCommitsRequest) GetMaxCount() int32 { - if x != nil { - return x.MaxCount - } - return 0 -} - -type CountDivergingCommitsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - LeftCount int32 `protobuf:"varint,1,opt,name=left_count,json=leftCount,proto3" json:"left_count,omitempty"` - RightCount int32 `protobuf:"varint,2,opt,name=right_count,json=rightCount,proto3" json:"right_count,omitempty"` -} - -func (x *CountDivergingCommitsResponse) Reset() { - *x = CountDivergingCommitsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CountDivergingCommitsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CountDivergingCommitsResponse) ProtoMessage() {} - -func (x *CountDivergingCommitsResponse) ProtoReflect() protoreflect.Message { - mi := &file_commit_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 CountDivergingCommitsResponse.ProtoReflect.Descriptor instead. -func (*CountDivergingCommitsResponse) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{13} -} - -func (x *CountDivergingCommitsResponse) GetLeftCount() int32 { - if x != nil { - return x.LeftCount - } - return 0 -} - -func (x *CountDivergingCommitsResponse) GetRightCount() int32 { - if x != nil { - return x.RightCount - } - return 0 -} - -type TreeEntry struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Oid string `protobuf:"bytes,1,opt,name=oid,proto3" json:"oid,omitempty"` - Path []byte `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` - Type TreeEntry_EntryType `protobuf:"varint,4,opt,name=type,proto3,enum=gitaly.TreeEntry_EntryType" json:"type,omitempty"` - Mode int32 `protobuf:"varint,5,opt,name=mode,proto3" json:"mode,omitempty"` - CommitOid string `protobuf:"bytes,6,opt,name=commit_oid,json=commitOid,proto3" json:"commit_oid,omitempty"` - FlatPath []byte `protobuf:"bytes,7,opt,name=flat_path,json=flatPath,proto3" json:"flat_path,omitempty"` -} - -func (x *TreeEntry) Reset() { - *x = TreeEntry{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TreeEntry) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TreeEntry) ProtoMessage() {} - -func (x *TreeEntry) ProtoReflect() protoreflect.Message { - mi := &file_commit_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 TreeEntry.ProtoReflect.Descriptor instead. -func (*TreeEntry) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{14} -} - -func (x *TreeEntry) GetOid() string { - if x != nil { - return x.Oid - } - return "" -} - -func (x *TreeEntry) GetPath() []byte { - if x != nil { - return x.Path - } - return nil -} - -func (x *TreeEntry) GetType() TreeEntry_EntryType { - if x != nil { - return x.Type - } - return TreeEntry_BLOB -} - -func (x *TreeEntry) GetMode() int32 { - if x != nil { - return x.Mode - } - return 0 -} - -func (x *TreeEntry) GetCommitOid() string { - if x != nil { - return x.CommitOid - } - return "" -} - -func (x *TreeEntry) GetFlatPath() []byte { - if x != nil { - return x.FlatPath - } - return nil -} - -type GetTreeEntriesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` - Revision []byte `protobuf:"bytes,2,opt,name=revision,proto3" json:"revision,omitempty"` - Path []byte `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` - Recursive bool `protobuf:"varint,4,opt,name=recursive,proto3" json:"recursive,omitempty"` - Sort GetTreeEntriesRequest_SortBy `protobuf:"varint,5,opt,name=sort,proto3,enum=gitaly.GetTreeEntriesRequest_SortBy" json:"sort,omitempty"` - PaginationParams *PaginationParameter `protobuf:"bytes,6,opt,name=pagination_params,json=paginationParams,proto3" json:"pagination_params,omitempty"` - SkipFlatPaths bool `protobuf:"varint,7,opt,name=skip_flat_paths,json=skipFlatPaths,proto3" json:"skip_flat_paths,omitempty"` -} - -func (x *GetTreeEntriesRequest) Reset() { - *x = GetTreeEntriesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetTreeEntriesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetTreeEntriesRequest) ProtoMessage() {} - -func (x *GetTreeEntriesRequest) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[15] - 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 GetTreeEntriesRequest.ProtoReflect.Descriptor instead. -func (*GetTreeEntriesRequest) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{15} -} - -func (x *GetTreeEntriesRequest) GetRepository() *Repository { - if x != nil { - return x.Repository - } - return nil -} - -func (x *GetTreeEntriesRequest) GetRevision() []byte { - if x != nil { - return x.Revision - } - return nil -} - -func (x *GetTreeEntriesRequest) GetPath() []byte { - if x != nil { - return x.Path - } - return nil -} - -func (x *GetTreeEntriesRequest) GetRecursive() bool { - if x != nil { - return x.Recursive - } - return false -} - -func (x *GetTreeEntriesRequest) GetSort() GetTreeEntriesRequest_SortBy { - if x != nil { - return x.Sort - } - return GetTreeEntriesRequest_DEFAULT -} - -func (x *GetTreeEntriesRequest) GetPaginationParams() *PaginationParameter { - if x != nil { - return x.PaginationParams - } - return nil -} - -func (x *GetTreeEntriesRequest) GetSkipFlatPaths() bool { - if x != nil { - return x.SkipFlatPaths - } - return false -} - -type GetTreeEntriesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Entries []*TreeEntry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"` - PaginationCursor *PaginationCursor `protobuf:"bytes,2,opt,name=pagination_cursor,json=paginationCursor,proto3" json:"pagination_cursor,omitempty"` -} - -func (x *GetTreeEntriesResponse) Reset() { - *x = GetTreeEntriesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetTreeEntriesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetTreeEntriesResponse) ProtoMessage() {} - -func (x *GetTreeEntriesResponse) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[16] - 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 GetTreeEntriesResponse.ProtoReflect.Descriptor instead. -func (*GetTreeEntriesResponse) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{16} -} - -func (x *GetTreeEntriesResponse) GetEntries() []*TreeEntry { - if x != nil { - return x.Entries - } - return nil -} - -func (x *GetTreeEntriesResponse) GetPaginationCursor() *PaginationCursor { - if x != nil { - return x.PaginationCursor - } - return nil -} - -type GetTreeEntriesError struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Error: - // - // *GetTreeEntriesError_ResolveTree - // *GetTreeEntriesError_Path - Error isGetTreeEntriesError_Error `protobuf_oneof:"error"` -} - -func (x *GetTreeEntriesError) Reset() { - *x = GetTreeEntriesError{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetTreeEntriesError) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetTreeEntriesError) ProtoMessage() {} - -func (x *GetTreeEntriesError) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[17] - 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 GetTreeEntriesError.ProtoReflect.Descriptor instead. -func (*GetTreeEntriesError) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{17} -} - -func (m *GetTreeEntriesError) GetError() isGetTreeEntriesError_Error { - if m != nil { - return m.Error - } - return nil -} - -func (x *GetTreeEntriesError) GetResolveTree() *ResolveRevisionError { - if x, ok := x.GetError().(*GetTreeEntriesError_ResolveTree); ok { - return x.ResolveTree - } - return nil -} - -func (x *GetTreeEntriesError) GetPath() *PathError { - if x, ok := x.GetError().(*GetTreeEntriesError_Path); ok { - return x.Path - } - return nil -} - -type isGetTreeEntriesError_Error interface { - isGetTreeEntriesError_Error() -} - -type GetTreeEntriesError_ResolveTree struct { - ResolveTree *ResolveRevisionError `protobuf:"bytes,1,opt,name=resolve_tree,json=resolveTree,proto3,oneof"` -} - -type GetTreeEntriesError_Path struct { - Path *PathError `protobuf:"bytes,2,opt,name=path,proto3,oneof"` -} - -func (*GetTreeEntriesError_ResolveTree) isGetTreeEntriesError_Error() {} - -func (*GetTreeEntriesError_Path) isGetTreeEntriesError_Error() {} - -type ListFilesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` - Revision []byte `protobuf:"bytes,2,opt,name=revision,proto3" json:"revision,omitempty"` -} - -func (x *ListFilesRequest) Reset() { - *x = ListFilesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListFilesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListFilesRequest) ProtoMessage() {} - -func (x *ListFilesRequest) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[18] - 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 ListFilesRequest.ProtoReflect.Descriptor instead. -func (*ListFilesRequest) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{18} -} - -func (x *ListFilesRequest) GetRepository() *Repository { - if x != nil { - return x.Repository - } - return nil -} - -func (x *ListFilesRequest) GetRevision() []byte { - if x != nil { - return x.Revision - } - return nil -} - -type ListFilesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Paths [][]byte `protobuf:"bytes,1,rep,name=paths,proto3" json:"paths,omitempty"` -} - -func (x *ListFilesResponse) Reset() { - *x = ListFilesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListFilesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListFilesResponse) ProtoMessage() {} - -func (x *ListFilesResponse) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[19] - 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 ListFilesResponse.ProtoReflect.Descriptor instead. -func (*ListFilesResponse) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{19} -} - -func (x *ListFilesResponse) GetPaths() [][]byte { - if x != nil { - return x.Paths - } - return nil -} - -type FindCommitRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` - Revision []byte `protobuf:"bytes,2,opt,name=revision,proto3" json:"revision,omitempty"` - Trailers bool `protobuf:"varint,3,opt,name=trailers,proto3" json:"trailers,omitempty"` -} - -func (x *FindCommitRequest) Reset() { - *x = FindCommitRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FindCommitRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FindCommitRequest) ProtoMessage() {} - -func (x *FindCommitRequest) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[20] - 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 FindCommitRequest.ProtoReflect.Descriptor instead. -func (*FindCommitRequest) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{20} -} - -func (x *FindCommitRequest) GetRepository() *Repository { - if x != nil { - return x.Repository - } - return nil -} - -func (x *FindCommitRequest) GetRevision() []byte { - if x != nil { - return x.Revision - } - return nil -} - -func (x *FindCommitRequest) GetTrailers() bool { - if x != nil { - return x.Trailers - } - return false -} - -type FindCommitResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Commit *GitCommit `protobuf:"bytes,1,opt,name=commit,proto3" json:"commit,omitempty"` -} - -func (x *FindCommitResponse) Reset() { - *x = FindCommitResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FindCommitResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FindCommitResponse) ProtoMessage() {} - -func (x *FindCommitResponse) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[21] - 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 FindCommitResponse.ProtoReflect.Descriptor instead. -func (*FindCommitResponse) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{21} -} - -func (x *FindCommitResponse) GetCommit() *GitCommit { - if x != nil { - return x.Commit - } - return nil -} - -type ListCommitsByOidRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` - Oid []string `protobuf:"bytes,2,rep,name=oid,proto3" json:"oid,omitempty"` -} - -func (x *ListCommitsByOidRequest) Reset() { - *x = ListCommitsByOidRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListCommitsByOidRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListCommitsByOidRequest) ProtoMessage() {} - -func (x *ListCommitsByOidRequest) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[22] - 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 ListCommitsByOidRequest.ProtoReflect.Descriptor instead. -func (*ListCommitsByOidRequest) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{22} -} - -func (x *ListCommitsByOidRequest) GetRepository() *Repository { - if x != nil { - return x.Repository - } - return nil -} - -func (x *ListCommitsByOidRequest) GetOid() []string { - if x != nil { - return x.Oid - } - return nil -} - -type ListCommitsByOidResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Commits []*GitCommit `protobuf:"bytes,1,rep,name=commits,proto3" json:"commits,omitempty"` -} - -func (x *ListCommitsByOidResponse) Reset() { - *x = ListCommitsByOidResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListCommitsByOidResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListCommitsByOidResponse) ProtoMessage() {} - -func (x *ListCommitsByOidResponse) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[23] - 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 ListCommitsByOidResponse.ProtoReflect.Descriptor instead. -func (*ListCommitsByOidResponse) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{23} -} - -func (x *ListCommitsByOidResponse) GetCommits() []*GitCommit { - if x != nil { - return x.Commits - } - return nil -} - -type ListCommitsByRefNameRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` - RefNames [][]byte `protobuf:"bytes,2,rep,name=ref_names,json=refNames,proto3" json:"ref_names,omitempty"` -} - -func (x *ListCommitsByRefNameRequest) Reset() { - *x = ListCommitsByRefNameRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListCommitsByRefNameRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListCommitsByRefNameRequest) ProtoMessage() {} - -func (x *ListCommitsByRefNameRequest) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[24] - 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 ListCommitsByRefNameRequest.ProtoReflect.Descriptor instead. -func (*ListCommitsByRefNameRequest) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{24} -} - -func (x *ListCommitsByRefNameRequest) GetRepository() *Repository { - if x != nil { - return x.Repository - } - return nil -} - -func (x *ListCommitsByRefNameRequest) GetRefNames() [][]byte { - if x != nil { - return x.RefNames - } - return nil -} - -type ListCommitsByRefNameResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - CommitRefs []*ListCommitsByRefNameResponse_CommitForRef `protobuf:"bytes,2,rep,name=commit_refs,json=commitRefs,proto3" json:"commit_refs,omitempty"` -} - -func (x *ListCommitsByRefNameResponse) Reset() { - *x = ListCommitsByRefNameResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListCommitsByRefNameResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListCommitsByRefNameResponse) ProtoMessage() {} - -func (x *ListCommitsByRefNameResponse) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[25] - 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 ListCommitsByRefNameResponse.ProtoReflect.Descriptor instead. -func (*ListCommitsByRefNameResponse) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{25} -} - -func (x *ListCommitsByRefNameResponse) GetCommitRefs() []*ListCommitsByRefNameResponse_CommitForRef { - if x != nil { - return x.CommitRefs - } - return nil -} - -type FindAllCommitsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` - Revision []byte `protobuf:"bytes,2,opt,name=revision,proto3" json:"revision,omitempty"` - MaxCount int32 `protobuf:"varint,3,opt,name=max_count,json=maxCount,proto3" json:"max_count,omitempty"` - Skip int32 `protobuf:"varint,4,opt,name=skip,proto3" json:"skip,omitempty"` - Order FindAllCommitsRequest_Order `protobuf:"varint,5,opt,name=order,proto3,enum=gitaly.FindAllCommitsRequest_Order" json:"order,omitempty"` -} - -func (x *FindAllCommitsRequest) Reset() { - *x = FindAllCommitsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FindAllCommitsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FindAllCommitsRequest) ProtoMessage() {} - -func (x *FindAllCommitsRequest) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[26] - 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 FindAllCommitsRequest.ProtoReflect.Descriptor instead. -func (*FindAllCommitsRequest) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{26} -} - -func (x *FindAllCommitsRequest) GetRepository() *Repository { - if x != nil { - return x.Repository - } - return nil -} - -func (x *FindAllCommitsRequest) GetRevision() []byte { - if x != nil { - return x.Revision - } - return nil -} - -func (x *FindAllCommitsRequest) GetMaxCount() int32 { - if x != nil { - return x.MaxCount - } - return 0 -} - -func (x *FindAllCommitsRequest) GetSkip() int32 { - if x != nil { - return x.Skip - } - return 0 -} - -func (x *FindAllCommitsRequest) GetOrder() FindAllCommitsRequest_Order { - if x != nil { - return x.Order - } - return FindAllCommitsRequest_NONE -} - -type FindAllCommitsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Commits []*GitCommit `protobuf:"bytes,1,rep,name=commits,proto3" json:"commits,omitempty"` -} - -func (x *FindAllCommitsResponse) Reset() { - *x = FindAllCommitsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FindAllCommitsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FindAllCommitsResponse) ProtoMessage() {} - -func (x *FindAllCommitsResponse) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[27] - 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 FindAllCommitsResponse.ProtoReflect.Descriptor instead. -func (*FindAllCommitsResponse) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{27} -} - -func (x *FindAllCommitsResponse) GetCommits() []*GitCommit { - if x != nil { - return x.Commits - } - return nil -} - -type FindCommitsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` - Revision []byte `protobuf:"bytes,2,opt,name=revision,proto3" json:"revision,omitempty"` - Limit int32 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"` - Offset int32 `protobuf:"varint,4,opt,name=offset,proto3" json:"offset,omitempty"` - Paths [][]byte `protobuf:"bytes,5,rep,name=paths,proto3" json:"paths,omitempty"` - Follow bool `protobuf:"varint,6,opt,name=follow,proto3" json:"follow,omitempty"` - SkipMerges bool `protobuf:"varint,7,opt,name=skip_merges,json=skipMerges,proto3" json:"skip_merges,omitempty"` - DisableWalk bool `protobuf:"varint,8,opt,name=disable_walk,json=disableWalk,proto3" json:"disable_walk,omitempty"` - After *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=after,proto3" json:"after,omitempty"` - Before *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=before,proto3" json:"before,omitempty"` - All bool `protobuf:"varint,11,opt,name=all,proto3" json:"all,omitempty"` - FirstParent bool `protobuf:"varint,12,opt,name=first_parent,json=firstParent,proto3" json:"first_parent,omitempty"` - Author []byte `protobuf:"bytes,13,opt,name=author,proto3" json:"author,omitempty"` - Order FindCommitsRequest_Order `protobuf:"varint,14,opt,name=order,proto3,enum=gitaly.FindCommitsRequest_Order" json:"order,omitempty"` - GlobalOptions *GlobalOptions `protobuf:"bytes,15,opt,name=global_options,json=globalOptions,proto3" json:"global_options,omitempty"` - Trailers bool `protobuf:"varint,16,opt,name=trailers,proto3" json:"trailers,omitempty"` - IncludeShortstat bool `protobuf:"varint,17,opt,name=include_shortstat,json=includeShortstat,proto3" json:"include_shortstat,omitempty"` - IncludeReferencedBy [][]byte `protobuf:"bytes,18,rep,name=include_referenced_by,json=includeReferencedBy,proto3" json:"include_referenced_by,omitempty"` -} - -func (x *FindCommitsRequest) Reset() { - *x = FindCommitsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FindCommitsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FindCommitsRequest) ProtoMessage() {} - -func (x *FindCommitsRequest) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[28] - 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 FindCommitsRequest.ProtoReflect.Descriptor instead. -func (*FindCommitsRequest) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{28} -} - -func (x *FindCommitsRequest) GetRepository() *Repository { - if x != nil { - return x.Repository - } - return nil -} - -func (x *FindCommitsRequest) GetRevision() []byte { - if x != nil { - return x.Revision - } - return nil -} - -func (x *FindCommitsRequest) GetLimit() int32 { - if x != nil { - return x.Limit - } - return 0 -} - -func (x *FindCommitsRequest) GetOffset() int32 { - if x != nil { - return x.Offset - } - return 0 -} - -func (x *FindCommitsRequest) GetPaths() [][]byte { - if x != nil { - return x.Paths - } - return nil -} - -func (x *FindCommitsRequest) GetFollow() bool { - if x != nil { - return x.Follow - } - return false -} - -func (x *FindCommitsRequest) GetSkipMerges() bool { - if x != nil { - return x.SkipMerges - } - return false -} - -func (x *FindCommitsRequest) GetDisableWalk() bool { - if x != nil { - return x.DisableWalk - } - return false -} - -func (x *FindCommitsRequest) GetAfter() *timestamppb.Timestamp { - if x != nil { - return x.After - } - return nil -} - -func (x *FindCommitsRequest) GetBefore() *timestamppb.Timestamp { - if x != nil { - return x.Before - } - return nil -} - -func (x *FindCommitsRequest) GetAll() bool { - if x != nil { - return x.All - } - return false -} - -func (x *FindCommitsRequest) GetFirstParent() bool { - if x != nil { - return x.FirstParent - } - return false -} - -func (x *FindCommitsRequest) GetAuthor() []byte { - if x != nil { - return x.Author - } - return nil -} - -func (x *FindCommitsRequest) GetOrder() FindCommitsRequest_Order { - if x != nil { - return x.Order - } - return FindCommitsRequest_NONE -} - -func (x *FindCommitsRequest) GetGlobalOptions() *GlobalOptions { - if x != nil { - return x.GlobalOptions - } - return nil -} - -func (x *FindCommitsRequest) GetTrailers() bool { - if x != nil { - return x.Trailers - } - return false -} - -func (x *FindCommitsRequest) GetIncludeShortstat() bool { - if x != nil { - return x.IncludeShortstat - } - return false -} - -func (x *FindCommitsRequest) GetIncludeReferencedBy() [][]byte { - if x != nil { - return x.IncludeReferencedBy - } - return nil -} - -type FindCommitsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Commits []*GitCommit `protobuf:"bytes,1,rep,name=commits,proto3" json:"commits,omitempty"` -} - -func (x *FindCommitsResponse) Reset() { - *x = FindCommitsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[29] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FindCommitsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FindCommitsResponse) ProtoMessage() {} - -func (x *FindCommitsResponse) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[29] - 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 FindCommitsResponse.ProtoReflect.Descriptor instead. -func (*FindCommitsResponse) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{29} -} - -func (x *FindCommitsResponse) GetCommits() []*GitCommit { - if x != nil { - return x.Commits - } - return nil -} - -type CommitLanguagesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` - Revision []byte `protobuf:"bytes,2,opt,name=revision,proto3" json:"revision,omitempty"` -} - -func (x *CommitLanguagesRequest) Reset() { - *x = CommitLanguagesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[30] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CommitLanguagesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CommitLanguagesRequest) ProtoMessage() {} - -func (x *CommitLanguagesRequest) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[30] - 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 CommitLanguagesRequest.ProtoReflect.Descriptor instead. -func (*CommitLanguagesRequest) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{30} -} - -func (x *CommitLanguagesRequest) GetRepository() *Repository { - if x != nil { - return x.Repository - } - return nil -} - -func (x *CommitLanguagesRequest) GetRevision() []byte { - if x != nil { - return x.Revision - } - return nil -} - -type CommitLanguagesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Languages []*CommitLanguagesResponse_Language `protobuf:"bytes,1,rep,name=languages,proto3" json:"languages,omitempty"` -} - -func (x *CommitLanguagesResponse) Reset() { - *x = CommitLanguagesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[31] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CommitLanguagesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CommitLanguagesResponse) ProtoMessage() {} - -func (x *CommitLanguagesResponse) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[31] - 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 CommitLanguagesResponse.ProtoReflect.Descriptor instead. -func (*CommitLanguagesResponse) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{31} -} - -func (x *CommitLanguagesResponse) GetLanguages() []*CommitLanguagesResponse_Language { - if x != nil { - return x.Languages - } - return nil -} - -type RawBlameRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` - Revision []byte `protobuf:"bytes,2,opt,name=revision,proto3" json:"revision,omitempty"` - Path []byte `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` - Range []byte `protobuf:"bytes,4,opt,name=range,proto3" json:"range,omitempty"` -} - -func (x *RawBlameRequest) Reset() { - *x = RawBlameRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[32] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RawBlameRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RawBlameRequest) ProtoMessage() {} - -func (x *RawBlameRequest) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[32] - 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 RawBlameRequest.ProtoReflect.Descriptor instead. -func (*RawBlameRequest) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{32} -} - -func (x *RawBlameRequest) GetRepository() *Repository { - if x != nil { - return x.Repository - } - return nil -} - -func (x *RawBlameRequest) GetRevision() []byte { - if x != nil { - return x.Revision - } - return nil -} - -func (x *RawBlameRequest) GetPath() []byte { - if x != nil { - return x.Path - } - return nil -} - -func (x *RawBlameRequest) GetRange() []byte { - if x != nil { - return x.Range - } - return nil -} - -type RawBlameResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` -} - -func (x *RawBlameResponse) Reset() { - *x = RawBlameResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[33] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RawBlameResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RawBlameResponse) ProtoMessage() {} - -func (x *RawBlameResponse) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[33] - 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 RawBlameResponse.ProtoReflect.Descriptor instead. -func (*RawBlameResponse) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{33} -} - -func (x *RawBlameResponse) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -type LastCommitForPathRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` - Revision []byte `protobuf:"bytes,2,opt,name=revision,proto3" json:"revision,omitempty"` - Path []byte `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` - LiteralPathspec bool `protobuf:"varint,4,opt,name=literal_pathspec,json=literalPathspec,proto3" json:"literal_pathspec,omitempty"` - GlobalOptions *GlobalOptions `protobuf:"bytes,5,opt,name=global_options,json=globalOptions,proto3" json:"global_options,omitempty"` -} - -func (x *LastCommitForPathRequest) Reset() { - *x = LastCommitForPathRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[34] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *LastCommitForPathRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LastCommitForPathRequest) ProtoMessage() {} - -func (x *LastCommitForPathRequest) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[34] - 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 LastCommitForPathRequest.ProtoReflect.Descriptor instead. -func (*LastCommitForPathRequest) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{34} -} - -func (x *LastCommitForPathRequest) GetRepository() *Repository { - if x != nil { - return x.Repository - } - return nil -} - -func (x *LastCommitForPathRequest) GetRevision() []byte { - if x != nil { - return x.Revision - } - return nil -} - -func (x *LastCommitForPathRequest) GetPath() []byte { - if x != nil { - return x.Path - } - return nil -} - -func (x *LastCommitForPathRequest) GetLiteralPathspec() bool { - if x != nil { - return x.LiteralPathspec - } - return false -} - -func (x *LastCommitForPathRequest) GetGlobalOptions() *GlobalOptions { - if x != nil { - return x.GlobalOptions - } - return nil -} - -type LastCommitForPathResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Commit *GitCommit `protobuf:"bytes,1,opt,name=commit,proto3" json:"commit,omitempty"` -} - -func (x *LastCommitForPathResponse) Reset() { - *x = LastCommitForPathResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[35] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *LastCommitForPathResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LastCommitForPathResponse) ProtoMessage() {} - -func (x *LastCommitForPathResponse) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[35] - 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 LastCommitForPathResponse.ProtoReflect.Descriptor instead. -func (*LastCommitForPathResponse) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{35} -} - -func (x *LastCommitForPathResponse) GetCommit() *GitCommit { - if x != nil { - return x.Commit - } - return nil -} - -type ListLastCommitsForTreeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` - Revision string `protobuf:"bytes,2,opt,name=revision,proto3" json:"revision,omitempty"` - Path []byte `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` - Limit int32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` - Offset int32 `protobuf:"varint,5,opt,name=offset,proto3" json:"offset,omitempty"` - // Deprecated: Marked as deprecated in commit.proto. - LiteralPathspec bool `protobuf:"varint,6,opt,name=literal_pathspec,json=literalPathspec,proto3" json:"literal_pathspec,omitempty"` - GlobalOptions *GlobalOptions `protobuf:"bytes,7,opt,name=global_options,json=globalOptions,proto3" json:"global_options,omitempty"` -} - -func (x *ListLastCommitsForTreeRequest) Reset() { - *x = ListLastCommitsForTreeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[36] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListLastCommitsForTreeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListLastCommitsForTreeRequest) ProtoMessage() {} - -func (x *ListLastCommitsForTreeRequest) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[36] - 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 ListLastCommitsForTreeRequest.ProtoReflect.Descriptor instead. -func (*ListLastCommitsForTreeRequest) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{36} -} - -func (x *ListLastCommitsForTreeRequest) GetRepository() *Repository { - if x != nil { - return x.Repository - } - return nil -} - -func (x *ListLastCommitsForTreeRequest) GetRevision() string { - if x != nil { - return x.Revision - } - return "" -} - -func (x *ListLastCommitsForTreeRequest) GetPath() []byte { - if x != nil { - return x.Path - } - return nil -} - -func (x *ListLastCommitsForTreeRequest) GetLimit() int32 { - if x != nil { - return x.Limit - } - return 0 -} - -func (x *ListLastCommitsForTreeRequest) GetOffset() int32 { - if x != nil { - return x.Offset - } - return 0 -} - -// Deprecated: Marked as deprecated in commit.proto. -func (x *ListLastCommitsForTreeRequest) GetLiteralPathspec() bool { - if x != nil { - return x.LiteralPathspec - } - return false -} - -func (x *ListLastCommitsForTreeRequest) GetGlobalOptions() *GlobalOptions { - if x != nil { - return x.GlobalOptions - } - return nil -} - -type ListLastCommitsForTreeResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Commits []*ListLastCommitsForTreeResponse_CommitForTree `protobuf:"bytes,1,rep,name=commits,proto3" json:"commits,omitempty"` -} - -func (x *ListLastCommitsForTreeResponse) Reset() { - *x = ListLastCommitsForTreeResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[37] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListLastCommitsForTreeResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListLastCommitsForTreeResponse) ProtoMessage() {} - -func (x *ListLastCommitsForTreeResponse) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[37] - 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 ListLastCommitsForTreeResponse.ProtoReflect.Descriptor instead. -func (*ListLastCommitsForTreeResponse) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{37} -} - -func (x *ListLastCommitsForTreeResponse) GetCommits() []*ListLastCommitsForTreeResponse_CommitForTree { - if x != nil { - return x.Commits - } - return nil -} - -type CommitsByMessageRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` - Revision []byte `protobuf:"bytes,2,opt,name=revision,proto3" json:"revision,omitempty"` - Offset int32 `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"` - Limit int32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` - Path []byte `protobuf:"bytes,5,opt,name=path,proto3" json:"path,omitempty"` - Query string `protobuf:"bytes,6,opt,name=query,proto3" json:"query,omitempty"` - GlobalOptions *GlobalOptions `protobuf:"bytes,7,opt,name=global_options,json=globalOptions,proto3" json:"global_options,omitempty"` -} - -func (x *CommitsByMessageRequest) Reset() { - *x = CommitsByMessageRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[38] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CommitsByMessageRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CommitsByMessageRequest) ProtoMessage() {} - -func (x *CommitsByMessageRequest) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[38] - 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 CommitsByMessageRequest.ProtoReflect.Descriptor instead. -func (*CommitsByMessageRequest) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{38} -} - -func (x *CommitsByMessageRequest) GetRepository() *Repository { - if x != nil { - return x.Repository - } - return nil -} - -func (x *CommitsByMessageRequest) GetRevision() []byte { - if x != nil { - return x.Revision - } - return nil -} - -func (x *CommitsByMessageRequest) GetOffset() int32 { - if x != nil { - return x.Offset - } - return 0 -} - -func (x *CommitsByMessageRequest) GetLimit() int32 { - if x != nil { - return x.Limit - } - return 0 -} - -func (x *CommitsByMessageRequest) GetPath() []byte { - if x != nil { - return x.Path - } - return nil -} - -func (x *CommitsByMessageRequest) GetQuery() string { - if x != nil { - return x.Query - } - return "" -} - -func (x *CommitsByMessageRequest) GetGlobalOptions() *GlobalOptions { - if x != nil { - return x.GlobalOptions - } - return nil -} - -type CommitsByMessageResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Commits []*GitCommit `protobuf:"bytes,1,rep,name=commits,proto3" json:"commits,omitempty"` -} - -func (x *CommitsByMessageResponse) Reset() { - *x = CommitsByMessageResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[39] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CommitsByMessageResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CommitsByMessageResponse) ProtoMessage() {} - -func (x *CommitsByMessageResponse) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[39] - 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 CommitsByMessageResponse.ProtoReflect.Descriptor instead. -func (*CommitsByMessageResponse) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{39} -} - -func (x *CommitsByMessageResponse) GetCommits() []*GitCommit { - if x != nil { - return x.Commits - } - return nil -} - -type FilterShasWithSignaturesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` - Shas [][]byte `protobuf:"bytes,2,rep,name=shas,proto3" json:"shas,omitempty"` -} - -func (x *FilterShasWithSignaturesRequest) Reset() { - *x = FilterShasWithSignaturesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[40] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FilterShasWithSignaturesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FilterShasWithSignaturesRequest) ProtoMessage() {} - -func (x *FilterShasWithSignaturesRequest) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[40] - 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 FilterShasWithSignaturesRequest.ProtoReflect.Descriptor instead. -func (*FilterShasWithSignaturesRequest) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{40} -} - -func (x *FilterShasWithSignaturesRequest) GetRepository() *Repository { - if x != nil { - return x.Repository - } - return nil -} - -func (x *FilterShasWithSignaturesRequest) GetShas() [][]byte { - if x != nil { - return x.Shas - } - return nil -} - -type FilterShasWithSignaturesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Shas [][]byte `protobuf:"bytes,1,rep,name=shas,proto3" json:"shas,omitempty"` -} - -func (x *FilterShasWithSignaturesResponse) Reset() { - *x = FilterShasWithSignaturesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[41] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FilterShasWithSignaturesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FilterShasWithSignaturesResponse) ProtoMessage() {} - -func (x *FilterShasWithSignaturesResponse) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[41] - 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 FilterShasWithSignaturesResponse.ProtoReflect.Descriptor instead. -func (*FilterShasWithSignaturesResponse) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{41} -} - -func (x *FilterShasWithSignaturesResponse) GetShas() [][]byte { - if x != nil { - return x.Shas - } - return nil -} - -type ExtractCommitSignatureRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` - CommitId string `protobuf:"bytes,2,opt,name=commit_id,json=commitId,proto3" json:"commit_id,omitempty"` -} - -func (x *ExtractCommitSignatureRequest) Reset() { - *x = ExtractCommitSignatureRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[42] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExtractCommitSignatureRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExtractCommitSignatureRequest) ProtoMessage() {} - -func (x *ExtractCommitSignatureRequest) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[42] - 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 ExtractCommitSignatureRequest.ProtoReflect.Descriptor instead. -func (*ExtractCommitSignatureRequest) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{42} -} - -func (x *ExtractCommitSignatureRequest) GetRepository() *Repository { - if x != nil { - return x.Repository - } - return nil -} - -func (x *ExtractCommitSignatureRequest) GetCommitId() string { - if x != nil { - return x.CommitId - } - return "" -} - -type ExtractCommitSignatureResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Signature []byte `protobuf:"bytes,1,opt,name=signature,proto3" json:"signature,omitempty"` - SignedText []byte `protobuf:"bytes,2,opt,name=signed_text,json=signedText,proto3" json:"signed_text,omitempty"` -} - -func (x *ExtractCommitSignatureResponse) Reset() { - *x = ExtractCommitSignatureResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[43] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExtractCommitSignatureResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExtractCommitSignatureResponse) ProtoMessage() {} - -func (x *ExtractCommitSignatureResponse) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[43] - 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 ExtractCommitSignatureResponse.ProtoReflect.Descriptor instead. -func (*ExtractCommitSignatureResponse) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{43} -} - -func (x *ExtractCommitSignatureResponse) GetSignature() []byte { - if x != nil { - return x.Signature - } - return nil -} - -func (x *ExtractCommitSignatureResponse) GetSignedText() []byte { - if x != nil { - return x.SignedText - } - return nil -} - -type GetCommitSignaturesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` - CommitIds []string `protobuf:"bytes,2,rep,name=commit_ids,json=commitIds,proto3" json:"commit_ids,omitempty"` -} - -func (x *GetCommitSignaturesRequest) Reset() { - *x = GetCommitSignaturesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[44] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetCommitSignaturesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetCommitSignaturesRequest) ProtoMessage() {} - -func (x *GetCommitSignaturesRequest) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[44] - 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 GetCommitSignaturesRequest.ProtoReflect.Descriptor instead. -func (*GetCommitSignaturesRequest) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{44} -} - -func (x *GetCommitSignaturesRequest) GetRepository() *Repository { - if x != nil { - return x.Repository - } - return nil -} - -func (x *GetCommitSignaturesRequest) GetCommitIds() []string { - if x != nil { - return x.CommitIds - } - return nil -} - -type GetCommitSignaturesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - CommitId string `protobuf:"bytes,1,opt,name=commit_id,json=commitId,proto3" json:"commit_id,omitempty"` - Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` - SignedText []byte `protobuf:"bytes,3,opt,name=signed_text,json=signedText,proto3" json:"signed_text,omitempty"` - Signer GetCommitSignaturesResponse_Signer `protobuf:"varint,4,opt,name=signer,proto3,enum=gitaly.GetCommitSignaturesResponse_Signer" json:"signer,omitempty"` -} - -func (x *GetCommitSignaturesResponse) Reset() { - *x = GetCommitSignaturesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[45] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetCommitSignaturesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetCommitSignaturesResponse) ProtoMessage() {} - -func (x *GetCommitSignaturesResponse) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[45] - 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 GetCommitSignaturesResponse.ProtoReflect.Descriptor instead. -func (*GetCommitSignaturesResponse) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{45} -} - -func (x *GetCommitSignaturesResponse) GetCommitId() string { - if x != nil { - return x.CommitId - } - return "" -} - -func (x *GetCommitSignaturesResponse) GetSignature() []byte { - if x != nil { - return x.Signature - } - return nil -} - -func (x *GetCommitSignaturesResponse) GetSignedText() []byte { - if x != nil { - return x.SignedText - } - return nil -} - -func (x *GetCommitSignaturesResponse) GetSigner() GetCommitSignaturesResponse_Signer { - if x != nil { - return x.Signer - } - return GetCommitSignaturesResponse_SIGNER_UNSPECIFIED -} - -type GetCommitMessagesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` - CommitIds []string `protobuf:"bytes,2,rep,name=commit_ids,json=commitIds,proto3" json:"commit_ids,omitempty"` -} - -func (x *GetCommitMessagesRequest) Reset() { - *x = GetCommitMessagesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[46] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetCommitMessagesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetCommitMessagesRequest) ProtoMessage() {} - -func (x *GetCommitMessagesRequest) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[46] - 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 GetCommitMessagesRequest.ProtoReflect.Descriptor instead. -func (*GetCommitMessagesRequest) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{46} -} - -func (x *GetCommitMessagesRequest) GetRepository() *Repository { - if x != nil { - return x.Repository - } - return nil -} - -func (x *GetCommitMessagesRequest) GetCommitIds() []string { - if x != nil { - return x.CommitIds - } - return nil -} - -type GetCommitMessagesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - CommitId string `protobuf:"bytes,1,opt,name=commit_id,json=commitId,proto3" json:"commit_id,omitempty"` - Message []byte `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` -} - -func (x *GetCommitMessagesResponse) Reset() { - *x = GetCommitMessagesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[47] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetCommitMessagesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetCommitMessagesResponse) ProtoMessage() {} - -func (x *GetCommitMessagesResponse) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[47] - 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 GetCommitMessagesResponse.ProtoReflect.Descriptor instead. -func (*GetCommitMessagesResponse) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{47} -} - -func (x *GetCommitMessagesResponse) GetCommitId() string { - if x != nil { - return x.CommitId - } - return "" -} - -func (x *GetCommitMessagesResponse) GetMessage() []byte { - if x != nil { - return x.Message - } - return nil -} - -type CheckObjectsExistRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` - Revisions [][]byte `protobuf:"bytes,2,rep,name=revisions,proto3" json:"revisions,omitempty"` -} - -func (x *CheckObjectsExistRequest) Reset() { - *x = CheckObjectsExistRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[48] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CheckObjectsExistRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CheckObjectsExistRequest) ProtoMessage() {} - -func (x *CheckObjectsExistRequest) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[48] - 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 CheckObjectsExistRequest.ProtoReflect.Descriptor instead. -func (*CheckObjectsExistRequest) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{48} -} - -func (x *CheckObjectsExistRequest) GetRepository() *Repository { - if x != nil { - return x.Repository - } - return nil -} - -func (x *CheckObjectsExistRequest) GetRevisions() [][]byte { - if x != nil { - return x.Revisions - } - return nil -} - -type CheckObjectsExistResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Revisions []*CheckObjectsExistResponse_RevisionExistence `protobuf:"bytes,1,rep,name=revisions,proto3" json:"revisions,omitempty"` -} - -func (x *CheckObjectsExistResponse) Reset() { - *x = CheckObjectsExistResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[49] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CheckObjectsExistResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CheckObjectsExistResponse) ProtoMessage() {} - -func (x *CheckObjectsExistResponse) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[49] - 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 CheckObjectsExistResponse.ProtoReflect.Descriptor instead. -func (*CheckObjectsExistResponse) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{49} -} - -func (x *CheckObjectsExistResponse) GetRevisions() []*CheckObjectsExistResponse_RevisionExistence { - if x != nil { - return x.Revisions - } - return nil -} - -type ListCommitsByRefNameResponse_CommitForRef struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Commit *GitCommit `protobuf:"bytes,1,opt,name=commit,proto3" json:"commit,omitempty"` - RefName []byte `protobuf:"bytes,2,opt,name=ref_name,json=refName,proto3" json:"ref_name,omitempty"` -} - -func (x *ListCommitsByRefNameResponse_CommitForRef) Reset() { - *x = ListCommitsByRefNameResponse_CommitForRef{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[50] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListCommitsByRefNameResponse_CommitForRef) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListCommitsByRefNameResponse_CommitForRef) ProtoMessage() {} - -func (x *ListCommitsByRefNameResponse_CommitForRef) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[50] - 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 ListCommitsByRefNameResponse_CommitForRef.ProtoReflect.Descriptor instead. -func (*ListCommitsByRefNameResponse_CommitForRef) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{25, 0} -} - -func (x *ListCommitsByRefNameResponse_CommitForRef) GetCommit() *GitCommit { - if x != nil { - return x.Commit - } - return nil -} - -func (x *ListCommitsByRefNameResponse_CommitForRef) GetRefName() []byte { - if x != nil { - return x.RefName - } - return nil -} - -type CommitLanguagesResponse_Language struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Share float32 `protobuf:"fixed32,2,opt,name=share,proto3" json:"share,omitempty"` - Color string `protobuf:"bytes,3,opt,name=color,proto3" json:"color,omitempty"` - Bytes uint64 `protobuf:"varint,5,opt,name=bytes,proto3" json:"bytes,omitempty"` -} - -func (x *CommitLanguagesResponse_Language) Reset() { - *x = CommitLanguagesResponse_Language{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[51] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CommitLanguagesResponse_Language) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CommitLanguagesResponse_Language) ProtoMessage() {} - -func (x *CommitLanguagesResponse_Language) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[51] - 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 CommitLanguagesResponse_Language.ProtoReflect.Descriptor instead. -func (*CommitLanguagesResponse_Language) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{31, 0} -} - -func (x *CommitLanguagesResponse_Language) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *CommitLanguagesResponse_Language) GetShare() float32 { - if x != nil { - return x.Share - } - return 0 -} - -func (x *CommitLanguagesResponse_Language) GetColor() string { - if x != nil { - return x.Color - } - return "" -} - -func (x *CommitLanguagesResponse_Language) GetBytes() uint64 { - if x != nil { - return x.Bytes - } - return 0 -} - -type ListLastCommitsForTreeResponse_CommitForTree struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Commit *GitCommit `protobuf:"bytes,2,opt,name=commit,proto3" json:"commit,omitempty"` - PathBytes []byte `protobuf:"bytes,4,opt,name=path_bytes,json=pathBytes,proto3" json:"path_bytes,omitempty"` -} - -func (x *ListLastCommitsForTreeResponse_CommitForTree) Reset() { - *x = ListLastCommitsForTreeResponse_CommitForTree{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[52] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListLastCommitsForTreeResponse_CommitForTree) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListLastCommitsForTreeResponse_CommitForTree) ProtoMessage() {} - -func (x *ListLastCommitsForTreeResponse_CommitForTree) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[52] - 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 ListLastCommitsForTreeResponse_CommitForTree.ProtoReflect.Descriptor instead. -func (*ListLastCommitsForTreeResponse_CommitForTree) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{37, 0} -} - -func (x *ListLastCommitsForTreeResponse_CommitForTree) GetCommit() *GitCommit { - if x != nil { - return x.Commit - } - return nil -} - -func (x *ListLastCommitsForTreeResponse_CommitForTree) GetPathBytes() []byte { - if x != nil { - return x.PathBytes - } - return nil -} - -type CheckObjectsExistResponse_RevisionExistence struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Exists bool `protobuf:"varint,2,opt,name=exists,proto3" json:"exists,omitempty"` -} - -func (x *CheckObjectsExistResponse_RevisionExistence) Reset() { - *x = CheckObjectsExistResponse_RevisionExistence{} - if protoimpl.UnsafeEnabled { - mi := &file_commit_proto_msgTypes[53] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CheckObjectsExistResponse_RevisionExistence) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CheckObjectsExistResponse_RevisionExistence) ProtoMessage() {} - -func (x *CheckObjectsExistResponse_RevisionExistence) ProtoReflect() protoreflect.Message { - mi := &file_commit_proto_msgTypes[53] - 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 CheckObjectsExistResponse_RevisionExistence.ProtoReflect.Descriptor instead. -func (*CheckObjectsExistResponse_RevisionExistence) Descriptor() ([]byte, []int) { - return file_commit_proto_rawDescGZIP(), []int{49, 0} -} - -func (x *CheckObjectsExistResponse_RevisionExistence) GetName() []byte { - if x != nil { - return x.Name - } - return nil -} - -func (x *CheckObjectsExistResponse_RevisionExistence) GetExists() bool { - if x != nil { - return x.Exists - } - return false -} - -var File_commit_proto protoreflect.FileDescriptor - -var file_commit_proto_rawDesc = []byte{ - 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, - 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x1a, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 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, - 0xed, 0x04, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 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, 0x42, 0x04, - 0x98, 0xc6, 0x2c, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, - 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x48, - 0x0a, 0x11, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x69, 0x74, 0x61, - 0x6c, 0x79, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x52, 0x10, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, - 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, - 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x61, - 0x78, 0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x0a, 0x6d, 0x61, 0x78, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x64, - 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x77, 0x61, 0x6c, 0x6b, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x57, 0x61, 0x6c, 0x6b, 0x12, 0x21, - 0x0a, 0x0c, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x66, 0x69, 0x72, 0x73, 0x74, 0x50, 0x61, 0x72, 0x65, 0x6e, - 0x74, 0x12, 0x30, 0x0a, 0x05, 0x61, 0x66, 0x74, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x05, 0x61, 0x66, - 0x74, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x06, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x18, 0x09, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x06, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, - 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x12, - 0x1f, 0x0a, 0x0b, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x5f, 0x63, 0x61, 0x73, 0x65, 0x18, 0x0c, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x43, 0x61, 0x73, 0x65, - 0x12, 0x36, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, - 0x0c, 0x52, 0x15, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x50, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x73, 0x22, 0x25, 0x0a, 0x05, 0x4f, 0x72, 0x64, 0x65, - 0x72, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x54, - 0x4f, 0x50, 0x4f, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x41, 0x54, 0x45, 0x10, 0x02, 0x22, - 0x42, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, - 0x2e, 0x47, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x73, 0x22, 0x9b, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x43, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 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, 0x42, 0x04, 0x98, 0xc6, 0x2c, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x48, 0x0a, 0x11, 0x70, 0x61, 0x67, 0x69, 0x6e, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x50, 0x61, 0x67, 0x69, - 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x52, - 0x10, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x22, 0x45, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x07, 0x63, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, - 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x47, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, - 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x22, 0x6a, 0x0a, 0x12, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, - 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, 0x42, 0x04, 0x98, 0xc6, 0x2c, 0x01, 0x52, 0x0a, 0x72, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, - 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x63, 0x0a, 0x13, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x53, 0x74, - 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6f, 0x69, 0x64, 0x12, 0x1c, 0x0a, - 0x09, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x09, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x64, - 0x65, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, - 0x64, 0x65, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x8f, 0x01, 0x0a, 0x17, 0x43, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x73, 0x41, 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 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, 0x42, 0x04, 0x98, - 0xc6, 0x2c, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, - 0x1f, 0x0a, 0x0b, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x49, 0x64, - 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x49, 0x64, 0x22, 0x30, 0x0a, 0x18, 0x43, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x73, 0x41, 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xad, 0x01, - 0x0a, 0x10, 0x54, 0x72, 0x65, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x38, 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, 0x42, 0x04, 0x98, 0xc6, 0x2c, 0x01, - 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1a, 0x0a, 0x08, - 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, - 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x14, 0x0a, 0x05, - 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, - 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x61, 0x78, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x53, 0x69, 0x7a, 0x65, 0x22, 0xd2, 0x01, - 0x0a, 0x11, 0x54, 0x72, 0x65, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x54, 0x72, 0x65, 0x65, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, - 0x03, 0x6f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6f, 0x69, 0x64, 0x12, - 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, - 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x35, 0x0a, 0x0a, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x4f, 0x4d, - 0x4d, 0x49, 0x54, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x42, 0x4c, 0x4f, 0x42, 0x10, 0x01, 0x12, - 0x08, 0x0a, 0x04, 0x54, 0x52, 0x45, 0x45, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x41, 0x47, - 0x10, 0x03, 0x22, 0xf5, 0x02, 0x0a, 0x13, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 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, 0x42, 0x04, 0x98, 0xc6, 0x2c, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, - 0x12, 0x30, 0x0a, 0x05, 0x61, 0x66, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x05, 0x61, 0x66, 0x74, - 0x65, 0x72, 0x12, 0x32, 0x0a, 0x06, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x06, - 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, - 0x78, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6d, - 0x61, 0x78, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x6c, 0x6c, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x69, 0x72, - 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0b, 0x66, 0x69, 0x72, 0x73, 0x74, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x3c, 0x0a, 0x0e, - 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x09, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x47, 0x6c, - 0x6f, 0x62, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0d, 0x67, 0x6c, 0x6f, - 0x62, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x2c, 0x0a, 0x14, 0x43, 0x6f, - 0x75, 0x6e, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xab, 0x01, 0x0a, 0x1c, 0x43, 0x6f, 0x75, - 0x6e, 0x74, 0x44, 0x69, 0x76, 0x65, 0x72, 0x67, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 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, 0x42, 0x04, 0x98, 0xc6, 0x2c, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x6f, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x02, 0x74, 0x6f, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x43, - 0x6f, 0x75, 0x6e, 0x74, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, - 0x4a, 0x04, 0x08, 0x06, 0x10, 0x07, 0x22, 0x5f, 0x0a, 0x1d, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x44, - 0x69, 0x76, 0x65, 0x72, 0x67, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x65, 0x66, 0x74, 0x5f, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6c, 0x65, 0x66, - 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x69, 0x67, 0x68, 0x74, 0x5f, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, 0x69, 0x67, - 0x68, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xef, 0x01, 0x0a, 0x09, 0x54, 0x72, 0x65, 0x65, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6f, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x2f, 0x0a, 0x04, 0x74, - 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x67, 0x69, 0x74, 0x61, - 0x6c, 0x79, 0x2e, 0x54, 0x72, 0x65, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, - 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, - 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x6f, 0x69, 0x64, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4f, 0x69, 0x64, 0x12, - 0x1b, 0x0a, 0x09, 0x66, 0x6c, 0x61, 0x74, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x08, 0x66, 0x6c, 0x61, 0x74, 0x50, 0x61, 0x74, 0x68, 0x22, 0x2b, 0x0a, 0x09, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x42, 0x4c, 0x4f, - 0x42, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x54, 0x52, 0x45, 0x45, 0x10, 0x01, 0x12, 0x0a, 0x0a, - 0x06, 0x43, 0x4f, 0x4d, 0x4d, 0x49, 0x54, 0x10, 0x03, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x52, - 0x08, 0x72, 0x6f, 0x6f, 0x74, 0x5f, 0x6f, 0x69, 0x64, 0x22, 0xf3, 0x02, 0x0a, 0x15, 0x47, 0x65, - 0x74, 0x54, 0x72, 0x65, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x38, 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, 0x42, 0x04, 0x98, 0xc6, 0x2c, - 0x01, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1a, 0x0a, - 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, - 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x1c, 0x0a, - 0x09, 0x72, 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x09, 0x72, 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65, 0x12, 0x38, 0x0a, 0x04, 0x73, - 0x6f, 0x72, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x69, 0x74, 0x61, - 0x6c, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x72, 0x65, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x42, 0x79, 0x52, - 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x48, 0x0a, 0x11, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1b, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x52, 0x10, 0x70, - 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, - 0x26, 0x0a, 0x0f, 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x66, 0x6c, 0x61, 0x74, 0x5f, 0x70, 0x61, 0x74, - 0x68, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x73, 0x6b, 0x69, 0x70, 0x46, 0x6c, - 0x61, 0x74, 0x50, 0x61, 0x74, 0x68, 0x73, 0x22, 0x26, 0x0a, 0x06, 0x53, 0x6f, 0x72, 0x74, 0x42, - 0x79, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x00, 0x12, 0x0f, - 0x0a, 0x0b, 0x54, 0x52, 0x45, 0x45, 0x53, 0x5f, 0x46, 0x49, 0x52, 0x53, 0x54, 0x10, 0x01, 0x22, - 0x8c, 0x01, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x54, 0x72, 0x65, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x69, - 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x07, 0x65, 0x6e, - 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x69, - 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x54, 0x72, 0x65, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, - 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x45, 0x0a, 0x11, 0x70, 0x61, 0x67, 0x69, 0x6e, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x50, 0x61, 0x67, 0x69, - 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x52, 0x10, 0x70, 0x61, - 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x22, 0x8a, - 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x54, 0x72, 0x65, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, - 0x73, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x41, 0x0a, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, - 0x65, 0x5f, 0x74, 0x72, 0x65, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, - 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x52, 0x65, 0x76, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x48, 0x00, 0x52, 0x0b, 0x72, 0x65, - 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x54, 0x72, 0x65, 0x65, 0x12, 0x27, 0x0a, 0x04, 0x70, 0x61, 0x74, - 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, - 0x2e, 0x50, 0x61, 0x74, 0x68, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x48, 0x00, 0x52, 0x04, 0x70, 0x61, - 0x74, 0x68, 0x42, 0x07, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x68, 0x0a, 0x10, 0x4c, - 0x69, 0x73, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x38, 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, 0x42, 0x04, 0x98, 0xc6, 0x2c, 0x01, 0x52, 0x0a, 0x72, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x72, 0x65, 0x76, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x29, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x69, 0x6c, - 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61, - 0x74, 0x68, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x05, 0x70, 0x61, 0x74, 0x68, 0x73, - 0x22, 0x85, 0x01, 0x0a, 0x11, 0x46, 0x69, 0x6e, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 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, 0x42, 0x04, - 0x98, 0xc6, 0x2c, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, - 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, - 0x74, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, - 0x74, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x22, 0x3f, 0x0a, 0x12, 0x46, 0x69, 0x6e, 0x64, - 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, - 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, - 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x47, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x22, 0x65, 0x0a, 0x17, 0x4c, 0x69, 0x73, - 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x42, 0x79, 0x4f, 0x69, 0x64, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 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, 0x42, 0x04, 0x98, 0xc6, - 0x2c, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x10, - 0x0a, 0x03, 0x6f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x6f, 0x69, 0x64, - 0x22, 0x47, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x42, - 0x79, 0x4f, 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x07, - 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, - 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x47, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x22, 0x74, 0x0a, 0x1b, 0x4c, 0x69, 0x73, - 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x42, 0x79, 0x52, 0x65, 0x66, 0x4e, 0x61, 0x6d, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 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, - 0x42, 0x04, 0x98, 0xc6, 0x2c, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x08, 0x72, 0x65, 0x66, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x22, - 0xce, 0x01, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x42, - 0x79, 0x52, 0x65, 0x66, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x52, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x66, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x42, 0x79, 0x52, 0x65, 0x66, 0x4e, - 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x46, 0x6f, 0x72, 0x52, 0x65, 0x66, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x52, 0x65, 0x66, 0x73, 0x1a, 0x54, 0x0a, 0x0c, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x46, 0x6f, - 0x72, 0x52, 0x65, 0x66, 0x12, 0x29, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x47, 0x69, - 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, - 0x19, 0x0a, 0x08, 0x72, 0x65, 0x66, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x07, 0x72, 0x65, 0x66, 0x4e, 0x61, 0x6d, 0x65, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, - 0x22, 0x80, 0x02, 0x0a, 0x15, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 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, 0x42, 0x04, 0x98, 0xc6, 0x2c, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, - 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x12, 0x0a, - 0x04, 0x73, 0x6b, 0x69, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x6b, 0x69, - 0x70, 0x12, 0x39, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x23, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, - 0x6c, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, - 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x22, 0x25, 0x0a, 0x05, - 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, - 0x08, 0x0a, 0x04, 0x54, 0x4f, 0x50, 0x4f, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x41, 0x54, - 0x45, 0x10, 0x02, 0x22, 0x45, 0x0a, 0x16, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x43, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, - 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, - 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x47, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x22, 0xcd, 0x05, 0x0a, 0x12, 0x46, - 0x69, 0x6e, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x38, 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, 0x42, 0x04, 0x98, 0xc6, 0x2c, 0x01, 0x52, - 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x72, - 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x72, - 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, - 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6f, - 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61, 0x74, 0x68, 0x73, 0x18, 0x05, - 0x20, 0x03, 0x28, 0x0c, 0x52, 0x05, 0x70, 0x61, 0x74, 0x68, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x66, - 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x66, 0x6f, 0x6c, - 0x6c, 0x6f, 0x77, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x6d, 0x65, 0x72, 0x67, - 0x65, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x73, 0x6b, 0x69, 0x70, 0x4d, 0x65, - 0x72, 0x67, 0x65, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, - 0x77, 0x61, 0x6c, 0x6b, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x61, - 0x62, 0x6c, 0x65, 0x57, 0x61, 0x6c, 0x6b, 0x12, 0x30, 0x0a, 0x05, 0x61, 0x66, 0x74, 0x65, 0x72, - 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x52, 0x05, 0x61, 0x66, 0x74, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x06, 0x62, 0x65, 0x66, - 0x6f, 0x72, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x06, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x12, 0x10, 0x0a, - 0x03, 0x61, 0x6c, 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x12, - 0x21, 0x0a, 0x0c, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, - 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x66, 0x69, 0x72, 0x73, 0x74, 0x50, 0x61, 0x72, 0x65, - 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x0d, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x12, 0x36, 0x0a, 0x05, 0x6f, 0x72, - 0x64, 0x65, 0x72, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x67, 0x69, 0x74, 0x61, - 0x6c, 0x79, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x72, 0x64, - 0x65, 0x72, 0x12, 0x3c, 0x0a, 0x0e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x5f, 0x6f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x67, 0x69, 0x74, - 0x61, 0x6c, 0x79, 0x2e, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x52, 0x0d, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x18, 0x10, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x08, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x12, 0x2b, 0x0a, 0x11, - 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x73, 0x74, 0x61, - 0x74, 0x18, 0x11, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, - 0x53, 0x68, 0x6f, 0x72, 0x74, 0x73, 0x74, 0x61, 0x74, 0x12, 0x32, 0x0a, 0x15, 0x69, 0x6e, 0x63, - 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x64, 0x5f, - 0x62, 0x79, 0x18, 0x12, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x13, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, - 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x64, 0x42, 0x79, 0x22, 0x1b, 0x0a, - 0x05, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, - 0x12, 0x08, 0x0a, 0x04, 0x54, 0x4f, 0x50, 0x4f, 0x10, 0x01, 0x22, 0x42, 0x0a, 0x13, 0x46, 0x69, - 0x6e, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x2b, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x47, 0x69, 0x74, 0x43, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x22, 0x6e, - 0x0a, 0x16, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 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, - 0x42, 0x04, 0x98, 0xc6, 0x2c, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xd5, - 0x01, 0x0a, 0x17, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, - 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x09, 0x6c, 0x61, - 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, - 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4c, 0x61, 0x6e, - 0x67, 0x75, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4c, - 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x52, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, - 0x65, 0x73, 0x1a, 0x72, 0x0a, 0x08, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x68, 0x61, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x02, 0x52, 0x05, 0x73, 0x68, 0x61, 0x72, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x6c, 0x6f, - 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x14, - 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x62, - 0x79, 0x74, 0x65, 0x73, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x52, 0x0a, 0x66, 0x69, 0x6c, 0x65, - 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x91, 0x01, 0x0a, 0x0f, 0x52, 0x61, 0x77, 0x42, 0x6c, - 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 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, 0x42, 0x04, 0x98, 0xc6, 0x2c, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, - 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, - 0x70, 0x61, 0x74, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x22, 0x26, 0x0a, 0x10, 0x52, 0x61, - 0x77, 0x42, 0x6c, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, - 0x74, 0x61, 0x22, 0xed, 0x01, 0x0a, 0x18, 0x4c, 0x61, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x46, 0x6f, 0x72, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x38, 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, 0x42, 0x04, 0x98, 0xc6, 0x2c, 0x01, 0x52, 0x0a, 0x72, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x72, 0x65, 0x76, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x29, 0x0a, 0x10, 0x6c, 0x69, 0x74, - 0x65, 0x72, 0x61, 0x6c, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x73, 0x70, 0x65, 0x63, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x0f, 0x6c, 0x69, 0x74, 0x65, 0x72, 0x61, 0x6c, 0x50, 0x61, 0x74, 0x68, - 0x73, 0x70, 0x65, 0x63, 0x12, 0x3c, 0x0a, 0x0e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x5f, 0x6f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x67, - 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x0d, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x22, 0x46, 0x0a, 0x19, 0x4c, 0x61, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x46, 0x6f, 0x72, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x29, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x11, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x47, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x22, 0xa4, 0x02, 0x0a, 0x1d, 0x4c, - 0x69, 0x73, 0x74, 0x4c, 0x61, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x46, 0x6f, - 0x72, 0x54, 0x72, 0x65, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 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, 0x42, 0x04, 0x98, 0xc6, 0x2c, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, - 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, - 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, - 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6f, 0x66, - 0x66, 0x73, 0x65, 0x74, 0x12, 0x2d, 0x0a, 0x10, 0x6c, 0x69, 0x74, 0x65, 0x72, 0x61, 0x6c, 0x5f, - 0x70, 0x61, 0x74, 0x68, 0x73, 0x70, 0x65, 0x63, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x42, 0x02, - 0x18, 0x01, 0x52, 0x0f, 0x6c, 0x69, 0x74, 0x65, 0x72, 0x61, 0x6c, 0x50, 0x61, 0x74, 0x68, 0x73, - 0x70, 0x65, 0x63, 0x12, 0x3c, 0x0a, 0x0e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x5f, 0x6f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x67, 0x69, - 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x52, 0x0d, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x22, 0xd7, 0x01, 0x0a, 0x1e, 0x4c, 0x69, 0x73, 0x74, 0x4c, 0x61, 0x73, 0x74, 0x43, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x46, 0x6f, 0x72, 0x54, 0x72, 0x65, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x4c, 0x61, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x46, 0x6f, - 0x72, 0x54, 0x72, 0x65, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x46, 0x6f, 0x72, 0x54, 0x72, 0x65, 0x65, 0x52, 0x07, 0x63, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x73, 0x1a, 0x65, 0x0a, 0x0d, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x46, 0x6f, - 0x72, 0x54, 0x72, 0x65, 0x65, 0x12, 0x29, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x47, - 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x74, 0x68, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x61, 0x74, 0x68, 0x42, 0x79, 0x74, 0x65, 0x73, 0x4a, - 0x04, 0x08, 0x01, 0x10, 0x02, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x22, 0x85, 0x02, 0x0a, 0x17, - 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x42, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 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, 0x42, - 0x04, 0x98, 0xc6, 0x2c, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, - 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, - 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6f, - 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, - 0x61, 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, - 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x3c, 0x0a, 0x0e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x5f, - 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, - 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0d, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x22, 0x47, 0x0a, 0x18, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x42, 0x79, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x2b, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x11, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x47, 0x69, 0x74, 0x43, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x22, 0x6f, 0x0a, 0x1f, - 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x53, 0x68, 0x61, 0x73, 0x57, 0x69, 0x74, 0x68, 0x53, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x38, 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, 0x42, 0x04, 0x98, 0xc6, 0x2c, 0x01, 0x52, 0x0a, 0x72, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x68, 0x61, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x04, 0x73, 0x68, 0x61, 0x73, 0x22, 0x36, 0x0a, - 0x20, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x53, 0x68, 0x61, 0x73, 0x57, 0x69, 0x74, 0x68, 0x53, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x68, 0x61, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, - 0x04, 0x73, 0x68, 0x61, 0x73, 0x22, 0x76, 0x0a, 0x1d, 0x45, 0x78, 0x74, 0x72, 0x61, 0x63, 0x74, - 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 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, 0x42, 0x04, - 0x98, 0xc6, 0x2c, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, - 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x64, 0x22, 0x5f, 0x0a, - 0x1e, 0x45, 0x78, 0x74, 0x72, 0x61, 0x63, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x53, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x1f, 0x0a, - 0x0b, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x54, 0x65, 0x78, 0x74, 0x22, 0x75, - 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 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, 0x42, 0x04, 0x98, 0xc6, 0x2c, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x49, 0x64, 0x73, 0x22, 0x83, 0x02, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x54, 0x65, 0x78, - 0x74, 0x12, 0x42, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x2a, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x52, 0x06, 0x73, - 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x44, 0x0a, 0x06, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, - 0x16, 0x0a, 0x12, 0x53, 0x49, 0x47, 0x4e, 0x45, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, - 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x49, 0x47, 0x4e, 0x45, - 0x52, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x49, 0x47, 0x4e, - 0x45, 0x52, 0x5f, 0x53, 0x59, 0x53, 0x54, 0x45, 0x4d, 0x10, 0x02, 0x22, 0x73, 0x0a, 0x18, 0x47, - 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 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, 0x42, - 0x04, 0x98, 0xc6, 0x2c, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, - 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x69, 0x64, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x64, 0x73, - 0x22, 0x52, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, - 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x22, 0x72, 0x0a, 0x18, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x4f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x73, 0x45, 0x78, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x38, 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, 0x42, 0x04, 0x98, 0xc6, 0x2c, 0x01, 0x52, 0x0a, - 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, - 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x09, 0x72, - 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xaf, 0x01, 0x0a, 0x19, 0x43, 0x68, 0x65, - 0x63, 0x6b, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x45, 0x78, 0x69, 0x73, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x09, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x67, 0x69, 0x74, 0x61, - 0x6c, 0x79, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x45, - 0x78, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x76, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x09, - 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x3f, 0x0a, 0x11, 0x52, 0x65, 0x76, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x32, 0xf1, 0x10, 0x0a, 0x0d, 0x43, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x50, 0x0a, 0x0b, - 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x1a, 0x2e, 0x67, 0x69, - 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x02, 0x30, 0x01, 0x12, 0x59, - 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, - 0x12, 0x1d, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, - 0x6c, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1e, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x6c, - 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x02, 0x30, 0x01, 0x12, 0x5d, 0x0a, 0x10, 0x43, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x49, 0x73, 0x41, 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x12, 0x1f, 0x2e, - 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x73, 0x41, - 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, - 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x73, - 0x41, 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x02, 0x12, 0x4a, 0x0a, 0x09, 0x54, 0x72, 0x65, 0x65, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x18, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x54, - 0x72, 0x65, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x19, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x54, 0x72, 0x65, 0x65, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, - 0x08, 0x02, 0x30, 0x01, 0x12, 0x51, 0x0a, 0x0c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x43, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x73, 0x12, 0x1b, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x43, 0x6f, - 0x75, 0x6e, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x1c, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, - 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x02, 0x12, 0x6c, 0x0a, 0x15, 0x43, 0x6f, 0x75, 0x6e, 0x74, - 0x44, 0x69, 0x76, 0x65, 0x72, 0x67, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, - 0x12, 0x24, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x44, - 0x69, 0x76, 0x65, 0x72, 0x67, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, - 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x44, 0x69, 0x76, 0x65, 0x72, 0x67, 0x69, 0x6e, 0x67, 0x43, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, - 0x97, 0x28, 0x02, 0x08, 0x02, 0x12, 0x59, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x54, 0x72, 0x65, 0x65, - 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x1d, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, - 0x2e, 0x47, 0x65, 0x74, 0x54, 0x72, 0x65, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, - 0x47, 0x65, 0x74, 0x54, 0x72, 0x65, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x02, 0x30, 0x01, - 0x12, 0x4a, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x18, 0x2e, - 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x02, 0x30, 0x01, 0x12, 0x4b, 0x0a, 0x0a, - 0x46, 0x69, 0x6e, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x2e, 0x67, 0x69, 0x74, - 0x61, 0x6c, 0x79, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x46, - 0x69, 0x6e, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x02, 0x12, 0x4e, 0x0a, 0x0b, 0x43, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x1a, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, - 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x43, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x02, 0x12, 0x59, 0x0a, 0x0e, 0x46, 0x69, 0x6e, - 0x64, 0x41, 0x6c, 0x6c, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x1d, 0x2e, 0x67, 0x69, - 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x67, 0x69, 0x74, - 0x61, 0x6c, 0x79, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x43, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, - 0x08, 0x02, 0x30, 0x01, 0x12, 0x50, 0x0a, 0x0b, 0x46, 0x69, 0x6e, 0x64, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x73, 0x12, 0x1a, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x46, 0x69, 0x6e, - 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1b, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x43, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, - 0x28, 0x02, 0x08, 0x02, 0x30, 0x01, 0x12, 0x5a, 0x0a, 0x0f, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x73, 0x12, 0x1e, 0x2e, 0x67, 0x69, 0x74, 0x61, - 0x6c, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, - 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x67, 0x69, 0x74, 0x61, - 0x6c, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, - 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, - 0x08, 0x02, 0x12, 0x47, 0x0a, 0x08, 0x52, 0x61, 0x77, 0x42, 0x6c, 0x61, 0x6d, 0x65, 0x12, 0x17, - 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x52, 0x61, 0x77, 0x42, 0x6c, 0x61, 0x6d, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, - 0x2e, 0x52, 0x61, 0x77, 0x42, 0x6c, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x02, 0x30, 0x01, 0x12, 0x60, 0x0a, 0x11, 0x4c, - 0x61, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x46, 0x6f, 0x72, 0x50, 0x61, 0x74, 0x68, - 0x12, 0x20, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x4c, 0x61, 0x73, 0x74, 0x43, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x46, 0x6f, 0x72, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x4c, 0x61, 0x73, 0x74, - 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x46, 0x6f, 0x72, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x02, 0x12, 0x71, 0x0a, - 0x16, 0x4c, 0x69, 0x73, 0x74, 0x4c, 0x61, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, - 0x46, 0x6f, 0x72, 0x54, 0x72, 0x65, 0x65, 0x12, 0x25, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4c, 0x61, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, - 0x46, 0x6f, 0x72, 0x54, 0x72, 0x65, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, - 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4c, 0x61, 0x73, 0x74, - 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x46, 0x6f, 0x72, 0x54, 0x72, 0x65, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x02, 0x30, 0x01, - 0x12, 0x5f, 0x0a, 0x10, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x42, 0x79, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x43, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x42, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x43, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x42, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x02, 0x30, - 0x01, 0x12, 0x5f, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, - 0x42, 0x79, 0x4f, 0x69, 0x64, 0x12, 0x1f, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x42, 0x79, 0x4f, 0x69, 0x64, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x42, 0x79, 0x4f, 0x69, 0x64, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x02, - 0x30, 0x01, 0x12, 0x6b, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x73, 0x42, 0x79, 0x52, 0x65, 0x66, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x2e, 0x67, 0x69, 0x74, - 0x61, 0x6c, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x42, - 0x79, 0x52, 0x65, 0x66, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x24, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x73, 0x42, 0x79, 0x52, 0x65, 0x66, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x02, 0x30, 0x01, 0x12, - 0x79, 0x0a, 0x18, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x53, 0x68, 0x61, 0x73, 0x57, 0x69, 0x74, - 0x68, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x27, 0x2e, 0x67, 0x69, - 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x53, 0x68, 0x61, 0x73, 0x57, - 0x69, 0x74, 0x68, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x46, 0x69, - 0x6c, 0x74, 0x65, 0x72, 0x53, 0x68, 0x61, 0x73, 0x57, 0x69, 0x74, 0x68, 0x53, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, - 0xfa, 0x97, 0x28, 0x02, 0x08, 0x02, 0x28, 0x01, 0x30, 0x01, 0x12, 0x68, 0x0a, 0x13, 0x47, 0x65, - 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x73, 0x12, 0x22, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x47, - 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, - 0x08, 0x02, 0x30, 0x01, 0x12, 0x62, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x20, 0x2e, 0x67, 0x69, 0x74, 0x61, - 0x6c, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x67, 0x69, - 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, - 0xfa, 0x97, 0x28, 0x02, 0x08, 0x02, 0x30, 0x01, 0x12, 0x64, 0x0a, 0x11, 0x43, 0x68, 0x65, 0x63, - 0x6b, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x45, 0x78, 0x69, 0x73, 0x74, 0x12, 0x20, 0x2e, - 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x73, 0x45, 0x78, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x21, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x73, 0x45, 0x78, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x02, 0x28, 0x01, 0x30, 0x01, 0x42, 0x5e, - 0x5a, 0x5c, 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x69, 0x74, - 0x6c, 0x61, 0x62, 0x2d, 0x6f, 0x72, 0x67, 0x2f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2d, - 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x69, 0x74, 0x6c, - 0x61, 0x62, 0x2d, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x36, 0x2f, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2f, 0x76, 0x65, 0x6e, - 0x64, 0x6f, 0x72, 0x65, 0x64, 0x2f, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x70, 0x62, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_commit_proto_rawDescOnce sync.Once - file_commit_proto_rawDescData = file_commit_proto_rawDesc -) - -func file_commit_proto_rawDescGZIP() []byte { - file_commit_proto_rawDescOnce.Do(func() { - file_commit_proto_rawDescData = protoimpl.X.CompressGZIP(file_commit_proto_rawDescData) - }) - return file_commit_proto_rawDescData -} - -var file_commit_proto_enumTypes = make([]protoimpl.EnumInfo, 7) -var file_commit_proto_msgTypes = make([]protoimpl.MessageInfo, 54) -var file_commit_proto_goTypes = []interface{}{ - (ListCommitsRequest_Order)(0), // 0: gitaly.ListCommitsRequest.Order - (TreeEntryResponse_ObjectType)(0), // 1: gitaly.TreeEntryResponse.ObjectType - (TreeEntry_EntryType)(0), // 2: gitaly.TreeEntry.EntryType - (GetTreeEntriesRequest_SortBy)(0), // 3: gitaly.GetTreeEntriesRequest.SortBy - (FindAllCommitsRequest_Order)(0), // 4: gitaly.FindAllCommitsRequest.Order - (FindCommitsRequest_Order)(0), // 5: gitaly.FindCommitsRequest.Order - (GetCommitSignaturesResponse_Signer)(0), // 6: gitaly.GetCommitSignaturesResponse.Signer - (*ListCommitsRequest)(nil), // 7: gitaly.ListCommitsRequest - (*ListCommitsResponse)(nil), // 8: gitaly.ListCommitsResponse - (*ListAllCommitsRequest)(nil), // 9: gitaly.ListAllCommitsRequest - (*ListAllCommitsResponse)(nil), // 10: gitaly.ListAllCommitsResponse - (*CommitStatsRequest)(nil), // 11: gitaly.CommitStatsRequest - (*CommitStatsResponse)(nil), // 12: gitaly.CommitStatsResponse - (*CommitIsAncestorRequest)(nil), // 13: gitaly.CommitIsAncestorRequest - (*CommitIsAncestorResponse)(nil), // 14: gitaly.CommitIsAncestorResponse - (*TreeEntryRequest)(nil), // 15: gitaly.TreeEntryRequest - (*TreeEntryResponse)(nil), // 16: gitaly.TreeEntryResponse - (*CountCommitsRequest)(nil), // 17: gitaly.CountCommitsRequest - (*CountCommitsResponse)(nil), // 18: gitaly.CountCommitsResponse - (*CountDivergingCommitsRequest)(nil), // 19: gitaly.CountDivergingCommitsRequest - (*CountDivergingCommitsResponse)(nil), // 20: gitaly.CountDivergingCommitsResponse - (*TreeEntry)(nil), // 21: gitaly.TreeEntry - (*GetTreeEntriesRequest)(nil), // 22: gitaly.GetTreeEntriesRequest - (*GetTreeEntriesResponse)(nil), // 23: gitaly.GetTreeEntriesResponse - (*GetTreeEntriesError)(nil), // 24: gitaly.GetTreeEntriesError - (*ListFilesRequest)(nil), // 25: gitaly.ListFilesRequest - (*ListFilesResponse)(nil), // 26: gitaly.ListFilesResponse - (*FindCommitRequest)(nil), // 27: gitaly.FindCommitRequest - (*FindCommitResponse)(nil), // 28: gitaly.FindCommitResponse - (*ListCommitsByOidRequest)(nil), // 29: gitaly.ListCommitsByOidRequest - (*ListCommitsByOidResponse)(nil), // 30: gitaly.ListCommitsByOidResponse - (*ListCommitsByRefNameRequest)(nil), // 31: gitaly.ListCommitsByRefNameRequest - (*ListCommitsByRefNameResponse)(nil), // 32: gitaly.ListCommitsByRefNameResponse - (*FindAllCommitsRequest)(nil), // 33: gitaly.FindAllCommitsRequest - (*FindAllCommitsResponse)(nil), // 34: gitaly.FindAllCommitsResponse - (*FindCommitsRequest)(nil), // 35: gitaly.FindCommitsRequest - (*FindCommitsResponse)(nil), // 36: gitaly.FindCommitsResponse - (*CommitLanguagesRequest)(nil), // 37: gitaly.CommitLanguagesRequest - (*CommitLanguagesResponse)(nil), // 38: gitaly.CommitLanguagesResponse - (*RawBlameRequest)(nil), // 39: gitaly.RawBlameRequest - (*RawBlameResponse)(nil), // 40: gitaly.RawBlameResponse - (*LastCommitForPathRequest)(nil), // 41: gitaly.LastCommitForPathRequest - (*LastCommitForPathResponse)(nil), // 42: gitaly.LastCommitForPathResponse - (*ListLastCommitsForTreeRequest)(nil), // 43: gitaly.ListLastCommitsForTreeRequest - (*ListLastCommitsForTreeResponse)(nil), // 44: gitaly.ListLastCommitsForTreeResponse - (*CommitsByMessageRequest)(nil), // 45: gitaly.CommitsByMessageRequest - (*CommitsByMessageResponse)(nil), // 46: gitaly.CommitsByMessageResponse - (*FilterShasWithSignaturesRequest)(nil), // 47: gitaly.FilterShasWithSignaturesRequest - (*FilterShasWithSignaturesResponse)(nil), // 48: gitaly.FilterShasWithSignaturesResponse - (*ExtractCommitSignatureRequest)(nil), // 49: gitaly.ExtractCommitSignatureRequest - (*ExtractCommitSignatureResponse)(nil), // 50: gitaly.ExtractCommitSignatureResponse - (*GetCommitSignaturesRequest)(nil), // 51: gitaly.GetCommitSignaturesRequest - (*GetCommitSignaturesResponse)(nil), // 52: gitaly.GetCommitSignaturesResponse - (*GetCommitMessagesRequest)(nil), // 53: gitaly.GetCommitMessagesRequest - (*GetCommitMessagesResponse)(nil), // 54: gitaly.GetCommitMessagesResponse - (*CheckObjectsExistRequest)(nil), // 55: gitaly.CheckObjectsExistRequest - (*CheckObjectsExistResponse)(nil), // 56: gitaly.CheckObjectsExistResponse - (*ListCommitsByRefNameResponse_CommitForRef)(nil), // 57: gitaly.ListCommitsByRefNameResponse.CommitForRef - (*CommitLanguagesResponse_Language)(nil), // 58: gitaly.CommitLanguagesResponse.Language - (*ListLastCommitsForTreeResponse_CommitForTree)(nil), // 59: gitaly.ListLastCommitsForTreeResponse.CommitForTree - (*CheckObjectsExistResponse_RevisionExistence)(nil), // 60: gitaly.CheckObjectsExistResponse.RevisionExistence - (*Repository)(nil), // 61: gitaly.Repository - (*PaginationParameter)(nil), // 62: gitaly.PaginationParameter - (*timestamppb.Timestamp)(nil), // 63: google.protobuf.Timestamp - (*GitCommit)(nil), // 64: gitaly.GitCommit - (*GlobalOptions)(nil), // 65: gitaly.GlobalOptions - (*PaginationCursor)(nil), // 66: gitaly.PaginationCursor - (*ResolveRevisionError)(nil), // 67: gitaly.ResolveRevisionError - (*PathError)(nil), // 68: gitaly.PathError -} -var file_commit_proto_depIdxs = []int32{ - 61, // 0: gitaly.ListCommitsRequest.repository:type_name -> gitaly.Repository - 62, // 1: gitaly.ListCommitsRequest.pagination_params:type_name -> gitaly.PaginationParameter - 0, // 2: gitaly.ListCommitsRequest.order:type_name -> gitaly.ListCommitsRequest.Order - 63, // 3: gitaly.ListCommitsRequest.after:type_name -> google.protobuf.Timestamp - 63, // 4: gitaly.ListCommitsRequest.before:type_name -> google.protobuf.Timestamp - 64, // 5: gitaly.ListCommitsResponse.commits:type_name -> gitaly.GitCommit - 61, // 6: gitaly.ListAllCommitsRequest.repository:type_name -> gitaly.Repository - 62, // 7: gitaly.ListAllCommitsRequest.pagination_params:type_name -> gitaly.PaginationParameter - 64, // 8: gitaly.ListAllCommitsResponse.commits:type_name -> gitaly.GitCommit - 61, // 9: gitaly.CommitStatsRequest.repository:type_name -> gitaly.Repository - 61, // 10: gitaly.CommitIsAncestorRequest.repository:type_name -> gitaly.Repository - 61, // 11: gitaly.TreeEntryRequest.repository:type_name -> gitaly.Repository - 1, // 12: gitaly.TreeEntryResponse.type:type_name -> gitaly.TreeEntryResponse.ObjectType - 61, // 13: gitaly.CountCommitsRequest.repository:type_name -> gitaly.Repository - 63, // 14: gitaly.CountCommitsRequest.after:type_name -> google.protobuf.Timestamp - 63, // 15: gitaly.CountCommitsRequest.before:type_name -> google.protobuf.Timestamp - 65, // 16: gitaly.CountCommitsRequest.global_options:type_name -> gitaly.GlobalOptions - 61, // 17: gitaly.CountDivergingCommitsRequest.repository:type_name -> gitaly.Repository - 2, // 18: gitaly.TreeEntry.type:type_name -> gitaly.TreeEntry.EntryType - 61, // 19: gitaly.GetTreeEntriesRequest.repository:type_name -> gitaly.Repository - 3, // 20: gitaly.GetTreeEntriesRequest.sort:type_name -> gitaly.GetTreeEntriesRequest.SortBy - 62, // 21: gitaly.GetTreeEntriesRequest.pagination_params:type_name -> gitaly.PaginationParameter - 21, // 22: gitaly.GetTreeEntriesResponse.entries:type_name -> gitaly.TreeEntry - 66, // 23: gitaly.GetTreeEntriesResponse.pagination_cursor:type_name -> gitaly.PaginationCursor - 67, // 24: gitaly.GetTreeEntriesError.resolve_tree:type_name -> gitaly.ResolveRevisionError - 68, // 25: gitaly.GetTreeEntriesError.path:type_name -> gitaly.PathError - 61, // 26: gitaly.ListFilesRequest.repository:type_name -> gitaly.Repository - 61, // 27: gitaly.FindCommitRequest.repository:type_name -> gitaly.Repository - 64, // 28: gitaly.FindCommitResponse.commit:type_name -> gitaly.GitCommit - 61, // 29: gitaly.ListCommitsByOidRequest.repository:type_name -> gitaly.Repository - 64, // 30: gitaly.ListCommitsByOidResponse.commits:type_name -> gitaly.GitCommit - 61, // 31: gitaly.ListCommitsByRefNameRequest.repository:type_name -> gitaly.Repository - 57, // 32: gitaly.ListCommitsByRefNameResponse.commit_refs:type_name -> gitaly.ListCommitsByRefNameResponse.CommitForRef - 61, // 33: gitaly.FindAllCommitsRequest.repository:type_name -> gitaly.Repository - 4, // 34: gitaly.FindAllCommitsRequest.order:type_name -> gitaly.FindAllCommitsRequest.Order - 64, // 35: gitaly.FindAllCommitsResponse.commits:type_name -> gitaly.GitCommit - 61, // 36: gitaly.FindCommitsRequest.repository:type_name -> gitaly.Repository - 63, // 37: gitaly.FindCommitsRequest.after:type_name -> google.protobuf.Timestamp - 63, // 38: gitaly.FindCommitsRequest.before:type_name -> google.protobuf.Timestamp - 5, // 39: gitaly.FindCommitsRequest.order:type_name -> gitaly.FindCommitsRequest.Order - 65, // 40: gitaly.FindCommitsRequest.global_options:type_name -> gitaly.GlobalOptions - 64, // 41: gitaly.FindCommitsResponse.commits:type_name -> gitaly.GitCommit - 61, // 42: gitaly.CommitLanguagesRequest.repository:type_name -> gitaly.Repository - 58, // 43: gitaly.CommitLanguagesResponse.languages:type_name -> gitaly.CommitLanguagesResponse.Language - 61, // 44: gitaly.RawBlameRequest.repository:type_name -> gitaly.Repository - 61, // 45: gitaly.LastCommitForPathRequest.repository:type_name -> gitaly.Repository - 65, // 46: gitaly.LastCommitForPathRequest.global_options:type_name -> gitaly.GlobalOptions - 64, // 47: gitaly.LastCommitForPathResponse.commit:type_name -> gitaly.GitCommit - 61, // 48: gitaly.ListLastCommitsForTreeRequest.repository:type_name -> gitaly.Repository - 65, // 49: gitaly.ListLastCommitsForTreeRequest.global_options:type_name -> gitaly.GlobalOptions - 59, // 50: gitaly.ListLastCommitsForTreeResponse.commits:type_name -> gitaly.ListLastCommitsForTreeResponse.CommitForTree - 61, // 51: gitaly.CommitsByMessageRequest.repository:type_name -> gitaly.Repository - 65, // 52: gitaly.CommitsByMessageRequest.global_options:type_name -> gitaly.GlobalOptions - 64, // 53: gitaly.CommitsByMessageResponse.commits:type_name -> gitaly.GitCommit - 61, // 54: gitaly.FilterShasWithSignaturesRequest.repository:type_name -> gitaly.Repository - 61, // 55: gitaly.ExtractCommitSignatureRequest.repository:type_name -> gitaly.Repository - 61, // 56: gitaly.GetCommitSignaturesRequest.repository:type_name -> gitaly.Repository - 6, // 57: gitaly.GetCommitSignaturesResponse.signer:type_name -> gitaly.GetCommitSignaturesResponse.Signer - 61, // 58: gitaly.GetCommitMessagesRequest.repository:type_name -> gitaly.Repository - 61, // 59: gitaly.CheckObjectsExistRequest.repository:type_name -> gitaly.Repository - 60, // 60: gitaly.CheckObjectsExistResponse.revisions:type_name -> gitaly.CheckObjectsExistResponse.RevisionExistence - 64, // 61: gitaly.ListCommitsByRefNameResponse.CommitForRef.commit:type_name -> gitaly.GitCommit - 64, // 62: gitaly.ListLastCommitsForTreeResponse.CommitForTree.commit:type_name -> gitaly.GitCommit - 7, // 63: gitaly.CommitService.ListCommits:input_type -> gitaly.ListCommitsRequest - 9, // 64: gitaly.CommitService.ListAllCommits:input_type -> gitaly.ListAllCommitsRequest - 13, // 65: gitaly.CommitService.CommitIsAncestor:input_type -> gitaly.CommitIsAncestorRequest - 15, // 66: gitaly.CommitService.TreeEntry:input_type -> gitaly.TreeEntryRequest - 17, // 67: gitaly.CommitService.CountCommits:input_type -> gitaly.CountCommitsRequest - 19, // 68: gitaly.CommitService.CountDivergingCommits:input_type -> gitaly.CountDivergingCommitsRequest - 22, // 69: gitaly.CommitService.GetTreeEntries:input_type -> gitaly.GetTreeEntriesRequest - 25, // 70: gitaly.CommitService.ListFiles:input_type -> gitaly.ListFilesRequest - 27, // 71: gitaly.CommitService.FindCommit:input_type -> gitaly.FindCommitRequest - 11, // 72: gitaly.CommitService.CommitStats:input_type -> gitaly.CommitStatsRequest - 33, // 73: gitaly.CommitService.FindAllCommits:input_type -> gitaly.FindAllCommitsRequest - 35, // 74: gitaly.CommitService.FindCommits:input_type -> gitaly.FindCommitsRequest - 37, // 75: gitaly.CommitService.CommitLanguages:input_type -> gitaly.CommitLanguagesRequest - 39, // 76: gitaly.CommitService.RawBlame:input_type -> gitaly.RawBlameRequest - 41, // 77: gitaly.CommitService.LastCommitForPath:input_type -> gitaly.LastCommitForPathRequest - 43, // 78: gitaly.CommitService.ListLastCommitsForTree:input_type -> gitaly.ListLastCommitsForTreeRequest - 45, // 79: gitaly.CommitService.CommitsByMessage:input_type -> gitaly.CommitsByMessageRequest - 29, // 80: gitaly.CommitService.ListCommitsByOid:input_type -> gitaly.ListCommitsByOidRequest - 31, // 81: gitaly.CommitService.ListCommitsByRefName:input_type -> gitaly.ListCommitsByRefNameRequest - 47, // 82: gitaly.CommitService.FilterShasWithSignatures:input_type -> gitaly.FilterShasWithSignaturesRequest - 51, // 83: gitaly.CommitService.GetCommitSignatures:input_type -> gitaly.GetCommitSignaturesRequest - 53, // 84: gitaly.CommitService.GetCommitMessages:input_type -> gitaly.GetCommitMessagesRequest - 55, // 85: gitaly.CommitService.CheckObjectsExist:input_type -> gitaly.CheckObjectsExistRequest - 8, // 86: gitaly.CommitService.ListCommits:output_type -> gitaly.ListCommitsResponse - 10, // 87: gitaly.CommitService.ListAllCommits:output_type -> gitaly.ListAllCommitsResponse - 14, // 88: gitaly.CommitService.CommitIsAncestor:output_type -> gitaly.CommitIsAncestorResponse - 16, // 89: gitaly.CommitService.TreeEntry:output_type -> gitaly.TreeEntryResponse - 18, // 90: gitaly.CommitService.CountCommits:output_type -> gitaly.CountCommitsResponse - 20, // 91: gitaly.CommitService.CountDivergingCommits:output_type -> gitaly.CountDivergingCommitsResponse - 23, // 92: gitaly.CommitService.GetTreeEntries:output_type -> gitaly.GetTreeEntriesResponse - 26, // 93: gitaly.CommitService.ListFiles:output_type -> gitaly.ListFilesResponse - 28, // 94: gitaly.CommitService.FindCommit:output_type -> gitaly.FindCommitResponse - 12, // 95: gitaly.CommitService.CommitStats:output_type -> gitaly.CommitStatsResponse - 34, // 96: gitaly.CommitService.FindAllCommits:output_type -> gitaly.FindAllCommitsResponse - 36, // 97: gitaly.CommitService.FindCommits:output_type -> gitaly.FindCommitsResponse - 38, // 98: gitaly.CommitService.CommitLanguages:output_type -> gitaly.CommitLanguagesResponse - 40, // 99: gitaly.CommitService.RawBlame:output_type -> gitaly.RawBlameResponse - 42, // 100: gitaly.CommitService.LastCommitForPath:output_type -> gitaly.LastCommitForPathResponse - 44, // 101: gitaly.CommitService.ListLastCommitsForTree:output_type -> gitaly.ListLastCommitsForTreeResponse - 46, // 102: gitaly.CommitService.CommitsByMessage:output_type -> gitaly.CommitsByMessageResponse - 30, // 103: gitaly.CommitService.ListCommitsByOid:output_type -> gitaly.ListCommitsByOidResponse - 32, // 104: gitaly.CommitService.ListCommitsByRefName:output_type -> gitaly.ListCommitsByRefNameResponse - 48, // 105: gitaly.CommitService.FilterShasWithSignatures:output_type -> gitaly.FilterShasWithSignaturesResponse - 52, // 106: gitaly.CommitService.GetCommitSignatures:output_type -> gitaly.GetCommitSignaturesResponse - 54, // 107: gitaly.CommitService.GetCommitMessages:output_type -> gitaly.GetCommitMessagesResponse - 56, // 108: gitaly.CommitService.CheckObjectsExist:output_type -> gitaly.CheckObjectsExistResponse - 86, // [86:109] is the sub-list for method output_type - 63, // [63:86] is the sub-list for method input_type - 63, // [63:63] is the sub-list for extension type_name - 63, // [63:63] is the sub-list for extension extendee - 0, // [0:63] is the sub-list for field type_name -} - -func init() { file_commit_proto_init() } -func file_commit_proto_init() { - if File_commit_proto != nil { - return - } - file_errors_proto_init() - file_lint_proto_init() - file_shared_proto_init() - if !protoimpl.UnsafeEnabled { - file_commit_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListCommitsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListCommitsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListAllCommitsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListAllCommitsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommitStatsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommitStatsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommitIsAncestorRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommitIsAncestorResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TreeEntryRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TreeEntryResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CountCommitsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CountCommitsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CountDivergingCommitsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CountDivergingCommitsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TreeEntry); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetTreeEntriesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetTreeEntriesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetTreeEntriesError); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListFilesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListFilesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindCommitRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindCommitResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListCommitsByOidRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListCommitsByOidResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListCommitsByRefNameRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListCommitsByRefNameResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindAllCommitsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindAllCommitsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindCommitsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindCommitsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommitLanguagesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommitLanguagesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RawBlameRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RawBlameResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LastCommitForPathRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LastCommitForPathResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListLastCommitsForTreeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListLastCommitsForTreeResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommitsByMessageRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommitsByMessageResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FilterShasWithSignaturesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FilterShasWithSignaturesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExtractCommitSignatureRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExtractCommitSignatureResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetCommitSignaturesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetCommitSignaturesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetCommitMessagesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetCommitMessagesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CheckObjectsExistRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CheckObjectsExistResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListCommitsByRefNameResponse_CommitForRef); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommitLanguagesResponse_Language); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListLastCommitsForTreeResponse_CommitForTree); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_commit_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CheckObjectsExistResponse_RevisionExistence); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_commit_proto_msgTypes[17].OneofWrappers = []interface{}{ - (*GetTreeEntriesError_ResolveTree)(nil), - (*GetTreeEntriesError_Path)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_commit_proto_rawDesc, - NumEnums: 7, - NumMessages: 54, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_commit_proto_goTypes, - DependencyIndexes: file_commit_proto_depIdxs, - EnumInfos: file_commit_proto_enumTypes, - MessageInfos: file_commit_proto_msgTypes, - }.Build() - File_commit_proto = out.File - file_commit_proto_rawDesc = nil - file_commit_proto_goTypes = nil - file_commit_proto_depIdxs = nil -} diff --git a/internal/gitaly/vendored/gitalypb/commit.proto b/internal/gitaly/vendored/gitalypb/commit.proto deleted file mode 100644 index 349cbcfd..00000000 --- a/internal/gitaly/vendored/gitalypb/commit.proto +++ /dev/null @@ -1,881 +0,0 @@ -syntax = "proto3"; - -package gitaly; - -import "errors.proto"; -import "google/protobuf/timestamp.proto"; -import "lint.proto"; -import "shared.proto"; - -option go_package = "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/gitalypb"; - -// CommitService is a service which provides RPCs that interact with Git -// commits. -service CommitService { - - // ListCommits lists all commits reachable via a set of references by doing a - // graph walk. This deprecates FindAllCommits and FindCommits (except Follow - // is not yet supported). Any unknown revisions will cause the RPC to fail. - rpc ListCommits(ListCommitsRequest) returns (stream ListCommitsResponse) { - option (op_type) = { - op: ACCESSOR - }; - } - - // ListAllCommits lists all commits present in the repository, including - // those not reachable by any reference. - rpc ListAllCommits(ListAllCommitsRequest) returns (stream ListAllCommitsResponse) { - option (op_type) = { - op: ACCESSOR - }; - } - - // This comment is left unintentionally blank. - rpc CommitIsAncestor(CommitIsAncestorRequest) returns (CommitIsAncestorResponse) { - option (op_type) = { - op: ACCESSOR - }; - } - - // This comment is left unintentionally blank. - rpc TreeEntry(TreeEntryRequest) returns (stream TreeEntryResponse) { - option (op_type) = { - op: ACCESSOR - }; - } - - // This comment is left unintentionally blank. - rpc CountCommits(CountCommitsRequest) returns (CountCommitsResponse) { - option (op_type) = { - op: ACCESSOR - }; - } - - // This comment is left unintentionally blank. - rpc CountDivergingCommits(CountDivergingCommitsRequest) returns (CountDivergingCommitsResponse) { - option (op_type) = { - op: ACCESSOR - }; - } - - // This comment is left unintentionally blank. - rpc GetTreeEntries(GetTreeEntriesRequest) returns (stream GetTreeEntriesResponse) { - option (op_type) = { - op: ACCESSOR - }; - } - - // This comment is left unintentionally blank. - rpc ListFiles(ListFilesRequest) returns (stream ListFilesResponse) { - option (op_type) = { - op: ACCESSOR - }; - } - - // This comment is left unintentionally blank. - rpc FindCommit(FindCommitRequest) returns (FindCommitResponse) { - option (op_type) = { - op: ACCESSOR - }; - } - - // This comment is left unintentionally blank. - rpc CommitStats(CommitStatsRequest) returns (CommitStatsResponse) { - option (op_type) = { - op: ACCESSOR - }; - } - - // Use a stream to paginate the result set - rpc FindAllCommits(FindAllCommitsRequest) returns (stream FindAllCommitsResponse) { - option (op_type) = { - op: ACCESSOR - }; - } - - // This comment is left unintentionally blank. - rpc FindCommits(FindCommitsRequest) returns (stream FindCommitsResponse) { - option (op_type) = { - op: ACCESSOR - }; - } - - // CommitLanguages detects the source code languages of the whole tree for a - // given commit. Returns an error in case no languages could be detected. - rpc CommitLanguages(CommitLanguagesRequest) returns (CommitLanguagesResponse) { - option (op_type) = { - op: ACCESSOR - }; - } - - // This comment is left unintentionally blank. - rpc RawBlame(RawBlameRequest) returns (stream RawBlameResponse) { - option (op_type) = { - op: ACCESSOR - }; - } - - // This comment is left unintentionally blank. - rpc LastCommitForPath(LastCommitForPathRequest) returns (LastCommitForPathResponse) { - option (op_type) = { - op: ACCESSOR - }; - } - - // This comment is left unintentionally blank. - rpc ListLastCommitsForTree(ListLastCommitsForTreeRequest) returns (stream ListLastCommitsForTreeResponse) { - option (op_type) = { - op: ACCESSOR - }; - } - - // This comment is left unintentionally blank. - rpc CommitsByMessage(CommitsByMessageRequest) returns (stream CommitsByMessageResponse) { - option (op_type) = { - op: ACCESSOR - }; - } - - // This comment is left unintentionally blank. - rpc ListCommitsByOid(ListCommitsByOidRequest) returns (stream ListCommitsByOidResponse) { - option (op_type) = { - op: ACCESSOR - }; - } - - // This comment is left unintentionally blank. - rpc ListCommitsByRefName(ListCommitsByRefNameRequest) returns (stream ListCommitsByRefNameResponse) { - option (op_type) = { - op: ACCESSOR - }; - } - - // This comment is left unintentionally blank. - rpc FilterShasWithSignatures(stream FilterShasWithSignaturesRequest) returns (stream FilterShasWithSignaturesResponse) { - option (op_type) = { - op: ACCESSOR - }; - } - - // This comment is left unintentionally blank. - rpc GetCommitSignatures(GetCommitSignaturesRequest) returns (stream GetCommitSignaturesResponse) { - option (op_type) = { - op: ACCESSOR - }; - } - - // This comment is left unintentionally blank. - rpc GetCommitMessages(GetCommitMessagesRequest) returns (stream GetCommitMessagesResponse) { - option (op_type) = { - op: ACCESSOR - }; - } - - // CheckObjectsExist will check for the existence of revisions against a - // repository. It returns two sets of data. An array containing the revisions - // fromm the input that it found on the repository, and an array that contains all - // revisions from the input it did not find on the repository. - rpc CheckObjectsExist(stream CheckObjectsExistRequest) returns (stream CheckObjectsExistResponse) { - option (op_type) = { - op: ACCESSOR - }; - } - -} - -// ListCommitsRequest is a request for the ListCommits RPC. -message ListCommitsRequest { - // Order is the order in which commits shoud be traversed. - enum Order { - // NONE defaults to reverse chronological order. - NONE = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH - // TOPO order will cause no parents to be shown before all of its children - // are shown. Furthermore, multiple lines of history will not be - // intermixed. - TOPO = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX - // DATE order will cause no parents to be shown before all of its children - // are shown. Otherwise, commits are shown in commit timestamp order. This - // can cause history to be shown intermixed. - DATE = 2; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX - }; - - // Repository is the repository in which commits should be searched for. - Repository repository = 1 [(target_repository)=true]; - - // Revisions is the set of revisions which should be walked to enumerate - // commits. Accepts all notation as documented in gitrevisions(7) as well as - // the pseudo-revisions `--not` and `--all` as documented in git-rev-list(1). - // Must not be empty. - repeated string revisions = 2; - - // PaginationParams allows implementation of pagination. The page token is - // the last commit OID that was sent. It's expected to be the full object ID - // to guard against ambigious OIDs. - PaginationParameter pagination_params = 3; - - // Order is the order in which commits should be traversed. Please refer to - // the enum's documentation for further information. - Order order = 4; - - // Reverse will cause all commits to be listed in reverse. - bool reverse = 11; - - // MaxParents will skip all commits which have more than the specified number - // of parents. If set to `0`, no filtering by parents will happen. If set to - // `1`, all merge commits will be omitted. - uint32 max_parents = 5; - - // DisableWalk will disable walking the graph. As a result, only commits - // which are immediately referenced by Revisions will be returned. - bool disable_walk = 6; - - // FirstParent will cause the graph walk to only go down the first-parent - // chain of commits. Merge commits will thus only cause the mainline to be - // enumerated. - bool first_parent = 7; - - // After will only list commits which are more recent than the specified date. - google.protobuf.Timestamp after = 8; - - // After will only list commits which are older than the specified date. - google.protobuf.Timestamp before = 9; - - // Author will only list commits whose author matches the given pattern, - // which is a regular expression. - bytes author = 10; - - // IgnoreCase will apply case-sensitive behaviour while regex matching. - bool ignore_case = 12; - - // CommitMessagePatterns will only list commits whose commit message matches - // any of the given patterns. - repeated bytes commit_message_patterns = 13; -} - -// ListCommitsResponse is a response for the ListCommits RPC. -message ListCommitsResponse { - // Commits is the list of commits found. - repeated GitCommit commits = 1; -} - -// ListAllCommitsRequest is a request for the ListAllCommits RPC. -message ListAllCommitsRequest { - // Repository is the repository in which commits should be searched for. - Repository repository = 1 [(target_repository)=true]; - - // PaginationParams allows implementation of pagination. The page token is - // the last commit OID that was sent. It's expected to be the full object ID - // to guard against ambigious OIDs. - PaginationParameter pagination_params = 2; -} - -// ListAllCommitsResponse is a response for the ListAllCommits RPC. -message ListAllCommitsResponse { - // Commits is the list of commits found. - repeated GitCommit commits = 1; -} - -// This comment is left unintentionally blank. -message CommitStatsRequest { - // This comment is left unintentionally blank. - Repository repository = 1 [(target_repository)=true]; - // This comment is left unintentionally blank. - bytes revision = 2; -} - -// This comment is left unintentionally blank. -message CommitStatsResponse { - // OID is the commit. Empty means not found - string oid = 1; - // This comment is left unintentionally blank. - int32 additions = 2; - // This comment is left unintentionally blank. - int32 deletions = 3; -} - -// This comment is left unintentionally blank. -message CommitIsAncestorRequest { - // This comment is left unintentionally blank. - Repository repository = 1 [(target_repository)=true]; - // This comment is left unintentionally blank. - string ancestor_id = 2; - // This comment is left unintentionally blank. - string child_id = 3; -} - -// This comment is left unintentionally blank. -message CommitIsAncestorResponse { - // This comment is left unintentionally blank. - bool value = 1; -} - -// TreeEntryRequest is a request for the TreeEntry RPC. -message TreeEntryRequest { - // Repository is the repository for which to read the tree entry. - Repository repository = 1 [(target_repository)=true]; - // Revision is the revision that identifies the commit at which the tree entry is to be read. It can be either a - // commit ID or a reference name. - bytes revision = 2; - // Path is the path of the entry that shall be read, relative to the tree of the specified revision. - bytes path = 3; - // Limit is the maximum number of bytes to fetch. If object is bigger, remaining bytes are not sent - // 0 means there is no limit. - int64 limit = 4; - // MaxSize is the maximum allowed object size. If bigger, a FailedPrecondition error is returned - // 0 means there is no maximum size. - int64 max_size = 5; -} - -// TreeEntryResponse is a response for the TreeEntry RPC. Multiple responses may be sent in case the tree entry's data -// exceeds the maximum allowed message length. -message TreeEntryResponse { - // ObjectType is the type of the returned tree entry. - // - // TODO: Replace this enum with ObjectType in shared.proto - enum ObjectType { - // COMMIT indicates that the tree entry is a commit, which may be the case for submodules. - COMMIT = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH - // BLOB indicates that the tree entry is a blob. - BLOB = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX - // TREE indicates that the tree entry is a tree, which may be the case for subdirectories. - TREE = 2; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX - // TAG indicates that the tree entry is a tag. This case should never happen. - TAG = 3; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX - } - - // Type is the object type of the tree entry. - ObjectType type = 1; - // Oid is the object ID of the tree entry. In case of submodules, it contains the commit ID that the submodule - // currently refers to. - string oid = 2; - // Size is the size of the tree entry. - int64 size = 3; - // Mode is the mode of the tree entry. - int32 mode = 4; - // Data contains the raw object contents. This data may be split up across multiple messages. - bytes data = 5; -} - -// This comment is left unintentionally blank. -message CountCommitsRequest { - // This comment is left unintentionally blank. - Repository repository = 1 [(target_repository)=true]; - // This comment is left unintentionally blank. - bytes revision = 2; - // This comment is left unintentionally blank. - google.protobuf.Timestamp after = 3; - // This comment is left unintentionally blank. - google.protobuf.Timestamp before = 4; - // This comment is left unintentionally blank. - bytes path = 5; - // This comment is left unintentionally blank. - int32 max_count = 6; - // all and revision are mutually exclusive - bool all = 7; - // This comment is left unintentionally blank. - bool first_parent = 8; - // This comment is left unintentionally blank. - GlobalOptions global_options = 9; -} - -// This comment is left unintentionally blank. -message CountCommitsResponse { - // This comment is left unintentionally blank. - int32 count = 1; -} - -// This comment is left unintentionally blank. -message CountDivergingCommitsRequest { - // This comment is left unintentionally blank. - Repository repository = 1 [(target_repository)=true]; - // This comment is left unintentionally blank. - bytes from = 2; - // This comment is left unintentionally blank. - bytes to = 3; - reserved 4; - reserved 5; - reserved 6; - // This comment is left unintentionally blank. - int32 max_count = 7; -} - -// This comment is left unintentionally blank. -message CountDivergingCommitsResponse { - // This comment is left unintentionally blank. - int32 left_count = 1; - // This comment is left unintentionally blank. - int32 right_count = 2; -} - -// This comment is left unintentionally blank. -message TreeEntry { - // TODO: Replace this enum with ObjectType in shared.proto - enum EntryType { - // This comment is left unintentionally blank. - BLOB = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH - // This comment is left unintentionally blank. - TREE = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX - // This comment is left unintentionally blank. - COMMIT = 3; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX - } - - // OID of the object this tree entry points to - string oid = 1; - // Path relative to repository root - bytes path = 3; - // This comment is left unintentionally blank. - EntryType type = 4; - // File mode e.g. 0644 - int32 mode = 5; - // The commit object via which this entry was retrieved - string commit_oid = 6; - // Relative path of the first subdir that doesn't have only one directory descendant - bytes flat_path = 7; - - // RootOid used to refer to the resolved object ID of the root tree. This field has been removed - // with no replacement. - reserved "root_oid"; - reserved 2; -} - -// This comment is left unintentionally blank. -message GetTreeEntriesRequest { - // This comment is left unintentionally blank. - enum SortBy { - // Preserve order of git ls-tree. - DEFAULT = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH - // Trees, blobs, submodules. - TREES_FIRST = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX - } - - // This comment is left unintentionally blank. - Repository repository = 1 [(target_repository)=true]; - // This comment is left unintentionally blank. - bytes revision = 2; - // This comment is left unintentionally blank. - bytes path = 3; - // This comment is left unintentionally blank. - bool recursive = 4; - // This comment is left unintentionally blank. - SortBy sort = 5; - // The page token is the last commit OID that was sent. It's expected to be the - // full object ID to guard against ambigious OIDs. - PaginationParameter pagination_params = 6; - // SkipFlatPath is an option to skip the expensive operation of populating flat paths. - bool skip_flat_paths = 7; -} - -// This comment is left unintentionally blank. -message GetTreeEntriesResponse { - // This comment is left unintentionally blank. - repeated TreeEntry entries = 1; - // This comment is left unintentionally blank. - PaginationCursor pagination_cursor = 2; -} - -// GetTreeEntriesError may be returned when GetTreeEntries fails with a specific root -// cause. -message GetTreeEntriesError { - oneof error { - // ResolveTree is set when the provided revision ID could not be resolved. - ResolveRevisionError resolve_tree = 1; - // Path is set when the provided path is not valid. - PathError path = 2; - } -} - -// This comment is left unintentionally blank. -message ListFilesRequest { - // This comment is left unintentionally blank. - Repository repository = 1 [(target_repository)=true]; - // This comment is left unintentionally blank. - bytes revision = 2; -} - -// A single 'page' of the paginated response -message ListFilesResponse { - // Remember to force encoding utf-8 on the client side - repeated bytes paths = 1; -} - -// This comment is left unintentionally blank. -message FindCommitRequest { - // This comment is left unintentionally blank. - Repository repository = 1 [(target_repository)=true]; - // This comment is left unintentionally blank. - bytes revision = 2; - // This comment is left unintentionally blank. - bool trailers = 3; -} - -// This comment is left unintentionally blank. -message FindCommitResponse { - // commit is nil when the commit was not found - GitCommit commit = 1; -} - -// This comment is left unintentionally blank. -message ListCommitsByOidRequest { - // This comment is left unintentionally blank. - Repository repository = 1 [(target_repository)=true]; - // This comment is left unintentionally blank. - repeated string oid = 2; // protolint:disable:this REPEATED_FIELD_NAMES_PLURALIZED -} - -// This comment is left unintentionally blank. -message ListCommitsByOidResponse { - // This comment is left unintentionally blank. - repeated GitCommit commits = 1; -} - -// This comment is left unintentionally blank. -message ListCommitsByRefNameRequest { - // This comment is left unintentionally blank. - Repository repository = 1 [(target_repository)=true]; - // This comment is left unintentionally blank. - repeated bytes ref_names = 2; -} - -// This comment is left unintentionally blank. -message ListCommitsByRefNameResponse { - reserved 1; - - // This comment is left unintentionally blank. - message CommitForRef { - // This comment is left unintentionally blank. - GitCommit commit = 1; - // This comment is left unintentionally blank. - bytes ref_name = 2; - } - - // This comment is left unintentionally blank. - repeated CommitForRef commit_refs = 2; -} - -// This comment is left unintentionally blank. -message FindAllCommitsRequest { - // This comment is left unintentionally blank. - enum Order { - // This comment is left unintentionally blank. - NONE = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH - // This comment is left unintentionally blank. - TOPO = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX - // This comment is left unintentionally blank. - DATE = 2; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX - } - - // This comment is left unintentionally blank. - Repository repository = 1 [(target_repository)=true]; - // When nil, return all commits reachable by any branch in the repo - bytes revision = 2; - // This comment is left unintentionally blank. - int32 max_count = 3; - // This comment is left unintentionally blank. - int32 skip = 4; - // This comment is left unintentionally blank. - Order order = 5; -} - -// A single 'page' of the result set -message FindAllCommitsResponse { - // This comment is left unintentionally blank. - repeated GitCommit commits = 1; -} - -// This comment is left unintentionally blank. -message FindCommitsRequest { - // This comment is left unintentionally blank. - enum Order { - // This comment is left unintentionally blank. - NONE = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH - // This comment is left unintentionally blank. - TOPO = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX - } - - // This comment is left unintentionally blank. - Repository repository = 1 [(target_repository)=true]; - // This comment is left unintentionally blank. - bytes revision = 2; - // This comment is left unintentionally blank. - int32 limit = 3; - // This comment is left unintentionally blank. - int32 offset = 4; - // This comment is left unintentionally blank. - repeated bytes paths = 5; - // This comment is left unintentionally blank. - bool follow = 6; - // This comment is left unintentionally blank. - bool skip_merges = 7; - // This comment is left unintentionally blank. - bool disable_walk = 8; - // This comment is left unintentionally blank. - google.protobuf.Timestamp after = 9; - // This comment is left unintentionally blank. - google.protobuf.Timestamp before = 10; - // all and revision are mutually exclusive - bool all = 11; - // This comment is left unintentionally blank. - bool first_parent = 12; - // This comment is left unintentionally blank. - bytes author = 13; - // This comment is left unintentionally blank. - Order order = 14; - // This comment is left unintentionally blank. - GlobalOptions global_options = 15; - // This comment is left unintentionally blank. - bool trailers = 16; - // include_shortstat determines whether to include the number of lines and files - // changed in the commits. Populates the `short_stats` field. - bool include_shortstat = 17; - // include_referenced_by determines whether to include references that point to a - // commit in the response. The field contains patterns that are matched against - // references. Only matching references are included in the response. For - // example, one can get tags pointing to a commit with `refs/tags`, or branches - // respectively with `refs/heads`. By sending both, the response will include all - // references that match either pattern. - repeated bytes include_referenced_by = 18; // protolint:disable:this REPEATED_FIELD_NAMES_PLURALIZED -} - -// A single 'page' of the result set -message FindCommitsResponse { - // This comment is left unintentionally blank. - repeated GitCommit commits = 1; -} - -// CommitLanguagesRequest requests to detect the source code languages. -message CommitLanguagesRequest { - // Repository is the repository where to detect the languages in. - Repository repository = 1 [(target_repository)=true]; - // Revision tells for which commit the languages should be detected. If it's - // omitted, the HEAD commit of the default branch is used. - bytes revision = 2; -} - -// CommitLanguagesResponse returns the language statistics. -message CommitLanguagesResponse { - // Language specifies the statistics for one language. - message Language { - // Name is the name of the detected language, for example: Ruby, Go, HTML - // A full list of language names can be found at: - // https://github.com/github/linguist/blob/master/lib/linguist/languages.yml - string name = 1; - // Share is the percentual share (value between 0 and 100) of this language - // in relation to other languages that exist in the given revision. - float share = 2; - // Color specifies the associated color for this language, for example #3fd5e0. - string color = 3; - // FileCount was a uint32 that stored how many files with this language were found. - // However, it was never used and there is no client demand for it. - // See: https://gitlab.com/gitlab-org/gitaly/-/issues/4293. - reserved 4; - reserved "file_count"; - // Bytes is the total amount of bytes written in this language - uint64 bytes = 5; - } - - // Languages is a set of all the detected languages and their statistics. - repeated Language languages = 1; -} - -// This comment is left unintentionally blank. -message RawBlameRequest { - // This comment is left unintentionally blank. - Repository repository = 1 [(target_repository)=true]; - // This comment is left unintentionally blank. - bytes revision = 2; - // This comment is left unintentionally blank. - bytes path = 3; - // Comma-separated range of line numbers to perform the blame on: "1,1000". - // Optional - if no range is provided, the whole file will be blamed. - bytes range = 4; -} - -// This comment is left unintentionally blank. -message RawBlameResponse { - // This comment is left unintentionally blank. - bytes data = 1; -} - -// This comment is left unintentionally blank. -message LastCommitForPathRequest { - // This comment is left unintentionally blank. - Repository repository = 1 [(target_repository)=true]; - // This comment is left unintentionally blank. - bytes revision = 2; - // This comment is left unintentionally blank. - // This comment is left unintentionally blank. - // This comment is left unintentionally blank. - bytes path = 3; - // This comment is left unintentionally blank. - bool literal_pathspec = 4; // Deprecate after Rails stops using this - // This comment is left unintentionally blank. - GlobalOptions global_options = 5; -} - -// This comment is left unintentionally blank. -message LastCommitForPathResponse { - // commit is nil when the commit was not found - GitCommit commit = 1; -} - -// This comment is left unintentionally blank. -message ListLastCommitsForTreeRequest { - // This comment is left unintentionally blank. - Repository repository = 1 [(target_repository)=true]; - // This comment is left unintentionally blank. - string revision = 2; - // This comment is left unintentionally blank. - bytes path = 3; - // This comment is left unintentionally blank. - int32 limit = 4; - // This comment is left unintentionally blank. - int32 offset = 5; - // This comment is left unintentionally blank. - bool literal_pathspec = 6 [deprecated = true]; - // This comment is left unintentionally blank. - GlobalOptions global_options = 7; -} - -// This comment is left unintentionally blank. -message ListLastCommitsForTreeResponse { - // This comment is left unintentionally blank. - message CommitForTree { - reserved 1; - - // This comment is left unintentionally blank. - GitCommit commit = 2; - reserved 3; - // This comment is left unintentionally blank. - bytes path_bytes = 4; - } - - // This comment is left unintentionally blank. - repeated CommitForTree commits = 1; -} - -// This comment is left unintentionally blank. -message CommitsByMessageRequest { - // This comment is left unintentionally blank. - Repository repository = 1 [(target_repository)=true]; - // This comment is left unintentionally blank. - bytes revision = 2; - // This comment is left unintentionally blank. - int32 offset = 3; - // This comment is left unintentionally blank. - int32 limit = 4; - // This comment is left unintentionally blank. - bytes path = 5; - // This comment is left unintentionally blank. - string query = 6; - // This comment is left unintentionally blank. - GlobalOptions global_options = 7; -} - -// One 'page' of the paginated response of CommitsByMessage -message CommitsByMessageResponse { - // This comment is left unintentionally blank. - repeated GitCommit commits = 1; -} - -// This comment is left unintentionally blank. -message FilterShasWithSignaturesRequest { - // This comment is left unintentionally blank. - Repository repository = 1 [(target_repository)=true]; - // This comment is left unintentionally blank. - repeated bytes shas = 2; -} - -// This comment is left unintentionally blank. -message FilterShasWithSignaturesResponse { - // This comment is left unintentionally blank. - repeated bytes shas = 1; -} - -// This comment is left unintentionally blank. -message ExtractCommitSignatureRequest { - // This comment is left unintentionally blank. - Repository repository = 1 [(target_repository)=true]; - // This comment is left unintentionally blank. - string commit_id = 2; -} - -// Either of the 'signature' and 'signed_text' fields may be present. It -// is up to the caller to stitch them together. -message ExtractCommitSignatureResponse { - // This comment is left unintentionally blank. - bytes signature = 1; - // This comment is left unintentionally blank. - bytes signed_text = 2; -} - -// This comment is left unintentionally blank. -message GetCommitSignaturesRequest { - // This comment is left unintentionally blank. - Repository repository = 1 [(target_repository)=true]; - // This comment is left unintentionally blank. - repeated string commit_ids = 2; -} - -// This comment is left unintentionally blank. -message GetCommitSignaturesResponse { - // Signer of the commit. A commit can be signed either by a user or by Gitaly itself. - enum Signer { - // SIGNER_UNSPECIFIED indicates that the signer has not been specified. - SIGNER_UNSPECIFIED = 0; - // SIGNER_USER indicates that the commit has been signed by a user. - SIGNER_USER = 1; - // SIGNER_SYSTEM indicates that the commit has been signed by Gitaly itself. - SIGNER_SYSTEM = 2; - } - - // Commit id of the signature. - string commit_id = 1; - // Signature of the commit (GPG or SSH). - bytes signature = 2; - // Signed text that is used to verify the signature. - bytes signed_text = 3; - // Signer of the commit - Signer signer = 4; -} - -// This comment is left unintentionally blank. -message GetCommitMessagesRequest { - // This comment is left unintentionally blank. - Repository repository = 1 [(target_repository)=true]; - // This comment is left unintentionally blank. - repeated string commit_ids = 2; -} - -// This comment is left unintentionally blank. -message GetCommitMessagesResponse { - // Only present for a new commit message - string commit_id = 1; - // This comment is left unintentionally blank. - bytes message = 2; -} - -// CheckObjectsExistRequest is a request for the CheckObjectsExist RPC. Only -// the initial request must contain a repository, the repository of all -// subsequent requests will be ignored. -message CheckObjectsExistRequest { - // Repository is the repository in which existence of objects and refs - // are checked. - Repository repository = 1 [(target_repository)=true]; - // Revisions contains the revisions that shall be checked for existence. This accepts all revisions - // as documented in gitrevisions(7) - repeated bytes revisions = 2; -} - -// This comment is left unintentionally blank. -message CheckObjectsExistResponse { - // This comment is left unintentionally blank. - message RevisionExistence { - // This comment is left unintentionally blank. - bytes name = 1; - // This comment is left unintentionally blank. - bool exists = 2; - }; - - // This comment is left unintentionally blank. - repeated RevisionExistence revisions = 1; -} diff --git a/internal/gitaly/vendored/gitalypb/commit_grpc.pb.go b/internal/gitaly/vendored/gitalypb/commit_grpc.pb.go deleted file mode 100644 index aa45973b..00000000 --- a/internal/gitaly/vendored/gitalypb/commit_grpc.pb.go +++ /dev/null @@ -1,1367 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v3.21.7 -// source: commit.proto - -package gitalypb - -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 - -const ( - CommitService_ListCommits_FullMethodName = "/gitaly.CommitService/ListCommits" - CommitService_ListAllCommits_FullMethodName = "/gitaly.CommitService/ListAllCommits" - CommitService_CommitIsAncestor_FullMethodName = "/gitaly.CommitService/CommitIsAncestor" - CommitService_TreeEntry_FullMethodName = "/gitaly.CommitService/TreeEntry" - CommitService_CountCommits_FullMethodName = "/gitaly.CommitService/CountCommits" - CommitService_CountDivergingCommits_FullMethodName = "/gitaly.CommitService/CountDivergingCommits" - CommitService_GetTreeEntries_FullMethodName = "/gitaly.CommitService/GetTreeEntries" - CommitService_ListFiles_FullMethodName = "/gitaly.CommitService/ListFiles" - CommitService_FindCommit_FullMethodName = "/gitaly.CommitService/FindCommit" - CommitService_CommitStats_FullMethodName = "/gitaly.CommitService/CommitStats" - CommitService_FindAllCommits_FullMethodName = "/gitaly.CommitService/FindAllCommits" - CommitService_FindCommits_FullMethodName = "/gitaly.CommitService/FindCommits" - CommitService_CommitLanguages_FullMethodName = "/gitaly.CommitService/CommitLanguages" - CommitService_RawBlame_FullMethodName = "/gitaly.CommitService/RawBlame" - CommitService_LastCommitForPath_FullMethodName = "/gitaly.CommitService/LastCommitForPath" - CommitService_ListLastCommitsForTree_FullMethodName = "/gitaly.CommitService/ListLastCommitsForTree" - CommitService_CommitsByMessage_FullMethodName = "/gitaly.CommitService/CommitsByMessage" - CommitService_ListCommitsByOid_FullMethodName = "/gitaly.CommitService/ListCommitsByOid" - CommitService_ListCommitsByRefName_FullMethodName = "/gitaly.CommitService/ListCommitsByRefName" - CommitService_FilterShasWithSignatures_FullMethodName = "/gitaly.CommitService/FilterShasWithSignatures" - CommitService_GetCommitSignatures_FullMethodName = "/gitaly.CommitService/GetCommitSignatures" - CommitService_GetCommitMessages_FullMethodName = "/gitaly.CommitService/GetCommitMessages" - CommitService_CheckObjectsExist_FullMethodName = "/gitaly.CommitService/CheckObjectsExist" -) - -// CommitServiceClient is the client API for CommitService 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 CommitServiceClient interface { - ListCommits(ctx context.Context, in *ListCommitsRequest, opts ...grpc.CallOption) (CommitService_ListCommitsClient, error) - ListAllCommits(ctx context.Context, in *ListAllCommitsRequest, opts ...grpc.CallOption) (CommitService_ListAllCommitsClient, error) - CommitIsAncestor(ctx context.Context, in *CommitIsAncestorRequest, opts ...grpc.CallOption) (*CommitIsAncestorResponse, error) - TreeEntry(ctx context.Context, in *TreeEntryRequest, opts ...grpc.CallOption) (CommitService_TreeEntryClient, error) - CountCommits(ctx context.Context, in *CountCommitsRequest, opts ...grpc.CallOption) (*CountCommitsResponse, error) - CountDivergingCommits(ctx context.Context, in *CountDivergingCommitsRequest, opts ...grpc.CallOption) (*CountDivergingCommitsResponse, error) - GetTreeEntries(ctx context.Context, in *GetTreeEntriesRequest, opts ...grpc.CallOption) (CommitService_GetTreeEntriesClient, error) - ListFiles(ctx context.Context, in *ListFilesRequest, opts ...grpc.CallOption) (CommitService_ListFilesClient, error) - FindCommit(ctx context.Context, in *FindCommitRequest, opts ...grpc.CallOption) (*FindCommitResponse, error) - CommitStats(ctx context.Context, in *CommitStatsRequest, opts ...grpc.CallOption) (*CommitStatsResponse, error) - FindAllCommits(ctx context.Context, in *FindAllCommitsRequest, opts ...grpc.CallOption) (CommitService_FindAllCommitsClient, error) - FindCommits(ctx context.Context, in *FindCommitsRequest, opts ...grpc.CallOption) (CommitService_FindCommitsClient, error) - CommitLanguages(ctx context.Context, in *CommitLanguagesRequest, opts ...grpc.CallOption) (*CommitLanguagesResponse, error) - RawBlame(ctx context.Context, in *RawBlameRequest, opts ...grpc.CallOption) (CommitService_RawBlameClient, error) - LastCommitForPath(ctx context.Context, in *LastCommitForPathRequest, opts ...grpc.CallOption) (*LastCommitForPathResponse, error) - ListLastCommitsForTree(ctx context.Context, in *ListLastCommitsForTreeRequest, opts ...grpc.CallOption) (CommitService_ListLastCommitsForTreeClient, error) - CommitsByMessage(ctx context.Context, in *CommitsByMessageRequest, opts ...grpc.CallOption) (CommitService_CommitsByMessageClient, error) - ListCommitsByOid(ctx context.Context, in *ListCommitsByOidRequest, opts ...grpc.CallOption) (CommitService_ListCommitsByOidClient, error) - ListCommitsByRefName(ctx context.Context, in *ListCommitsByRefNameRequest, opts ...grpc.CallOption) (CommitService_ListCommitsByRefNameClient, error) - FilterShasWithSignatures(ctx context.Context, opts ...grpc.CallOption) (CommitService_FilterShasWithSignaturesClient, error) - GetCommitSignatures(ctx context.Context, in *GetCommitSignaturesRequest, opts ...grpc.CallOption) (CommitService_GetCommitSignaturesClient, error) - GetCommitMessages(ctx context.Context, in *GetCommitMessagesRequest, opts ...grpc.CallOption) (CommitService_GetCommitMessagesClient, error) - CheckObjectsExist(ctx context.Context, opts ...grpc.CallOption) (CommitService_CheckObjectsExistClient, error) -} - -type commitServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewCommitServiceClient(cc grpc.ClientConnInterface) CommitServiceClient { - return &commitServiceClient{cc} -} - -func (c *commitServiceClient) ListCommits(ctx context.Context, in *ListCommitsRequest, opts ...grpc.CallOption) (CommitService_ListCommitsClient, error) { - stream, err := c.cc.NewStream(ctx, &CommitService_ServiceDesc.Streams[0], CommitService_ListCommits_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &commitServiceListCommitsClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type CommitService_ListCommitsClient interface { - Recv() (*ListCommitsResponse, error) - grpc.ClientStream -} - -type commitServiceListCommitsClient struct { - grpc.ClientStream -} - -func (x *commitServiceListCommitsClient) Recv() (*ListCommitsResponse, error) { - m := new(ListCommitsResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *commitServiceClient) ListAllCommits(ctx context.Context, in *ListAllCommitsRequest, opts ...grpc.CallOption) (CommitService_ListAllCommitsClient, error) { - stream, err := c.cc.NewStream(ctx, &CommitService_ServiceDesc.Streams[1], CommitService_ListAllCommits_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &commitServiceListAllCommitsClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type CommitService_ListAllCommitsClient interface { - Recv() (*ListAllCommitsResponse, error) - grpc.ClientStream -} - -type commitServiceListAllCommitsClient struct { - grpc.ClientStream -} - -func (x *commitServiceListAllCommitsClient) Recv() (*ListAllCommitsResponse, error) { - m := new(ListAllCommitsResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *commitServiceClient) CommitIsAncestor(ctx context.Context, in *CommitIsAncestorRequest, opts ...grpc.CallOption) (*CommitIsAncestorResponse, error) { - out := new(CommitIsAncestorResponse) - err := c.cc.Invoke(ctx, CommitService_CommitIsAncestor_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *commitServiceClient) TreeEntry(ctx context.Context, in *TreeEntryRequest, opts ...grpc.CallOption) (CommitService_TreeEntryClient, error) { - stream, err := c.cc.NewStream(ctx, &CommitService_ServiceDesc.Streams[2], CommitService_TreeEntry_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &commitServiceTreeEntryClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type CommitService_TreeEntryClient interface { - Recv() (*TreeEntryResponse, error) - grpc.ClientStream -} - -type commitServiceTreeEntryClient struct { - grpc.ClientStream -} - -func (x *commitServiceTreeEntryClient) Recv() (*TreeEntryResponse, error) { - m := new(TreeEntryResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *commitServiceClient) CountCommits(ctx context.Context, in *CountCommitsRequest, opts ...grpc.CallOption) (*CountCommitsResponse, error) { - out := new(CountCommitsResponse) - err := c.cc.Invoke(ctx, CommitService_CountCommits_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *commitServiceClient) CountDivergingCommits(ctx context.Context, in *CountDivergingCommitsRequest, opts ...grpc.CallOption) (*CountDivergingCommitsResponse, error) { - out := new(CountDivergingCommitsResponse) - err := c.cc.Invoke(ctx, CommitService_CountDivergingCommits_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *commitServiceClient) GetTreeEntries(ctx context.Context, in *GetTreeEntriesRequest, opts ...grpc.CallOption) (CommitService_GetTreeEntriesClient, error) { - stream, err := c.cc.NewStream(ctx, &CommitService_ServiceDesc.Streams[3], CommitService_GetTreeEntries_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &commitServiceGetTreeEntriesClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type CommitService_GetTreeEntriesClient interface { - Recv() (*GetTreeEntriesResponse, error) - grpc.ClientStream -} - -type commitServiceGetTreeEntriesClient struct { - grpc.ClientStream -} - -func (x *commitServiceGetTreeEntriesClient) Recv() (*GetTreeEntriesResponse, error) { - m := new(GetTreeEntriesResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *commitServiceClient) ListFiles(ctx context.Context, in *ListFilesRequest, opts ...grpc.CallOption) (CommitService_ListFilesClient, error) { - stream, err := c.cc.NewStream(ctx, &CommitService_ServiceDesc.Streams[4], CommitService_ListFiles_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &commitServiceListFilesClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type CommitService_ListFilesClient interface { - Recv() (*ListFilesResponse, error) - grpc.ClientStream -} - -type commitServiceListFilesClient struct { - grpc.ClientStream -} - -func (x *commitServiceListFilesClient) Recv() (*ListFilesResponse, error) { - m := new(ListFilesResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *commitServiceClient) FindCommit(ctx context.Context, in *FindCommitRequest, opts ...grpc.CallOption) (*FindCommitResponse, error) { - out := new(FindCommitResponse) - err := c.cc.Invoke(ctx, CommitService_FindCommit_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *commitServiceClient) CommitStats(ctx context.Context, in *CommitStatsRequest, opts ...grpc.CallOption) (*CommitStatsResponse, error) { - out := new(CommitStatsResponse) - err := c.cc.Invoke(ctx, CommitService_CommitStats_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *commitServiceClient) FindAllCommits(ctx context.Context, in *FindAllCommitsRequest, opts ...grpc.CallOption) (CommitService_FindAllCommitsClient, error) { - stream, err := c.cc.NewStream(ctx, &CommitService_ServiceDesc.Streams[5], CommitService_FindAllCommits_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &commitServiceFindAllCommitsClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type CommitService_FindAllCommitsClient interface { - Recv() (*FindAllCommitsResponse, error) - grpc.ClientStream -} - -type commitServiceFindAllCommitsClient struct { - grpc.ClientStream -} - -func (x *commitServiceFindAllCommitsClient) Recv() (*FindAllCommitsResponse, error) { - m := new(FindAllCommitsResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *commitServiceClient) FindCommits(ctx context.Context, in *FindCommitsRequest, opts ...grpc.CallOption) (CommitService_FindCommitsClient, error) { - stream, err := c.cc.NewStream(ctx, &CommitService_ServiceDesc.Streams[6], CommitService_FindCommits_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &commitServiceFindCommitsClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type CommitService_FindCommitsClient interface { - Recv() (*FindCommitsResponse, error) - grpc.ClientStream -} - -type commitServiceFindCommitsClient struct { - grpc.ClientStream -} - -func (x *commitServiceFindCommitsClient) Recv() (*FindCommitsResponse, error) { - m := new(FindCommitsResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *commitServiceClient) CommitLanguages(ctx context.Context, in *CommitLanguagesRequest, opts ...grpc.CallOption) (*CommitLanguagesResponse, error) { - out := new(CommitLanguagesResponse) - err := c.cc.Invoke(ctx, CommitService_CommitLanguages_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *commitServiceClient) RawBlame(ctx context.Context, in *RawBlameRequest, opts ...grpc.CallOption) (CommitService_RawBlameClient, error) { - stream, err := c.cc.NewStream(ctx, &CommitService_ServiceDesc.Streams[7], CommitService_RawBlame_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &commitServiceRawBlameClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type CommitService_RawBlameClient interface { - Recv() (*RawBlameResponse, error) - grpc.ClientStream -} - -type commitServiceRawBlameClient struct { - grpc.ClientStream -} - -func (x *commitServiceRawBlameClient) Recv() (*RawBlameResponse, error) { - m := new(RawBlameResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *commitServiceClient) LastCommitForPath(ctx context.Context, in *LastCommitForPathRequest, opts ...grpc.CallOption) (*LastCommitForPathResponse, error) { - out := new(LastCommitForPathResponse) - err := c.cc.Invoke(ctx, CommitService_LastCommitForPath_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *commitServiceClient) ListLastCommitsForTree(ctx context.Context, in *ListLastCommitsForTreeRequest, opts ...grpc.CallOption) (CommitService_ListLastCommitsForTreeClient, error) { - stream, err := c.cc.NewStream(ctx, &CommitService_ServiceDesc.Streams[8], CommitService_ListLastCommitsForTree_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &commitServiceListLastCommitsForTreeClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type CommitService_ListLastCommitsForTreeClient interface { - Recv() (*ListLastCommitsForTreeResponse, error) - grpc.ClientStream -} - -type commitServiceListLastCommitsForTreeClient struct { - grpc.ClientStream -} - -func (x *commitServiceListLastCommitsForTreeClient) Recv() (*ListLastCommitsForTreeResponse, error) { - m := new(ListLastCommitsForTreeResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *commitServiceClient) CommitsByMessage(ctx context.Context, in *CommitsByMessageRequest, opts ...grpc.CallOption) (CommitService_CommitsByMessageClient, error) { - stream, err := c.cc.NewStream(ctx, &CommitService_ServiceDesc.Streams[9], CommitService_CommitsByMessage_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &commitServiceCommitsByMessageClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type CommitService_CommitsByMessageClient interface { - Recv() (*CommitsByMessageResponse, error) - grpc.ClientStream -} - -type commitServiceCommitsByMessageClient struct { - grpc.ClientStream -} - -func (x *commitServiceCommitsByMessageClient) Recv() (*CommitsByMessageResponse, error) { - m := new(CommitsByMessageResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *commitServiceClient) ListCommitsByOid(ctx context.Context, in *ListCommitsByOidRequest, opts ...grpc.CallOption) (CommitService_ListCommitsByOidClient, error) { - stream, err := c.cc.NewStream(ctx, &CommitService_ServiceDesc.Streams[10], CommitService_ListCommitsByOid_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &commitServiceListCommitsByOidClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type CommitService_ListCommitsByOidClient interface { - Recv() (*ListCommitsByOidResponse, error) - grpc.ClientStream -} - -type commitServiceListCommitsByOidClient struct { - grpc.ClientStream -} - -func (x *commitServiceListCommitsByOidClient) Recv() (*ListCommitsByOidResponse, error) { - m := new(ListCommitsByOidResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *commitServiceClient) ListCommitsByRefName(ctx context.Context, in *ListCommitsByRefNameRequest, opts ...grpc.CallOption) (CommitService_ListCommitsByRefNameClient, error) { - stream, err := c.cc.NewStream(ctx, &CommitService_ServiceDesc.Streams[11], CommitService_ListCommitsByRefName_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &commitServiceListCommitsByRefNameClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type CommitService_ListCommitsByRefNameClient interface { - Recv() (*ListCommitsByRefNameResponse, error) - grpc.ClientStream -} - -type commitServiceListCommitsByRefNameClient struct { - grpc.ClientStream -} - -func (x *commitServiceListCommitsByRefNameClient) Recv() (*ListCommitsByRefNameResponse, error) { - m := new(ListCommitsByRefNameResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *commitServiceClient) FilterShasWithSignatures(ctx context.Context, opts ...grpc.CallOption) (CommitService_FilterShasWithSignaturesClient, error) { - stream, err := c.cc.NewStream(ctx, &CommitService_ServiceDesc.Streams[12], CommitService_FilterShasWithSignatures_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &commitServiceFilterShasWithSignaturesClient{stream} - return x, nil -} - -type CommitService_FilterShasWithSignaturesClient interface { - Send(*FilterShasWithSignaturesRequest) error - Recv() (*FilterShasWithSignaturesResponse, error) - grpc.ClientStream -} - -type commitServiceFilterShasWithSignaturesClient struct { - grpc.ClientStream -} - -func (x *commitServiceFilterShasWithSignaturesClient) Send(m *FilterShasWithSignaturesRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *commitServiceFilterShasWithSignaturesClient) Recv() (*FilterShasWithSignaturesResponse, error) { - m := new(FilterShasWithSignaturesResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *commitServiceClient) GetCommitSignatures(ctx context.Context, in *GetCommitSignaturesRequest, opts ...grpc.CallOption) (CommitService_GetCommitSignaturesClient, error) { - stream, err := c.cc.NewStream(ctx, &CommitService_ServiceDesc.Streams[13], CommitService_GetCommitSignatures_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &commitServiceGetCommitSignaturesClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type CommitService_GetCommitSignaturesClient interface { - Recv() (*GetCommitSignaturesResponse, error) - grpc.ClientStream -} - -type commitServiceGetCommitSignaturesClient struct { - grpc.ClientStream -} - -func (x *commitServiceGetCommitSignaturesClient) Recv() (*GetCommitSignaturesResponse, error) { - m := new(GetCommitSignaturesResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *commitServiceClient) GetCommitMessages(ctx context.Context, in *GetCommitMessagesRequest, opts ...grpc.CallOption) (CommitService_GetCommitMessagesClient, error) { - stream, err := c.cc.NewStream(ctx, &CommitService_ServiceDesc.Streams[14], CommitService_GetCommitMessages_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &commitServiceGetCommitMessagesClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type CommitService_GetCommitMessagesClient interface { - Recv() (*GetCommitMessagesResponse, error) - grpc.ClientStream -} - -type commitServiceGetCommitMessagesClient struct { - grpc.ClientStream -} - -func (x *commitServiceGetCommitMessagesClient) Recv() (*GetCommitMessagesResponse, error) { - m := new(GetCommitMessagesResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *commitServiceClient) CheckObjectsExist(ctx context.Context, opts ...grpc.CallOption) (CommitService_CheckObjectsExistClient, error) { - stream, err := c.cc.NewStream(ctx, &CommitService_ServiceDesc.Streams[15], CommitService_CheckObjectsExist_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &commitServiceCheckObjectsExistClient{stream} - return x, nil -} - -type CommitService_CheckObjectsExistClient interface { - Send(*CheckObjectsExistRequest) error - Recv() (*CheckObjectsExistResponse, error) - grpc.ClientStream -} - -type commitServiceCheckObjectsExistClient struct { - grpc.ClientStream -} - -func (x *commitServiceCheckObjectsExistClient) Send(m *CheckObjectsExistRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *commitServiceCheckObjectsExistClient) Recv() (*CheckObjectsExistResponse, error) { - m := new(CheckObjectsExistResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// CommitServiceServer is the server API for CommitService service. -// All implementations must embed UnimplementedCommitServiceServer -// for forward compatibility -type CommitServiceServer interface { - ListCommits(*ListCommitsRequest, CommitService_ListCommitsServer) error - ListAllCommits(*ListAllCommitsRequest, CommitService_ListAllCommitsServer) error - CommitIsAncestor(context.Context, *CommitIsAncestorRequest) (*CommitIsAncestorResponse, error) - TreeEntry(*TreeEntryRequest, CommitService_TreeEntryServer) error - CountCommits(context.Context, *CountCommitsRequest) (*CountCommitsResponse, error) - CountDivergingCommits(context.Context, *CountDivergingCommitsRequest) (*CountDivergingCommitsResponse, error) - GetTreeEntries(*GetTreeEntriesRequest, CommitService_GetTreeEntriesServer) error - ListFiles(*ListFilesRequest, CommitService_ListFilesServer) error - FindCommit(context.Context, *FindCommitRequest) (*FindCommitResponse, error) - CommitStats(context.Context, *CommitStatsRequest) (*CommitStatsResponse, error) - FindAllCommits(*FindAllCommitsRequest, CommitService_FindAllCommitsServer) error - FindCommits(*FindCommitsRequest, CommitService_FindCommitsServer) error - CommitLanguages(context.Context, *CommitLanguagesRequest) (*CommitLanguagesResponse, error) - RawBlame(*RawBlameRequest, CommitService_RawBlameServer) error - LastCommitForPath(context.Context, *LastCommitForPathRequest) (*LastCommitForPathResponse, error) - ListLastCommitsForTree(*ListLastCommitsForTreeRequest, CommitService_ListLastCommitsForTreeServer) error - CommitsByMessage(*CommitsByMessageRequest, CommitService_CommitsByMessageServer) error - ListCommitsByOid(*ListCommitsByOidRequest, CommitService_ListCommitsByOidServer) error - ListCommitsByRefName(*ListCommitsByRefNameRequest, CommitService_ListCommitsByRefNameServer) error - FilterShasWithSignatures(CommitService_FilterShasWithSignaturesServer) error - GetCommitSignatures(*GetCommitSignaturesRequest, CommitService_GetCommitSignaturesServer) error - GetCommitMessages(*GetCommitMessagesRequest, CommitService_GetCommitMessagesServer) error - CheckObjectsExist(CommitService_CheckObjectsExistServer) error - mustEmbedUnimplementedCommitServiceServer() -} - -// UnimplementedCommitServiceServer must be embedded to have forward compatible implementations. -type UnimplementedCommitServiceServer struct { -} - -func (UnimplementedCommitServiceServer) ListCommits(*ListCommitsRequest, CommitService_ListCommitsServer) error { - return status.Errorf(codes.Unimplemented, "method ListCommits not implemented") -} -func (UnimplementedCommitServiceServer) ListAllCommits(*ListAllCommitsRequest, CommitService_ListAllCommitsServer) error { - return status.Errorf(codes.Unimplemented, "method ListAllCommits not implemented") -} -func (UnimplementedCommitServiceServer) CommitIsAncestor(context.Context, *CommitIsAncestorRequest) (*CommitIsAncestorResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CommitIsAncestor not implemented") -} -func (UnimplementedCommitServiceServer) TreeEntry(*TreeEntryRequest, CommitService_TreeEntryServer) error { - return status.Errorf(codes.Unimplemented, "method TreeEntry not implemented") -} -func (UnimplementedCommitServiceServer) CountCommits(context.Context, *CountCommitsRequest) (*CountCommitsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CountCommits not implemented") -} -func (UnimplementedCommitServiceServer) CountDivergingCommits(context.Context, *CountDivergingCommitsRequest) (*CountDivergingCommitsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CountDivergingCommits not implemented") -} -func (UnimplementedCommitServiceServer) GetTreeEntries(*GetTreeEntriesRequest, CommitService_GetTreeEntriesServer) error { - return status.Errorf(codes.Unimplemented, "method GetTreeEntries not implemented") -} -func (UnimplementedCommitServiceServer) ListFiles(*ListFilesRequest, CommitService_ListFilesServer) error { - return status.Errorf(codes.Unimplemented, "method ListFiles not implemented") -} -func (UnimplementedCommitServiceServer) FindCommit(context.Context, *FindCommitRequest) (*FindCommitResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FindCommit not implemented") -} -func (UnimplementedCommitServiceServer) CommitStats(context.Context, *CommitStatsRequest) (*CommitStatsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CommitStats not implemented") -} -func (UnimplementedCommitServiceServer) FindAllCommits(*FindAllCommitsRequest, CommitService_FindAllCommitsServer) error { - return status.Errorf(codes.Unimplemented, "method FindAllCommits not implemented") -} -func (UnimplementedCommitServiceServer) FindCommits(*FindCommitsRequest, CommitService_FindCommitsServer) error { - return status.Errorf(codes.Unimplemented, "method FindCommits not implemented") -} -func (UnimplementedCommitServiceServer) CommitLanguages(context.Context, *CommitLanguagesRequest) (*CommitLanguagesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CommitLanguages not implemented") -} -func (UnimplementedCommitServiceServer) RawBlame(*RawBlameRequest, CommitService_RawBlameServer) error { - return status.Errorf(codes.Unimplemented, "method RawBlame not implemented") -} -func (UnimplementedCommitServiceServer) LastCommitForPath(context.Context, *LastCommitForPathRequest) (*LastCommitForPathResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LastCommitForPath not implemented") -} -func (UnimplementedCommitServiceServer) ListLastCommitsForTree(*ListLastCommitsForTreeRequest, CommitService_ListLastCommitsForTreeServer) error { - return status.Errorf(codes.Unimplemented, "method ListLastCommitsForTree not implemented") -} -func (UnimplementedCommitServiceServer) CommitsByMessage(*CommitsByMessageRequest, CommitService_CommitsByMessageServer) error { - return status.Errorf(codes.Unimplemented, "method CommitsByMessage not implemented") -} -func (UnimplementedCommitServiceServer) ListCommitsByOid(*ListCommitsByOidRequest, CommitService_ListCommitsByOidServer) error { - return status.Errorf(codes.Unimplemented, "method ListCommitsByOid not implemented") -} -func (UnimplementedCommitServiceServer) ListCommitsByRefName(*ListCommitsByRefNameRequest, CommitService_ListCommitsByRefNameServer) error { - return status.Errorf(codes.Unimplemented, "method ListCommitsByRefName not implemented") -} -func (UnimplementedCommitServiceServer) FilterShasWithSignatures(CommitService_FilterShasWithSignaturesServer) error { - return status.Errorf(codes.Unimplemented, "method FilterShasWithSignatures not implemented") -} -func (UnimplementedCommitServiceServer) GetCommitSignatures(*GetCommitSignaturesRequest, CommitService_GetCommitSignaturesServer) error { - return status.Errorf(codes.Unimplemented, "method GetCommitSignatures not implemented") -} -func (UnimplementedCommitServiceServer) GetCommitMessages(*GetCommitMessagesRequest, CommitService_GetCommitMessagesServer) error { - return status.Errorf(codes.Unimplemented, "method GetCommitMessages not implemented") -} -func (UnimplementedCommitServiceServer) CheckObjectsExist(CommitService_CheckObjectsExistServer) error { - return status.Errorf(codes.Unimplemented, "method CheckObjectsExist not implemented") -} -func (UnimplementedCommitServiceServer) mustEmbedUnimplementedCommitServiceServer() {} - -// UnsafeCommitServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to CommitServiceServer will -// result in compilation errors. -type UnsafeCommitServiceServer interface { - mustEmbedUnimplementedCommitServiceServer() -} - -func RegisterCommitServiceServer(s grpc.ServiceRegistrar, srv CommitServiceServer) { - s.RegisterService(&CommitService_ServiceDesc, srv) -} - -func _CommitService_ListCommits_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(ListCommitsRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(CommitServiceServer).ListCommits(m, &commitServiceListCommitsServer{stream}) -} - -type CommitService_ListCommitsServer interface { - Send(*ListCommitsResponse) error - grpc.ServerStream -} - -type commitServiceListCommitsServer struct { - grpc.ServerStream -} - -func (x *commitServiceListCommitsServer) Send(m *ListCommitsResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _CommitService_ListAllCommits_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(ListAllCommitsRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(CommitServiceServer).ListAllCommits(m, &commitServiceListAllCommitsServer{stream}) -} - -type CommitService_ListAllCommitsServer interface { - Send(*ListAllCommitsResponse) error - grpc.ServerStream -} - -type commitServiceListAllCommitsServer struct { - grpc.ServerStream -} - -func (x *commitServiceListAllCommitsServer) Send(m *ListAllCommitsResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _CommitService_CommitIsAncestor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CommitIsAncestorRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CommitServiceServer).CommitIsAncestor(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: CommitService_CommitIsAncestor_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CommitServiceServer).CommitIsAncestor(ctx, req.(*CommitIsAncestorRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _CommitService_TreeEntry_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(TreeEntryRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(CommitServiceServer).TreeEntry(m, &commitServiceTreeEntryServer{stream}) -} - -type CommitService_TreeEntryServer interface { - Send(*TreeEntryResponse) error - grpc.ServerStream -} - -type commitServiceTreeEntryServer struct { - grpc.ServerStream -} - -func (x *commitServiceTreeEntryServer) Send(m *TreeEntryResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _CommitService_CountCommits_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CountCommitsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CommitServiceServer).CountCommits(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: CommitService_CountCommits_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CommitServiceServer).CountCommits(ctx, req.(*CountCommitsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _CommitService_CountDivergingCommits_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CountDivergingCommitsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CommitServiceServer).CountDivergingCommits(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: CommitService_CountDivergingCommits_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CommitServiceServer).CountDivergingCommits(ctx, req.(*CountDivergingCommitsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _CommitService_GetTreeEntries_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(GetTreeEntriesRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(CommitServiceServer).GetTreeEntries(m, &commitServiceGetTreeEntriesServer{stream}) -} - -type CommitService_GetTreeEntriesServer interface { - Send(*GetTreeEntriesResponse) error - grpc.ServerStream -} - -type commitServiceGetTreeEntriesServer struct { - grpc.ServerStream -} - -func (x *commitServiceGetTreeEntriesServer) Send(m *GetTreeEntriesResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _CommitService_ListFiles_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(ListFilesRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(CommitServiceServer).ListFiles(m, &commitServiceListFilesServer{stream}) -} - -type CommitService_ListFilesServer interface { - Send(*ListFilesResponse) error - grpc.ServerStream -} - -type commitServiceListFilesServer struct { - grpc.ServerStream -} - -func (x *commitServiceListFilesServer) Send(m *ListFilesResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _CommitService_FindCommit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(FindCommitRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CommitServiceServer).FindCommit(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: CommitService_FindCommit_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CommitServiceServer).FindCommit(ctx, req.(*FindCommitRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _CommitService_CommitStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CommitStatsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CommitServiceServer).CommitStats(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: CommitService_CommitStats_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CommitServiceServer).CommitStats(ctx, req.(*CommitStatsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _CommitService_FindAllCommits_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(FindAllCommitsRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(CommitServiceServer).FindAllCommits(m, &commitServiceFindAllCommitsServer{stream}) -} - -type CommitService_FindAllCommitsServer interface { - Send(*FindAllCommitsResponse) error - grpc.ServerStream -} - -type commitServiceFindAllCommitsServer struct { - grpc.ServerStream -} - -func (x *commitServiceFindAllCommitsServer) Send(m *FindAllCommitsResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _CommitService_FindCommits_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(FindCommitsRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(CommitServiceServer).FindCommits(m, &commitServiceFindCommitsServer{stream}) -} - -type CommitService_FindCommitsServer interface { - Send(*FindCommitsResponse) error - grpc.ServerStream -} - -type commitServiceFindCommitsServer struct { - grpc.ServerStream -} - -func (x *commitServiceFindCommitsServer) Send(m *FindCommitsResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _CommitService_CommitLanguages_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CommitLanguagesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CommitServiceServer).CommitLanguages(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: CommitService_CommitLanguages_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CommitServiceServer).CommitLanguages(ctx, req.(*CommitLanguagesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _CommitService_RawBlame_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(RawBlameRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(CommitServiceServer).RawBlame(m, &commitServiceRawBlameServer{stream}) -} - -type CommitService_RawBlameServer interface { - Send(*RawBlameResponse) error - grpc.ServerStream -} - -type commitServiceRawBlameServer struct { - grpc.ServerStream -} - -func (x *commitServiceRawBlameServer) Send(m *RawBlameResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _CommitService_LastCommitForPath_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(LastCommitForPathRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CommitServiceServer).LastCommitForPath(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: CommitService_LastCommitForPath_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CommitServiceServer).LastCommitForPath(ctx, req.(*LastCommitForPathRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _CommitService_ListLastCommitsForTree_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(ListLastCommitsForTreeRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(CommitServiceServer).ListLastCommitsForTree(m, &commitServiceListLastCommitsForTreeServer{stream}) -} - -type CommitService_ListLastCommitsForTreeServer interface { - Send(*ListLastCommitsForTreeResponse) error - grpc.ServerStream -} - -type commitServiceListLastCommitsForTreeServer struct { - grpc.ServerStream -} - -func (x *commitServiceListLastCommitsForTreeServer) Send(m *ListLastCommitsForTreeResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _CommitService_CommitsByMessage_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(CommitsByMessageRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(CommitServiceServer).CommitsByMessage(m, &commitServiceCommitsByMessageServer{stream}) -} - -type CommitService_CommitsByMessageServer interface { - Send(*CommitsByMessageResponse) error - grpc.ServerStream -} - -type commitServiceCommitsByMessageServer struct { - grpc.ServerStream -} - -func (x *commitServiceCommitsByMessageServer) Send(m *CommitsByMessageResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _CommitService_ListCommitsByOid_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(ListCommitsByOidRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(CommitServiceServer).ListCommitsByOid(m, &commitServiceListCommitsByOidServer{stream}) -} - -type CommitService_ListCommitsByOidServer interface { - Send(*ListCommitsByOidResponse) error - grpc.ServerStream -} - -type commitServiceListCommitsByOidServer struct { - grpc.ServerStream -} - -func (x *commitServiceListCommitsByOidServer) Send(m *ListCommitsByOidResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _CommitService_ListCommitsByRefName_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(ListCommitsByRefNameRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(CommitServiceServer).ListCommitsByRefName(m, &commitServiceListCommitsByRefNameServer{stream}) -} - -type CommitService_ListCommitsByRefNameServer interface { - Send(*ListCommitsByRefNameResponse) error - grpc.ServerStream -} - -type commitServiceListCommitsByRefNameServer struct { - grpc.ServerStream -} - -func (x *commitServiceListCommitsByRefNameServer) Send(m *ListCommitsByRefNameResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _CommitService_FilterShasWithSignatures_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(CommitServiceServer).FilterShasWithSignatures(&commitServiceFilterShasWithSignaturesServer{stream}) -} - -type CommitService_FilterShasWithSignaturesServer interface { - Send(*FilterShasWithSignaturesResponse) error - Recv() (*FilterShasWithSignaturesRequest, error) - grpc.ServerStream -} - -type commitServiceFilterShasWithSignaturesServer struct { - grpc.ServerStream -} - -func (x *commitServiceFilterShasWithSignaturesServer) Send(m *FilterShasWithSignaturesResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *commitServiceFilterShasWithSignaturesServer) Recv() (*FilterShasWithSignaturesRequest, error) { - m := new(FilterShasWithSignaturesRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _CommitService_GetCommitSignatures_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(GetCommitSignaturesRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(CommitServiceServer).GetCommitSignatures(m, &commitServiceGetCommitSignaturesServer{stream}) -} - -type CommitService_GetCommitSignaturesServer interface { - Send(*GetCommitSignaturesResponse) error - grpc.ServerStream -} - -type commitServiceGetCommitSignaturesServer struct { - grpc.ServerStream -} - -func (x *commitServiceGetCommitSignaturesServer) Send(m *GetCommitSignaturesResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _CommitService_GetCommitMessages_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(GetCommitMessagesRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(CommitServiceServer).GetCommitMessages(m, &commitServiceGetCommitMessagesServer{stream}) -} - -type CommitService_GetCommitMessagesServer interface { - Send(*GetCommitMessagesResponse) error - grpc.ServerStream -} - -type commitServiceGetCommitMessagesServer struct { - grpc.ServerStream -} - -func (x *commitServiceGetCommitMessagesServer) Send(m *GetCommitMessagesResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _CommitService_CheckObjectsExist_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(CommitServiceServer).CheckObjectsExist(&commitServiceCheckObjectsExistServer{stream}) -} - -type CommitService_CheckObjectsExistServer interface { - Send(*CheckObjectsExistResponse) error - Recv() (*CheckObjectsExistRequest, error) - grpc.ServerStream -} - -type commitServiceCheckObjectsExistServer struct { - grpc.ServerStream -} - -func (x *commitServiceCheckObjectsExistServer) Send(m *CheckObjectsExistResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *commitServiceCheckObjectsExistServer) Recv() (*CheckObjectsExistRequest, error) { - m := new(CheckObjectsExistRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// CommitService_ServiceDesc is the grpc.ServiceDesc for CommitService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var CommitService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "gitaly.CommitService", - HandlerType: (*CommitServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "CommitIsAncestor", - Handler: _CommitService_CommitIsAncestor_Handler, - }, - { - MethodName: "CountCommits", - Handler: _CommitService_CountCommits_Handler, - }, - { - MethodName: "CountDivergingCommits", - Handler: _CommitService_CountDivergingCommits_Handler, - }, - { - MethodName: "FindCommit", - Handler: _CommitService_FindCommit_Handler, - }, - { - MethodName: "CommitStats", - Handler: _CommitService_CommitStats_Handler, - }, - { - MethodName: "CommitLanguages", - Handler: _CommitService_CommitLanguages_Handler, - }, - { - MethodName: "LastCommitForPath", - Handler: _CommitService_LastCommitForPath_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "ListCommits", - Handler: _CommitService_ListCommits_Handler, - ServerStreams: true, - }, - { - StreamName: "ListAllCommits", - Handler: _CommitService_ListAllCommits_Handler, - ServerStreams: true, - }, - { - StreamName: "TreeEntry", - Handler: _CommitService_TreeEntry_Handler, - ServerStreams: true, - }, - { - StreamName: "GetTreeEntries", - Handler: _CommitService_GetTreeEntries_Handler, - ServerStreams: true, - }, - { - StreamName: "ListFiles", - Handler: _CommitService_ListFiles_Handler, - ServerStreams: true, - }, - { - StreamName: "FindAllCommits", - Handler: _CommitService_FindAllCommits_Handler, - ServerStreams: true, - }, - { - StreamName: "FindCommits", - Handler: _CommitService_FindCommits_Handler, - ServerStreams: true, - }, - { - StreamName: "RawBlame", - Handler: _CommitService_RawBlame_Handler, - ServerStreams: true, - }, - { - StreamName: "ListLastCommitsForTree", - Handler: _CommitService_ListLastCommitsForTree_Handler, - ServerStreams: true, - }, - { - StreamName: "CommitsByMessage", - Handler: _CommitService_CommitsByMessage_Handler, - ServerStreams: true, - }, - { - StreamName: "ListCommitsByOid", - Handler: _CommitService_ListCommitsByOid_Handler, - ServerStreams: true, - }, - { - StreamName: "ListCommitsByRefName", - Handler: _CommitService_ListCommitsByRefName_Handler, - ServerStreams: true, - }, - { - StreamName: "FilterShasWithSignatures", - Handler: _CommitService_FilterShasWithSignatures_Handler, - ServerStreams: true, - ClientStreams: true, - }, - { - StreamName: "GetCommitSignatures", - Handler: _CommitService_GetCommitSignatures_Handler, - ServerStreams: true, - }, - { - StreamName: "GetCommitMessages", - Handler: _CommitService_GetCommitMessages_Handler, - ServerStreams: true, - }, - { - StreamName: "CheckObjectsExist", - Handler: _CommitService_CheckObjectsExist_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "commit.proto", -} diff --git a/internal/gitaly/vendored/gitalypb/errors.pb.go b/internal/gitaly/vendored/gitalypb/errors.pb.go deleted file mode 100644 index 8ae29474..00000000 --- a/internal/gitaly/vendored/gitalypb/errors.pb.go +++ /dev/null @@ -1,1396 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc v3.21.7 -// source: errors.proto - -package gitalypb - -import ( - reflect "reflect" - sync "sync" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - durationpb "google.golang.org/protobuf/types/known/durationpb" -) - -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 IndexError_ErrorType int32 - -const ( - IndexError_ERROR_TYPE_UNSPECIFIED IndexError_ErrorType = 0 - IndexError_ERROR_TYPE_EMPTY_PATH IndexError_ErrorType = 1 - IndexError_ERROR_TYPE_INVALID_PATH IndexError_ErrorType = 2 - IndexError_ERROR_TYPE_DIRECTORY_EXISTS IndexError_ErrorType = 3 - IndexError_ERROR_TYPE_DIRECTORY_TRAVERSAL IndexError_ErrorType = 4 - IndexError_ERROR_TYPE_FILE_EXISTS IndexError_ErrorType = 5 - IndexError_ERROR_TYPE_FILE_NOT_FOUND IndexError_ErrorType = 6 -) - -// Enum value maps for IndexError_ErrorType. -var ( - IndexError_ErrorType_name = map[int32]string{ - 0: "ERROR_TYPE_UNSPECIFIED", - 1: "ERROR_TYPE_EMPTY_PATH", - 2: "ERROR_TYPE_INVALID_PATH", - 3: "ERROR_TYPE_DIRECTORY_EXISTS", - 4: "ERROR_TYPE_DIRECTORY_TRAVERSAL", - 5: "ERROR_TYPE_FILE_EXISTS", - 6: "ERROR_TYPE_FILE_NOT_FOUND", - } - IndexError_ErrorType_value = map[string]int32{ - "ERROR_TYPE_UNSPECIFIED": 0, - "ERROR_TYPE_EMPTY_PATH": 1, - "ERROR_TYPE_INVALID_PATH": 2, - "ERROR_TYPE_DIRECTORY_EXISTS": 3, - "ERROR_TYPE_DIRECTORY_TRAVERSAL": 4, - "ERROR_TYPE_FILE_EXISTS": 5, - "ERROR_TYPE_FILE_NOT_FOUND": 6, - } -) - -func (x IndexError_ErrorType) Enum() *IndexError_ErrorType { - p := new(IndexError_ErrorType) - *p = x - return p -} - -func (x IndexError_ErrorType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (IndexError_ErrorType) Descriptor() protoreflect.EnumDescriptor { - return file_errors_proto_enumTypes[0].Descriptor() -} - -func (IndexError_ErrorType) Type() protoreflect.EnumType { - return &file_errors_proto_enumTypes[0] -} - -func (x IndexError_ErrorType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use IndexError_ErrorType.Descriptor instead. -func (IndexError_ErrorType) EnumDescriptor() ([]byte, []int) { - return file_errors_proto_rawDescGZIP(), []int{1, 0} -} - -type CustomHookError_HookType int32 - -const ( - CustomHookError_HOOK_TYPE_UNSPECIFIED CustomHookError_HookType = 0 - CustomHookError_HOOK_TYPE_PRERECEIVE CustomHookError_HookType = 1 - CustomHookError_HOOK_TYPE_UPDATE CustomHookError_HookType = 2 - CustomHookError_HOOK_TYPE_POSTRECEIVE CustomHookError_HookType = 3 -) - -// Enum value maps for CustomHookError_HookType. -var ( - CustomHookError_HookType_name = map[int32]string{ - 0: "HOOK_TYPE_UNSPECIFIED", - 1: "HOOK_TYPE_PRERECEIVE", - 2: "HOOK_TYPE_UPDATE", - 3: "HOOK_TYPE_POSTRECEIVE", - } - CustomHookError_HookType_value = map[string]int32{ - "HOOK_TYPE_UNSPECIFIED": 0, - "HOOK_TYPE_PRERECEIVE": 1, - "HOOK_TYPE_UPDATE": 2, - "HOOK_TYPE_POSTRECEIVE": 3, - } -) - -func (x CustomHookError_HookType) Enum() *CustomHookError_HookType { - p := new(CustomHookError_HookType) - *p = x - return p -} - -func (x CustomHookError_HookType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (CustomHookError_HookType) Descriptor() protoreflect.EnumDescriptor { - return file_errors_proto_enumTypes[1].Descriptor() -} - -func (CustomHookError_HookType) Type() protoreflect.EnumType { - return &file_errors_proto_enumTypes[1] -} - -func (x CustomHookError_HookType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use CustomHookError_HookType.Descriptor instead. -func (CustomHookError_HookType) EnumDescriptor() ([]byte, []int) { - return file_errors_proto_rawDescGZIP(), []int{13, 0} -} - -type PathError_ErrorType int32 - -const ( - PathError_ERROR_TYPE_UNSPECIFIED PathError_ErrorType = 0 - PathError_ERROR_TYPE_EMPTY_PATH PathError_ErrorType = 1 - PathError_ERROR_TYPE_RELATIVE_PATH_ESCAPES_REPOSITORY PathError_ErrorType = 2 - PathError_ERROR_TYPE_ABSOLUTE_PATH PathError_ErrorType = 3 - PathError_ERROR_TYPE_LONG_PATH PathError_ErrorType = 4 -) - -// Enum value maps for PathError_ErrorType. -var ( - PathError_ErrorType_name = map[int32]string{ - 0: "ERROR_TYPE_UNSPECIFIED", - 1: "ERROR_TYPE_EMPTY_PATH", - 2: "ERROR_TYPE_RELATIVE_PATH_ESCAPES_REPOSITORY", - 3: "ERROR_TYPE_ABSOLUTE_PATH", - 4: "ERROR_TYPE_LONG_PATH", - } - PathError_ErrorType_value = map[string]int32{ - "ERROR_TYPE_UNSPECIFIED": 0, - "ERROR_TYPE_EMPTY_PATH": 1, - "ERROR_TYPE_RELATIVE_PATH_ESCAPES_REPOSITORY": 2, - "ERROR_TYPE_ABSOLUTE_PATH": 3, - "ERROR_TYPE_LONG_PATH": 4, - } -) - -func (x PathError_ErrorType) Enum() *PathError_ErrorType { - p := new(PathError_ErrorType) - *p = x - return p -} - -func (x PathError_ErrorType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (PathError_ErrorType) Descriptor() protoreflect.EnumDescriptor { - return file_errors_proto_enumTypes[2].Descriptor() -} - -func (PathError_ErrorType) Type() protoreflect.EnumType { - return &file_errors_proto_enumTypes[2] -} - -func (x PathError_ErrorType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use PathError_ErrorType.Descriptor instead. -func (PathError_ErrorType) EnumDescriptor() ([]byte, []int) { - return file_errors_proto_rawDescGZIP(), []int{14, 0} -} - -type AccessCheckError struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ErrorMessage string `protobuf:"bytes,1,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` - Protocol string `protobuf:"bytes,2,opt,name=protocol,proto3" json:"protocol,omitempty"` - UserId string `protobuf:"bytes,3,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - Changes []byte `protobuf:"bytes,4,opt,name=changes,proto3" json:"changes,omitempty"` -} - -func (x *AccessCheckError) Reset() { - *x = AccessCheckError{} - if protoimpl.UnsafeEnabled { - mi := &file_errors_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AccessCheckError) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AccessCheckError) ProtoMessage() {} - -func (x *AccessCheckError) ProtoReflect() protoreflect.Message { - mi := &file_errors_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 AccessCheckError.ProtoReflect.Descriptor instead. -func (*AccessCheckError) Descriptor() ([]byte, []int) { - return file_errors_proto_rawDescGZIP(), []int{0} -} - -func (x *AccessCheckError) GetErrorMessage() string { - if x != nil { - return x.ErrorMessage - } - return "" -} - -func (x *AccessCheckError) GetProtocol() string { - if x != nil { - return x.Protocol - } - return "" -} - -func (x *AccessCheckError) GetUserId() string { - if x != nil { - return x.UserId - } - return "" -} - -func (x *AccessCheckError) GetChanges() []byte { - if x != nil { - return x.Changes - } - return nil -} - -type IndexError struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Path []byte `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - ErrorType IndexError_ErrorType `protobuf:"varint,2,opt,name=error_type,json=errorType,proto3,enum=gitaly.IndexError_ErrorType" json:"error_type,omitempty"` -} - -func (x *IndexError) Reset() { - *x = IndexError{} - if protoimpl.UnsafeEnabled { - mi := &file_errors_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *IndexError) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*IndexError) ProtoMessage() {} - -func (x *IndexError) ProtoReflect() protoreflect.Message { - mi := &file_errors_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 IndexError.ProtoReflect.Descriptor instead. -func (*IndexError) Descriptor() ([]byte, []int) { - return file_errors_proto_rawDescGZIP(), []int{1} -} - -func (x *IndexError) GetPath() []byte { - if x != nil { - return x.Path - } - return nil -} - -func (x *IndexError) GetErrorType() IndexError_ErrorType { - if x != nil { - return x.ErrorType - } - return IndexError_ERROR_TYPE_UNSPECIFIED -} - -type InvalidRefFormatError struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Refs [][]byte `protobuf:"bytes,2,rep,name=refs,proto3" json:"refs,omitempty"` -} - -func (x *InvalidRefFormatError) Reset() { - *x = InvalidRefFormatError{} - if protoimpl.UnsafeEnabled { - mi := &file_errors_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *InvalidRefFormatError) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InvalidRefFormatError) ProtoMessage() {} - -func (x *InvalidRefFormatError) ProtoReflect() protoreflect.Message { - mi := &file_errors_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 InvalidRefFormatError.ProtoReflect.Descriptor instead. -func (*InvalidRefFormatError) Descriptor() ([]byte, []int) { - return file_errors_proto_rawDescGZIP(), []int{2} -} - -func (x *InvalidRefFormatError) GetRefs() [][]byte { - if x != nil { - return x.Refs - } - return nil -} - -type NotAncestorError struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ParentRevision []byte `protobuf:"bytes,1,opt,name=parent_revision,json=parentRevision,proto3" json:"parent_revision,omitempty"` - ChildRevision []byte `protobuf:"bytes,2,opt,name=child_revision,json=childRevision,proto3" json:"child_revision,omitempty"` -} - -func (x *NotAncestorError) Reset() { - *x = NotAncestorError{} - if protoimpl.UnsafeEnabled { - mi := &file_errors_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NotAncestorError) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NotAncestorError) ProtoMessage() {} - -func (x *NotAncestorError) ProtoReflect() protoreflect.Message { - mi := &file_errors_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 NotAncestorError.ProtoReflect.Descriptor instead. -func (*NotAncestorError) Descriptor() ([]byte, []int) { - return file_errors_proto_rawDescGZIP(), []int{3} -} - -func (x *NotAncestorError) GetParentRevision() []byte { - if x != nil { - return x.ParentRevision - } - return nil -} - -func (x *NotAncestorError) GetChildRevision() []byte { - if x != nil { - return x.ChildRevision - } - return nil -} - -type ChangesAlreadyAppliedError struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *ChangesAlreadyAppliedError) Reset() { - *x = ChangesAlreadyAppliedError{} - if protoimpl.UnsafeEnabled { - mi := &file_errors_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ChangesAlreadyAppliedError) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangesAlreadyAppliedError) ProtoMessage() {} - -func (x *ChangesAlreadyAppliedError) ProtoReflect() protoreflect.Message { - mi := &file_errors_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 ChangesAlreadyAppliedError.ProtoReflect.Descriptor instead. -func (*ChangesAlreadyAppliedError) Descriptor() ([]byte, []int) { - return file_errors_proto_rawDescGZIP(), []int{4} -} - -type MergeConflictError struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ConflictingFiles [][]byte `protobuf:"bytes,1,rep,name=conflicting_files,json=conflictingFiles,proto3" json:"conflicting_files,omitempty"` - ConflictingCommitIds []string `protobuf:"bytes,2,rep,name=conflicting_commit_ids,json=conflictingCommitIds,proto3" json:"conflicting_commit_ids,omitempty"` -} - -func (x *MergeConflictError) Reset() { - *x = MergeConflictError{} - if protoimpl.UnsafeEnabled { - mi := &file_errors_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MergeConflictError) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MergeConflictError) ProtoMessage() {} - -func (x *MergeConflictError) ProtoReflect() protoreflect.Message { - mi := &file_errors_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 MergeConflictError.ProtoReflect.Descriptor instead. -func (*MergeConflictError) Descriptor() ([]byte, []int) { - return file_errors_proto_rawDescGZIP(), []int{5} -} - -func (x *MergeConflictError) GetConflictingFiles() [][]byte { - if x != nil { - return x.ConflictingFiles - } - return nil -} - -func (x *MergeConflictError) GetConflictingCommitIds() []string { - if x != nil { - return x.ConflictingCommitIds - } - return nil -} - -type ReferencesLockedError struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Refs [][]byte `protobuf:"bytes,1,rep,name=refs,proto3" json:"refs,omitempty"` -} - -func (x *ReferencesLockedError) Reset() { - *x = ReferencesLockedError{} - if protoimpl.UnsafeEnabled { - mi := &file_errors_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ReferencesLockedError) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ReferencesLockedError) ProtoMessage() {} - -func (x *ReferencesLockedError) ProtoReflect() protoreflect.Message { - mi := &file_errors_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 ReferencesLockedError.ProtoReflect.Descriptor instead. -func (*ReferencesLockedError) Descriptor() ([]byte, []int) { - return file_errors_proto_rawDescGZIP(), []int{6} -} - -func (x *ReferencesLockedError) GetRefs() [][]byte { - if x != nil { - return x.Refs - } - return nil -} - -type ReferenceExistsError struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ReferenceName []byte `protobuf:"bytes,1,opt,name=reference_name,json=referenceName,proto3" json:"reference_name,omitempty"` - Oid string `protobuf:"bytes,2,opt,name=oid,proto3" json:"oid,omitempty"` -} - -func (x *ReferenceExistsError) Reset() { - *x = ReferenceExistsError{} - if protoimpl.UnsafeEnabled { - mi := &file_errors_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ReferenceExistsError) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ReferenceExistsError) ProtoMessage() {} - -func (x *ReferenceExistsError) ProtoReflect() protoreflect.Message { - mi := &file_errors_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 ReferenceExistsError.ProtoReflect.Descriptor instead. -func (*ReferenceExistsError) Descriptor() ([]byte, []int) { - return file_errors_proto_rawDescGZIP(), []int{7} -} - -func (x *ReferenceExistsError) GetReferenceName() []byte { - if x != nil { - return x.ReferenceName - } - return nil -} - -func (x *ReferenceExistsError) GetOid() string { - if x != nil { - return x.Oid - } - return "" -} - -type ReferenceNotFoundError struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ReferenceName []byte `protobuf:"bytes,1,opt,name=reference_name,json=referenceName,proto3" json:"reference_name,omitempty"` -} - -func (x *ReferenceNotFoundError) Reset() { - *x = ReferenceNotFoundError{} - if protoimpl.UnsafeEnabled { - mi := &file_errors_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ReferenceNotFoundError) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ReferenceNotFoundError) ProtoMessage() {} - -func (x *ReferenceNotFoundError) ProtoReflect() protoreflect.Message { - mi := &file_errors_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 ReferenceNotFoundError.ProtoReflect.Descriptor instead. -func (*ReferenceNotFoundError) Descriptor() ([]byte, []int) { - return file_errors_proto_rawDescGZIP(), []int{8} -} - -func (x *ReferenceNotFoundError) GetReferenceName() []byte { - if x != nil { - return x.ReferenceName - } - return nil -} - -type ReferenceStateMismatchError struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ReferenceName []byte `protobuf:"bytes,1,opt,name=reference_name,json=referenceName,proto3" json:"reference_name,omitempty"` - ExpectedObjectId []byte `protobuf:"bytes,2,opt,name=expected_object_id,json=expectedObjectId,proto3" json:"expected_object_id,omitempty"` - ActualObjectId []byte `protobuf:"bytes,3,opt,name=actual_object_id,json=actualObjectId,proto3" json:"actual_object_id,omitempty"` -} - -func (x *ReferenceStateMismatchError) Reset() { - *x = ReferenceStateMismatchError{} - if protoimpl.UnsafeEnabled { - mi := &file_errors_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ReferenceStateMismatchError) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ReferenceStateMismatchError) ProtoMessage() {} - -func (x *ReferenceStateMismatchError) ProtoReflect() protoreflect.Message { - mi := &file_errors_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 ReferenceStateMismatchError.ProtoReflect.Descriptor instead. -func (*ReferenceStateMismatchError) Descriptor() ([]byte, []int) { - return file_errors_proto_rawDescGZIP(), []int{9} -} - -func (x *ReferenceStateMismatchError) GetReferenceName() []byte { - if x != nil { - return x.ReferenceName - } - return nil -} - -func (x *ReferenceStateMismatchError) GetExpectedObjectId() []byte { - if x != nil { - return x.ExpectedObjectId - } - return nil -} - -func (x *ReferenceStateMismatchError) GetActualObjectId() []byte { - if x != nil { - return x.ActualObjectId - } - return nil -} - -type ReferenceUpdateError struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ReferenceName []byte `protobuf:"bytes,1,opt,name=reference_name,json=referenceName,proto3" json:"reference_name,omitempty"` - OldOid string `protobuf:"bytes,2,opt,name=old_oid,json=oldOid,proto3" json:"old_oid,omitempty"` - NewOid string `protobuf:"bytes,3,opt,name=new_oid,json=newOid,proto3" json:"new_oid,omitempty"` -} - -func (x *ReferenceUpdateError) Reset() { - *x = ReferenceUpdateError{} - if protoimpl.UnsafeEnabled { - mi := &file_errors_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ReferenceUpdateError) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ReferenceUpdateError) ProtoMessage() {} - -func (x *ReferenceUpdateError) ProtoReflect() protoreflect.Message { - mi := &file_errors_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 ReferenceUpdateError.ProtoReflect.Descriptor instead. -func (*ReferenceUpdateError) Descriptor() ([]byte, []int) { - return file_errors_proto_rawDescGZIP(), []int{10} -} - -func (x *ReferenceUpdateError) GetReferenceName() []byte { - if x != nil { - return x.ReferenceName - } - return nil -} - -func (x *ReferenceUpdateError) GetOldOid() string { - if x != nil { - return x.OldOid - } - return "" -} - -func (x *ReferenceUpdateError) GetNewOid() string { - if x != nil { - return x.NewOid - } - return "" -} - -type ResolveRevisionError struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Revision []byte `protobuf:"bytes,1,opt,name=revision,proto3" json:"revision,omitempty"` -} - -func (x *ResolveRevisionError) Reset() { - *x = ResolveRevisionError{} - if protoimpl.UnsafeEnabled { - mi := &file_errors_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ResolveRevisionError) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ResolveRevisionError) ProtoMessage() {} - -func (x *ResolveRevisionError) ProtoReflect() protoreflect.Message { - mi := &file_errors_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 ResolveRevisionError.ProtoReflect.Descriptor instead. -func (*ResolveRevisionError) Descriptor() ([]byte, []int) { - return file_errors_proto_rawDescGZIP(), []int{11} -} - -func (x *ResolveRevisionError) GetRevision() []byte { - if x != nil { - return x.Revision - } - return nil -} - -type LimitError struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ErrorMessage string `protobuf:"bytes,1,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` - RetryAfter *durationpb.Duration `protobuf:"bytes,2,opt,name=retry_after,json=retryAfter,proto3" json:"retry_after,omitempty"` -} - -func (x *LimitError) Reset() { - *x = LimitError{} - if protoimpl.UnsafeEnabled { - mi := &file_errors_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *LimitError) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LimitError) ProtoMessage() {} - -func (x *LimitError) ProtoReflect() protoreflect.Message { - mi := &file_errors_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 LimitError.ProtoReflect.Descriptor instead. -func (*LimitError) Descriptor() ([]byte, []int) { - return file_errors_proto_rawDescGZIP(), []int{12} -} - -func (x *LimitError) GetErrorMessage() string { - if x != nil { - return x.ErrorMessage - } - return "" -} - -func (x *LimitError) GetRetryAfter() *durationpb.Duration { - if x != nil { - return x.RetryAfter - } - return nil -} - -type CustomHookError struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Stdout []byte `protobuf:"bytes,1,opt,name=stdout,proto3" json:"stdout,omitempty"` - Stderr []byte `protobuf:"bytes,2,opt,name=stderr,proto3" json:"stderr,omitempty"` - HookType CustomHookError_HookType `protobuf:"varint,3,opt,name=hook_type,json=hookType,proto3,enum=gitaly.CustomHookError_HookType" json:"hook_type,omitempty"` -} - -func (x *CustomHookError) Reset() { - *x = CustomHookError{} - if protoimpl.UnsafeEnabled { - mi := &file_errors_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CustomHookError) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CustomHookError) ProtoMessage() {} - -func (x *CustomHookError) ProtoReflect() protoreflect.Message { - mi := &file_errors_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 CustomHookError.ProtoReflect.Descriptor instead. -func (*CustomHookError) Descriptor() ([]byte, []int) { - return file_errors_proto_rawDescGZIP(), []int{13} -} - -func (x *CustomHookError) GetStdout() []byte { - if x != nil { - return x.Stdout - } - return nil -} - -func (x *CustomHookError) GetStderr() []byte { - if x != nil { - return x.Stderr - } - return nil -} - -func (x *CustomHookError) GetHookType() CustomHookError_HookType { - if x != nil { - return x.HookType - } - return CustomHookError_HOOK_TYPE_UNSPECIFIED -} - -type PathError struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Path []byte `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - ErrorType PathError_ErrorType `protobuf:"varint,2,opt,name=error_type,json=errorType,proto3,enum=gitaly.PathError_ErrorType" json:"error_type,omitempty"` -} - -func (x *PathError) Reset() { - *x = PathError{} - if protoimpl.UnsafeEnabled { - mi := &file_errors_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PathError) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PathError) ProtoMessage() {} - -func (x *PathError) ProtoReflect() protoreflect.Message { - mi := &file_errors_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 PathError.ProtoReflect.Descriptor instead. -func (*PathError) Descriptor() ([]byte, []int) { - return file_errors_proto_rawDescGZIP(), []int{14} -} - -func (x *PathError) GetPath() []byte { - if x != nil { - return x.Path - } - return nil -} - -func (x *PathError) GetErrorType() PathError_ErrorType { - if x != nil { - return x.ErrorType - } - return PathError_ERROR_TYPE_UNSPECIFIED -} - -var File_errors_proto protoreflect.FileDescriptor - -var file_errors_proto_rawDesc = []byte{ - 0x0a, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, - 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x86, 0x01, 0x0a, 0x10, 0x41, 0x63, 0x63, 0x65, 0x73, - 0x73, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x65, - 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x17, 0x0a, 0x07, - 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, - 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x22, - 0xbf, 0x02, 0x0a, 0x0a, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x12, - 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x70, 0x61, - 0x74, 0x68, 0x12, 0x3b, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, - 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x22, - 0xdf, 0x01, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, - 0x16, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, - 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, 0x45, 0x52, 0x52, - 0x4f, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4d, 0x50, 0x54, 0x59, 0x5f, 0x50, 0x41, - 0x54, 0x48, 0x10, 0x01, 0x12, 0x1b, 0x0a, 0x17, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x54, 0x59, - 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x50, 0x41, 0x54, 0x48, 0x10, - 0x02, 0x12, 0x1f, 0x0a, 0x1b, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, - 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x4f, 0x52, 0x59, 0x5f, 0x45, 0x58, 0x49, 0x53, 0x54, 0x53, - 0x10, 0x03, 0x12, 0x22, 0x0a, 0x1e, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, - 0x5f, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x4f, 0x52, 0x59, 0x5f, 0x54, 0x52, 0x41, 0x56, 0x45, - 0x52, 0x53, 0x41, 0x4c, 0x10, 0x04, 0x12, 0x1a, 0x0a, 0x16, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, - 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x4c, 0x45, 0x5f, 0x45, 0x58, 0x49, 0x53, 0x54, 0x53, - 0x10, 0x05, 0x12, 0x1d, 0x0a, 0x19, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, - 0x5f, 0x46, 0x49, 0x4c, 0x45, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, - 0x06, 0x22, 0x2b, 0x0a, 0x15, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x52, 0x65, 0x66, 0x46, - 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x65, - 0x66, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x04, 0x72, 0x65, 0x66, 0x73, 0x22, 0x62, - 0x0a, 0x10, 0x4e, 0x6f, 0x74, 0x41, 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x45, 0x72, 0x72, - 0x6f, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x76, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x70, 0x61, 0x72, - 0x65, 0x6e, 0x74, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x63, - 0x68, 0x69, 0x6c, 0x64, 0x5f, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, - 0x6f, 0x6e, 0x22, 0x1c, 0x0a, 0x1a, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x41, 0x6c, 0x72, - 0x65, 0x61, 0x64, 0x79, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x64, 0x45, 0x72, 0x72, 0x6f, 0x72, - 0x22, 0x77, 0x0a, 0x12, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x6c, 0x69, 0x63, - 0x74, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x6f, 0x6e, 0x66, 0x6c, 0x69, - 0x63, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0c, 0x52, 0x10, 0x63, 0x6f, 0x6e, 0x66, 0x6c, 0x69, 0x63, 0x74, 0x69, 0x6e, 0x67, 0x46, 0x69, - 0x6c, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x16, 0x63, 0x6f, 0x6e, 0x66, 0x6c, 0x69, 0x63, 0x74, 0x69, - 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x14, 0x63, 0x6f, 0x6e, 0x66, 0x6c, 0x69, 0x63, 0x74, 0x69, 0x6e, 0x67, - 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x64, 0x73, 0x22, 0x2b, 0x0a, 0x15, 0x52, 0x65, 0x66, - 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x45, 0x72, 0x72, - 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x65, 0x66, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, - 0x52, 0x04, 0x72, 0x65, 0x66, 0x73, 0x22, 0x4f, 0x0a, 0x14, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, - 0x6e, 0x63, 0x65, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x25, - 0x0a, 0x0e, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, - 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6f, 0x69, 0x64, 0x22, 0x3f, 0x0a, 0x16, 0x52, 0x65, 0x66, 0x65, 0x72, - 0x65, 0x6e, 0x63, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x72, 0x72, 0x6f, - 0x72, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x72, 0x65, 0x66, 0x65, 0x72, - 0x65, 0x6e, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x9c, 0x01, 0x0a, 0x1b, 0x52, 0x65, 0x66, - 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x4d, 0x69, 0x73, 0x6d, 0x61, - 0x74, 0x63, 0x68, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x66, 0x65, - 0x72, 0x65, 0x6e, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x0d, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x2c, 0x0a, 0x12, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x65, 0x78, 0x70, - 0x65, 0x63, 0x74, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x28, 0x0a, - 0x10, 0x61, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, - 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x61, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x22, 0x6f, 0x0a, 0x14, 0x52, 0x65, 0x66, 0x65, 0x72, - 0x65, 0x6e, 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, - 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, - 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x6f, 0x6c, 0x64, 0x5f, 0x6f, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x6c, 0x64, 0x4f, 0x69, 0x64, 0x12, - 0x17, 0x0a, 0x07, 0x6e, 0x65, 0x77, 0x5f, 0x6f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x6e, 0x65, 0x77, 0x4f, 0x69, 0x64, 0x22, 0x32, 0x0a, 0x14, 0x52, 0x65, 0x73, 0x6f, - 0x6c, 0x76, 0x65, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, - 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x6d, 0x0a, 0x0a, - 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x72, - 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, - 0x3a, 0x0a, 0x0b, 0x72, 0x65, 0x74, 0x72, 0x79, 0x5f, 0x61, 0x66, 0x74, 0x65, 0x72, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x0a, 0x72, 0x65, 0x74, 0x72, 0x79, 0x41, 0x66, 0x74, 0x65, 0x72, 0x22, 0xf2, 0x01, 0x0a, 0x0f, - 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x48, 0x6f, 0x6f, 0x6b, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, - 0x16, 0x0a, 0x06, 0x73, 0x74, 0x64, 0x6f, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x06, 0x73, 0x74, 0x64, 0x6f, 0x75, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x64, 0x65, 0x72, - 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x74, 0x64, 0x65, 0x72, 0x72, 0x12, - 0x3d, 0x0a, 0x09, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x43, 0x75, 0x73, 0x74, - 0x6f, 0x6d, 0x48, 0x6f, 0x6f, 0x6b, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, - 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x68, 0x6f, 0x6f, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x22, 0x70, - 0x0a, 0x08, 0x48, 0x6f, 0x6f, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x15, 0x48, 0x4f, - 0x4f, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, - 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x14, 0x48, 0x4f, 0x4f, 0x4b, 0x5f, 0x54, 0x59, - 0x50, 0x45, 0x5f, 0x50, 0x52, 0x45, 0x52, 0x45, 0x43, 0x45, 0x49, 0x56, 0x45, 0x10, 0x01, 0x12, - 0x14, 0x0a, 0x10, 0x48, 0x4f, 0x4f, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x50, 0x44, - 0x41, 0x54, 0x45, 0x10, 0x02, 0x12, 0x19, 0x0a, 0x15, 0x48, 0x4f, 0x4f, 0x4b, 0x5f, 0x54, 0x59, - 0x50, 0x45, 0x5f, 0x50, 0x4f, 0x53, 0x54, 0x52, 0x45, 0x43, 0x45, 0x49, 0x56, 0x45, 0x10, 0x03, - 0x22, 0x89, 0x02, 0x0a, 0x09, 0x50, 0x61, 0x74, 0x68, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x12, - 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x70, 0x61, - 0x74, 0x68, 0x12, 0x3a, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, - 0x50, 0x61, 0x74, 0x68, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x54, - 0x79, 0x70, 0x65, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x22, 0xab, - 0x01, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x16, - 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, - 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, 0x45, 0x52, 0x52, 0x4f, - 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4d, 0x50, 0x54, 0x59, 0x5f, 0x50, 0x41, 0x54, - 0x48, 0x10, 0x01, 0x12, 0x2f, 0x0a, 0x2b, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x52, 0x45, 0x4c, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5f, 0x50, 0x41, 0x54, 0x48, 0x5f, - 0x45, 0x53, 0x43, 0x41, 0x50, 0x45, 0x53, 0x5f, 0x52, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x4f, - 0x52, 0x59, 0x10, 0x02, 0x12, 0x1c, 0x0a, 0x18, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x54, 0x59, - 0x50, 0x45, 0x5f, 0x41, 0x42, 0x53, 0x4f, 0x4c, 0x55, 0x54, 0x45, 0x5f, 0x50, 0x41, 0x54, 0x48, - 0x10, 0x03, 0x12, 0x18, 0x0a, 0x14, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, - 0x5f, 0x4c, 0x4f, 0x4e, 0x47, 0x5f, 0x50, 0x41, 0x54, 0x48, 0x10, 0x04, 0x42, 0x5e, 0x5a, 0x5c, - 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x69, 0x74, 0x6c, 0x61, - 0x62, 0x2d, 0x6f, 0x72, 0x67, 0x2f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2d, 0x69, 0x6e, - 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, - 0x2d, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x36, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2f, 0x76, 0x65, 0x6e, 0x64, 0x6f, - 0x72, 0x65, 0x64, 0x2f, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_errors_proto_rawDescOnce sync.Once - file_errors_proto_rawDescData = file_errors_proto_rawDesc -) - -func file_errors_proto_rawDescGZIP() []byte { - file_errors_proto_rawDescOnce.Do(func() { - file_errors_proto_rawDescData = protoimpl.X.CompressGZIP(file_errors_proto_rawDescData) - }) - return file_errors_proto_rawDescData -} - -var file_errors_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_errors_proto_msgTypes = make([]protoimpl.MessageInfo, 15) -var file_errors_proto_goTypes = []interface{}{ - (IndexError_ErrorType)(0), // 0: gitaly.IndexError.ErrorType - (CustomHookError_HookType)(0), // 1: gitaly.CustomHookError.HookType - (PathError_ErrorType)(0), // 2: gitaly.PathError.ErrorType - (*AccessCheckError)(nil), // 3: gitaly.AccessCheckError - (*IndexError)(nil), // 4: gitaly.IndexError - (*InvalidRefFormatError)(nil), // 5: gitaly.InvalidRefFormatError - (*NotAncestorError)(nil), // 6: gitaly.NotAncestorError - (*ChangesAlreadyAppliedError)(nil), // 7: gitaly.ChangesAlreadyAppliedError - (*MergeConflictError)(nil), // 8: gitaly.MergeConflictError - (*ReferencesLockedError)(nil), // 9: gitaly.ReferencesLockedError - (*ReferenceExistsError)(nil), // 10: gitaly.ReferenceExistsError - (*ReferenceNotFoundError)(nil), // 11: gitaly.ReferenceNotFoundError - (*ReferenceStateMismatchError)(nil), // 12: gitaly.ReferenceStateMismatchError - (*ReferenceUpdateError)(nil), // 13: gitaly.ReferenceUpdateError - (*ResolveRevisionError)(nil), // 14: gitaly.ResolveRevisionError - (*LimitError)(nil), // 15: gitaly.LimitError - (*CustomHookError)(nil), // 16: gitaly.CustomHookError - (*PathError)(nil), // 17: gitaly.PathError - (*durationpb.Duration)(nil), // 18: google.protobuf.Duration -} -var file_errors_proto_depIdxs = []int32{ - 0, // 0: gitaly.IndexError.error_type:type_name -> gitaly.IndexError.ErrorType - 18, // 1: gitaly.LimitError.retry_after:type_name -> google.protobuf.Duration - 1, // 2: gitaly.CustomHookError.hook_type:type_name -> gitaly.CustomHookError.HookType - 2, // 3: gitaly.PathError.error_type:type_name -> gitaly.PathError.ErrorType - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name -} - -func init() { file_errors_proto_init() } -func file_errors_proto_init() { - if File_errors_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_errors_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AccessCheckError); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_errors_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*IndexError); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_errors_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InvalidRefFormatError); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_errors_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NotAncestorError); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_errors_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChangesAlreadyAppliedError); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_errors_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MergeConflictError); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_errors_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReferencesLockedError); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_errors_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReferenceExistsError); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_errors_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReferenceNotFoundError); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_errors_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReferenceStateMismatchError); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_errors_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReferenceUpdateError); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_errors_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResolveRevisionError); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_errors_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LimitError); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_errors_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CustomHookError); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_errors_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PathError); 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_errors_proto_rawDesc, - NumEnums: 3, - NumMessages: 15, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_errors_proto_goTypes, - DependencyIndexes: file_errors_proto_depIdxs, - EnumInfos: file_errors_proto_enumTypes, - MessageInfos: file_errors_proto_msgTypes, - }.Build() - File_errors_proto = out.File - file_errors_proto_rawDesc = nil - file_errors_proto_goTypes = nil - file_errors_proto_depIdxs = nil -} diff --git a/internal/gitaly/vendored/gitalypb/errors.proto b/internal/gitaly/vendored/gitalypb/errors.proto deleted file mode 100644 index 55ac4cad..00000000 --- a/internal/gitaly/vendored/gitalypb/errors.proto +++ /dev/null @@ -1,201 +0,0 @@ -syntax = "proto3"; - -package gitaly; - -import "google/protobuf/duration.proto"; - -option go_package = "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/gitalypb"; - -// AccessCheckError is an error returned by GitLab's `/internal/allowed` -// endpoint. -message AccessCheckError { - // ErrorMessage is the error message as returned by the endpoint. - string error_message = 1; - // Protocol is the protocol used. - string protocol = 2; - // UserId is the user ID as which changes had been pushed. - string user_id = 3; - // Changes is the set of changes which have failed the access check. - bytes changes = 4; -} - -// IndexError is an error returned when an operation fails to due a conflict with -// the repository index. -message IndexError { - // ErrorType is the type of error encountered on the index operation. - enum ErrorType { - // ERROR_TYPE_UNSPECIFIED is the default error type and should never be set. - ERROR_TYPE_UNSPECIFIED = 0; - // ERROR_TYPE_EMPTY_PATH indicates an empty path was provided by the caller. - ERROR_TYPE_EMPTY_PATH = 1; - // ERROR_TYPE_INVALID_PATH indicates a path either contained '.git', or was - // incorrectly formated, e.g. invalid://file/path. - ERROR_TYPE_INVALID_PATH = 2; - // ERROR_TYPE_DIRECTORY_EXISTS indicates the directory being created already exists. - ERROR_TYPE_DIRECTORY_EXISTS = 3; - // ERROR_TYPE_DIRECTORY_TRAVERSAL indicates the path contains a directory traversal - // sequence. - ERROR_TYPE_DIRECTORY_TRAVERSAL = 4; - // ERROR_TYPE_FILE_EXISTS indicates the file being created already exists. - ERROR_TYPE_FILE_EXISTS = 5; - // ERROR_TYPE_FILE_NOT_FOUND indicates the file being updated does not exist. - ERROR_TYPE_FILE_NOT_FOUND = 6; - }; - - // Path is the file or directory path that triggered the error. - bytes path = 1; - // ErrorType is the type of index error that occurred. - ErrorType error_type = 2; -} - -// InvalidRefFormatError is an error returned when refs have an invalid format. -message InvalidRefFormatError { - // Refs are the offending refs with invalid formats. - repeated bytes refs = 2; -} - -// NotAncestorError is an error returned when parent_revision is not an ancestor -// of the child_revision. -message NotAncestorError { - // ParentRevision is the revision checked against ChildRevision for whether it - // is an ancestor of ChildRevision - bytes parent_revision = 1; - // ChildRevision is the revision checked against ParentRevision for whether - // it is a descendent of ChildRevision. - bytes child_revision = 2; -} - -// ChangesAlreadyAppliedError is an error returned when the operation would -// have resulted in no changes because these changes have already been applied. -message ChangesAlreadyAppliedError { -} - -// MergeConflictError is an error returned in the case when merging two commits -// fails due to a merge conflict. -message MergeConflictError { - // ConflictingFiles is the set of files which have been conflicting. If this - // field is empty, then there has still been a merge conflict, but it wasn't - // able to determine which files have been conflicting. - repeated bytes conflicting_files = 1; - // ConflictingCommitIds is the set of commit IDs that caused the conflict. In the general case, - // this should be set to two commit IDs. - repeated string conflicting_commit_ids = 2; -} - -// ReferencesLockedError is an error returned when an ref update fails because -// the references have already been locked by another process. -message ReferencesLockedError { - // Refs are the references that could not be locked. - repeated bytes refs = 1; -} - -// ReferenceExistsError is an error returned when a reference that ought not to exist does exist -// already. -message ReferenceExistsError { - // ReferenceName is the name of the reference that exists already. - bytes reference_name = 1; - // Oid is the object ID of the reference that preexists already. - string oid = 2; -} - -// ReferenceNotFoundError is an error retruned when a reference that ought to exist does not exist. -message ReferenceNotFoundError { - // ReferenceName is the name of the reference that does not exist. - bytes reference_name = 1; -} - -// ReferenceStateMismatchError is an error returned when updating a reference fails because its pointing to a different -// object ID than expected. -message ReferenceStateMismatchError { - // ReferenceName is the name of the reference that was failed to update. - bytes reference_name = 1; - // ExpectedObjectId is the object ID that the reference was expected to point to but didn't. - bytes expected_object_id = 2; - // ActualObjectId is the object ID that the reference actually pointed to at the time when it was tried to be - // updated. - bytes actual_object_id = 3; -} - -// ReferenceUpdateError is an error returned when updating a reference has -// failed. -message ReferenceUpdateError { - // ReferenceName is the name of the reference that failed to be updated. - bytes reference_name = 1; - // OldOid is the object ID the reference should have pointed to before the update. - string old_oid = 2; - // NewOid is the object ID the reference should have pointed to after the update. - string new_oid = 3; -} - -// ResolveRevisionError is an error returned when resolving a specific revision -// has failed. -message ResolveRevisionError { - // Revision is the name of the revision that was tried to be resolved. - bytes revision = 1; -} - -// LimitError is an error returned when Gitaly enforces request limits. -message LimitError { - // ErrorMessage provides context into why a limit was enforced. - string error_message = 1; - // RetryAfter provides the duration after which a retry is safe. - // 0 indicates non-retryable. - google.protobuf.Duration retry_after = 2; -} - -// CustomHookError is an error returned when Gitaly executes a custom hook and the hook returns -// a non-zero return code. -message CustomHookError { - // HookType is the type of the hook that has been running. Please consult githooks(5) for more - // information about the specific types. - enum HookType { - // HOOK_TYPE_UNSPECIFIED is the default hook type and should never be set. - HOOK_TYPE_UNSPECIFIED = 0; - // HOOK_TYPE_PRERECEIVE is executed after all changes have been written into a temporary staging - // directory, but before any references in the repository have been updated. It is executed with - // all references that are about to be updated at once. If this hook exits, then no references - // will have been updated in the repository and staged objects will have been discarded. - HOOK_TYPE_PRERECEIVE = 1; - // HOOK_TYPE_UPDATE is executed after the pre-receive hook. It is executed per reference that is - // about to be updated and can be used to reject only a subset of reference updates. If this - // hook error is raised then a subset of references may have already been updated. - HOOK_TYPE_UPDATE = 2; - // HOOK_TYPE_POSTRECEIVE is executed after objects have been migrated into the repository and - // after references have been updated. An error in this hook will not impact the changes - // anymore as everything has already been persisted. - HOOK_TYPE_POSTRECEIVE = 3; - }; - - // Stdout is the standard output of the hook that has failed, if any. Data may be truncated. - bytes stdout = 1; - // Stderr is the standard error of the hook that has failed, if any. Data may be truncated. - bytes stderr = 2; - // HookType is the type of the hook. - HookType hook_type = 3; -} - -// PathError is an error returned when there is an issue with the path provided. -message PathError { - // ErrorType is the type of error encountered. - enum ErrorType { - // PathError_ERROR_TYPE_UNSPECIFIED is the default error type and should never be set. - ERROR_TYPE_UNSPECIFIED = 0; - // PathError_ERROR_TYPE_EMPTY_PATH is the error type when the provided path is empty. - ERROR_TYPE_EMPTY_PATH = 1; - // PathError_ERROR_TYPE_RELATIVE_PATH_ESCAPES_REPOSITORY is the error type when there are - // traversing components found in the path and it either escapes the repository or is not - // supported by the RPC. - ERROR_TYPE_RELATIVE_PATH_ESCAPES_REPOSITORY = 2; - // PathError_ERROR_TYPE_ABSOLUTE_PATH is the error type when an absolute path is provided - // while a relative path was expected. - ERROR_TYPE_ABSOLUTE_PATH = 3; - // PathError_ERROR_TYPE_LONG_PATH is the error type when the path is too long. - ERROR_TYPE_LONG_PATH = 4; - }; - - // Path is the file or directory path that triggered the error. The path may be - // truncated due to size limits. - bytes path = 1; - // ErrorType is the type of path error that occurred. - ErrorType error_type = 2; -} diff --git a/internal/gitaly/vendored/gitalypb/lint.pb.go b/internal/gitaly/vendored/gitalypb/lint.pb.go deleted file mode 100644 index bf105efa..00000000 --- a/internal/gitaly/vendored/gitalypb/lint.pb.go +++ /dev/null @@ -1,389 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc v3.21.7 -// source: lint.proto - -package gitalypb - -import ( - reflect "reflect" - sync "sync" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - descriptorpb "google.golang.org/protobuf/types/descriptorpb" -) - -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 OperationMsg_Operation int32 - -const ( - 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. -var ( - OperationMsg_Operation_name = map[int32]string{ - 0: "UNKNOWN", - 1: "MUTATOR", - 2: "ACCESSOR", - 3: "MAINTENANCE", - } - OperationMsg_Operation_value = map[string]int32{ - "UNKNOWN": 0, - "MUTATOR": 1, - "ACCESSOR": 2, - "MAINTENANCE": 3, - } -) - -func (x OperationMsg_Operation) Enum() *OperationMsg_Operation { - p := new(OperationMsg_Operation) - *p = x - return p -} - -func (x OperationMsg_Operation) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (OperationMsg_Operation) Descriptor() protoreflect.EnumDescriptor { - return file_lint_proto_enumTypes[0].Descriptor() -} - -func (OperationMsg_Operation) Type() protoreflect.EnumType { - return &file_lint_proto_enumTypes[0] -} - -func (x OperationMsg_Operation) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use OperationMsg_Operation.Descriptor instead. -func (OperationMsg_Operation) EnumDescriptor() ([]byte, []int) { - return file_lint_proto_rawDescGZIP(), []int{0, 0} -} - -type OperationMsg_Scope int32 - -const ( - OperationMsg_REPOSITORY OperationMsg_Scope = 0 - OperationMsg_STORAGE OperationMsg_Scope = 2 -) - -// Enum value maps for OperationMsg_Scope. -var ( - OperationMsg_Scope_name = map[int32]string{ - 0: "REPOSITORY", - 2: "STORAGE", - } - OperationMsg_Scope_value = map[string]int32{ - "REPOSITORY": 0, - "STORAGE": 2, - } -) - -func (x OperationMsg_Scope) Enum() *OperationMsg_Scope { - p := new(OperationMsg_Scope) - *p = x - return p -} - -func (x OperationMsg_Scope) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (OperationMsg_Scope) Descriptor() protoreflect.EnumDescriptor { - return file_lint_proto_enumTypes[1].Descriptor() -} - -func (OperationMsg_Scope) Type() protoreflect.EnumType { - return &file_lint_proto_enumTypes[1] -} - -func (x OperationMsg_Scope) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use OperationMsg_Scope.Descriptor instead. -func (OperationMsg_Scope) EnumDescriptor() ([]byte, []int) { - return file_lint_proto_rawDescGZIP(), []int{0, 1} -} - -type OperationMsg struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Op OperationMsg_Operation `protobuf:"varint,1,opt,name=op,proto3,enum=gitaly.OperationMsg_Operation" json:"op,omitempty"` - ScopeLevel OperationMsg_Scope `protobuf:"varint,2,opt,name=scope_level,json=scopeLevel,proto3,enum=gitaly.OperationMsg_Scope" json:"scope_level,omitempty"` -} - -func (x *OperationMsg) Reset() { - *x = OperationMsg{} - if protoimpl.UnsafeEnabled { - mi := &file_lint_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *OperationMsg) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OperationMsg) ProtoMessage() {} - -func (x *OperationMsg) ProtoReflect() protoreflect.Message { - mi := &file_lint_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 OperationMsg.ProtoReflect.Descriptor instead. -func (*OperationMsg) Descriptor() ([]byte, []int) { - return file_lint_proto_rawDescGZIP(), []int{0} -} - -func (x *OperationMsg) GetOp() OperationMsg_Operation { - if x != nil { - return x.Op - } - return OperationMsg_UNKNOWN -} - -func (x *OperationMsg) GetScopeLevel() OperationMsg_Scope { - if x != nil { - return x.ScopeLevel - } - return OperationMsg_REPOSITORY -} - -var file_lint_proto_extTypes = []protoimpl.ExtensionInfo{ - { - ExtendedType: (*descriptorpb.ServiceOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 82302, - Name: "gitaly.intercepted", - Tag: "varint,82302,opt,name=intercepted", - Filename: "lint.proto", - }, - { - ExtendedType: (*descriptorpb.MethodOptions)(nil), - ExtensionType: (*OperationMsg)(nil), - Field: 82303, - Name: "gitaly.op_type", - Tag: "bytes,82303,opt,name=op_type", - Filename: "lint.proto", - }, - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 91233, - Name: "gitaly.storage", - Tag: "varint,91233,opt,name=storage", - Filename: "lint.proto", - }, - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 91234, - Name: "gitaly.repository", - Tag: "varint,91234,opt,name=repository", - Filename: "lint.proto", - }, - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 91235, - Name: "gitaly.target_repository", - Tag: "varint,91235,opt,name=target_repository", - Filename: "lint.proto", - }, - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 91236, - Name: "gitaly.additional_repository", - Tag: "varint,91236,opt,name=additional_repository", - Filename: "lint.proto", - }, -} - -// Extension fields to descriptorpb.ServiceOptions. -var ( - // optional bool intercepted = 82302; - E_Intercepted = &file_lint_proto_extTypes[0] -) - -// Extension fields to descriptorpb.MethodOptions. -var ( - // optional gitaly.OperationMsg op_type = 82303; - E_OpType = &file_lint_proto_extTypes[1] -) - -// Extension fields to descriptorpb.FieldOptions. -var ( - // optional bool storage = 91233; - E_Storage = &file_lint_proto_extTypes[2] - // optional bool repository = 91234; - E_Repository = &file_lint_proto_extTypes[3] - // optional bool target_repository = 91235; - E_TargetRepository = &file_lint_proto_extTypes[4] - // optional bool additional_repository = 91236; - E_AdditionalRepository = &file_lint_proto_extTypes[5] -) - -var File_lint_proto protoreflect.FileDescriptor - -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, 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, - 0x69, 0x6f, 0x6e, 0x52, 0x02, 0x6f, 0x70, 0x12, 0x3b, 0x0a, 0x0b, 0x73, 0x63, 0x6f, 0x70, 0x65, - 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, 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, 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, - 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, 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, 0x5e, 0x5a, 0x5c, 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2d, 0x6f, 0x72, 0x67, 0x2f, 0x63, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x2d, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2f, 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2d, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x76, - 0x31, 0x36, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x69, 0x74, 0x61, - 0x6c, 0x79, 0x2f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x65, 0x64, 0x2f, 0x67, 0x69, 0x74, 0x61, - 0x6c, 0x79, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_lint_proto_rawDescOnce sync.Once - file_lint_proto_rawDescData = file_lint_proto_rawDesc -) - -func file_lint_proto_rawDescGZIP() []byte { - file_lint_proto_rawDescOnce.Do(func() { - file_lint_proto_rawDescData = protoimpl.X.CompressGZIP(file_lint_proto_rawDescData) - }) - return file_lint_proto_rawDescData -} - -var file_lint_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_lint_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_lint_proto_goTypes = []interface{}{ - (OperationMsg_Operation)(0), // 0: gitaly.OperationMsg.Operation - (OperationMsg_Scope)(0), // 1: gitaly.OperationMsg.Scope - (*OperationMsg)(nil), // 2: gitaly.OperationMsg - (*descriptorpb.ServiceOptions)(nil), // 3: google.protobuf.ServiceOptions - (*descriptorpb.MethodOptions)(nil), // 4: google.protobuf.MethodOptions - (*descriptorpb.FieldOptions)(nil), // 5: google.protobuf.FieldOptions -} -var file_lint_proto_depIdxs = []int32{ - 0, // 0: gitaly.OperationMsg.op:type_name -> gitaly.OperationMsg.Operation - 1, // 1: gitaly.OperationMsg.scope_level:type_name -> gitaly.OperationMsg.Scope - 3, // 2: gitaly.intercepted:extendee -> google.protobuf.ServiceOptions - 4, // 3: gitaly.op_type:extendee -> google.protobuf.MethodOptions - 5, // 4: gitaly.storage:extendee -> google.protobuf.FieldOptions - 5, // 5: gitaly.repository:extendee -> google.protobuf.FieldOptions - 5, // 6: gitaly.target_repository:extendee -> google.protobuf.FieldOptions - 5, // 7: gitaly.additional_repository:extendee -> google.protobuf.FieldOptions - 2, // 8: gitaly.op_type:type_name -> gitaly.OperationMsg - 9, // [9:9] is the sub-list for method output_type - 9, // [9:9] is the sub-list for method input_type - 8, // [8:9] is the sub-list for extension type_name - 2, // [2:8] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_lint_proto_init() } -func file_lint_proto_init() { - if File_lint_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_lint_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OperationMsg); 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_lint_proto_rawDesc, - NumEnums: 2, - NumMessages: 1, - NumExtensions: 6, - NumServices: 0, - }, - GoTypes: file_lint_proto_goTypes, - DependencyIndexes: file_lint_proto_depIdxs, - EnumInfos: file_lint_proto_enumTypes, - MessageInfos: file_lint_proto_msgTypes, - ExtensionInfos: file_lint_proto_extTypes, - }.Build() - File_lint_proto = out.File - file_lint_proto_rawDesc = nil - file_lint_proto_goTypes = nil - file_lint_proto_depIdxs = nil -} diff --git a/internal/gitaly/vendored/gitalypb/lint.proto b/internal/gitaly/vendored/gitalypb/lint.proto deleted file mode 100644 index 84accddf..00000000 --- a/internal/gitaly/vendored/gitalypb/lint.proto +++ /dev/null @@ -1,71 +0,0 @@ -syntax = "proto3"; - -package gitaly; - -import "google/protobuf/descriptor.proto"; - -option go_package = "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/gitalypb"; - -// This comment is left unintentionally blank. -message OperationMsg { - // This comment is left unintentionally blank. - enum Operation { - // This comment is left unintentionally blank. - UNKNOWN = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH - // This comment is left unintentionally blank. - MUTATOR = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX - // This comment is left unintentionally blank. - ACCESSOR = 2; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX - // This comment is left unintentionally blank. - MAINTENANCE = 3; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX - } - - // This comment is left unintentionally blank. - enum Scope { - // This comment is left unintentionally blank. - REPOSITORY = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH - // This comment is left unintentionally blank. - STORAGE = 2; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX - - reserved 1; - reserved "SERVER"; - } - - // This comment is left unintentionally blank. - Operation op = 1; - - // Scope level indicates what level an RPC interacts with a server: - // - REPOSITORY: scoped to only a single repo - // - SERVER: affects the entire server and potentially all repos - // - STORAGE: scoped to a specific storage location and all repos within - Scope scope_level = 2; -} - -extend google.protobuf.ServiceOptions { - // intercepted indicates whether the proxy intercepts and handles the call - // instead of proxying. Intercepted services do not require scope or operation - // annotations. - bool intercepted = 82302; -} - -extend google.protobuf.MethodOptions { - // Random high number.. - OperationMsg op_type = 82303; -} - -extend google.protobuf.FieldOptions { - // Used to mark field containing name of affected storage. - bool storage = 91233; // Random high number.. - - // If this operation modifies a repository, this annotations - // will specify the location of the Repository field within - // the request message. - // - // Repository annotation is used mark field used as repository - // when parent message is marked as target or additional repository - bool repository = 91234; - // Used to mark target repository - bool target_repository = 91235; - // Used to mark additional repository - bool additional_repository = 91236; -} diff --git a/internal/gitaly/vendored/gitalypb/packfile.pb.go b/internal/gitaly/vendored/gitalypb/packfile.pb.go deleted file mode 100644 index 1052cede..00000000 --- a/internal/gitaly/vendored/gitalypb/packfile.pb.go +++ /dev/null @@ -1,216 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc v3.21.7 -// source: packfile.proto - -package gitalypb - -import ( - reflect "reflect" - sync "sync" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -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 PackfileNegotiationStatistics struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - PayloadSize int64 `protobuf:"varint,1,opt,name=payload_size,json=payloadSize,proto3" json:"payload_size,omitempty"` - Packets int64 `protobuf:"varint,2,opt,name=packets,proto3" json:"packets,omitempty"` - Caps []string `protobuf:"bytes,3,rep,name=caps,proto3" json:"caps,omitempty"` - Wants int64 `protobuf:"varint,4,opt,name=wants,proto3" json:"wants,omitempty"` - Haves int64 `protobuf:"varint,5,opt,name=haves,proto3" json:"haves,omitempty"` - Shallows int64 `protobuf:"varint,6,opt,name=shallows,proto3" json:"shallows,omitempty"` - Deepen string `protobuf:"bytes,7,opt,name=deepen,proto3" json:"deepen,omitempty"` - Filter string `protobuf:"bytes,8,opt,name=filter,proto3" json:"filter,omitempty"` -} - -func (x *PackfileNegotiationStatistics) Reset() { - *x = PackfileNegotiationStatistics{} - if protoimpl.UnsafeEnabled { - mi := &file_packfile_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PackfileNegotiationStatistics) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PackfileNegotiationStatistics) ProtoMessage() {} - -func (x *PackfileNegotiationStatistics) ProtoReflect() protoreflect.Message { - mi := &file_packfile_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 PackfileNegotiationStatistics.ProtoReflect.Descriptor instead. -func (*PackfileNegotiationStatistics) Descriptor() ([]byte, []int) { - return file_packfile_proto_rawDescGZIP(), []int{0} -} - -func (x *PackfileNegotiationStatistics) GetPayloadSize() int64 { - if x != nil { - return x.PayloadSize - } - return 0 -} - -func (x *PackfileNegotiationStatistics) GetPackets() int64 { - if x != nil { - return x.Packets - } - return 0 -} - -func (x *PackfileNegotiationStatistics) GetCaps() []string { - if x != nil { - return x.Caps - } - return nil -} - -func (x *PackfileNegotiationStatistics) GetWants() int64 { - if x != nil { - return x.Wants - } - return 0 -} - -func (x *PackfileNegotiationStatistics) GetHaves() int64 { - if x != nil { - return x.Haves - } - return 0 -} - -func (x *PackfileNegotiationStatistics) GetShallows() int64 { - if x != nil { - return x.Shallows - } - return 0 -} - -func (x *PackfileNegotiationStatistics) GetDeepen() string { - if x != nil { - return x.Deepen - } - return "" -} - -func (x *PackfileNegotiationStatistics) GetFilter() string { - if x != nil { - return x.Filter - } - return "" -} - -var File_packfile_proto protoreflect.FileDescriptor - -var file_packfile_proto_rawDesc = []byte{ - 0x0a, 0x0e, 0x70, 0x61, 0x63, 0x6b, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x06, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x22, 0xe8, 0x01, 0x0a, 0x1d, 0x50, 0x61, 0x63, - 0x6b, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x65, 0x67, 0x6f, 0x74, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x61, - 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x0b, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x18, 0x0a, - 0x07, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, - 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x61, 0x70, 0x73, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x63, 0x61, 0x70, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x77, - 0x61, 0x6e, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x77, 0x61, 0x6e, 0x74, - 0x73, 0x12, 0x14, 0x0a, 0x05, 0x68, 0x61, 0x76, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x05, 0x68, 0x61, 0x76, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x68, 0x61, 0x6c, 0x6c, - 0x6f, 0x77, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x68, 0x61, 0x6c, 0x6c, - 0x6f, 0x77, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x65, 0x70, 0x65, 0x6e, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x65, 0x70, 0x65, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x66, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, - 0x74, 0x65, 0x72, 0x42, 0x5e, 0x5a, 0x5c, 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2d, 0x6f, 0x72, 0x67, 0x2f, 0x63, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x2d, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x2f, 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2d, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x31, - 0x36, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x69, 0x74, 0x61, 0x6c, - 0x79, 0x2f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x65, 0x64, 0x2f, 0x67, 0x69, 0x74, 0x61, 0x6c, - 0x79, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_packfile_proto_rawDescOnce sync.Once - file_packfile_proto_rawDescData = file_packfile_proto_rawDesc -) - -func file_packfile_proto_rawDescGZIP() []byte { - file_packfile_proto_rawDescOnce.Do(func() { - file_packfile_proto_rawDescData = protoimpl.X.CompressGZIP(file_packfile_proto_rawDescData) - }) - return file_packfile_proto_rawDescData -} - -var file_packfile_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_packfile_proto_goTypes = []interface{}{ - (*PackfileNegotiationStatistics)(nil), // 0: gitaly.PackfileNegotiationStatistics -} -var file_packfile_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_packfile_proto_init() } -func file_packfile_proto_init() { - if File_packfile_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_packfile_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PackfileNegotiationStatistics); 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_packfile_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_packfile_proto_goTypes, - DependencyIndexes: file_packfile_proto_depIdxs, - MessageInfos: file_packfile_proto_msgTypes, - }.Build() - File_packfile_proto = out.File - file_packfile_proto_rawDesc = nil - file_packfile_proto_goTypes = nil - file_packfile_proto_depIdxs = nil -} diff --git a/internal/gitaly/vendored/gitalypb/packfile.proto b/internal/gitaly/vendored/gitalypb/packfile.proto deleted file mode 100644 index 58d6ea95..00000000 --- a/internal/gitaly/vendored/gitalypb/packfile.proto +++ /dev/null @@ -1,26 +0,0 @@ -syntax = "proto3"; - -package gitaly; - -option go_package = "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/gitalypb"; - -// PackfileNegotiationStatistics represents the git packfile negotiation. -message PackfileNegotiationStatistics { - // PayloadSize is the total size of all pktlines' payload in bytes. This excludes the pktline prefix. - int64 payload_size = 1; - // Packets is the total number of packets. - int64 packets = 2; - // Caps is the capabilities announced by the client. - repeated string caps = 3; - // Wants is the number of objects the client announced it wants. - int64 wants = 4; - // Haves is the number of objects the client announced it has. - int64 haves = 5; - // Shallows is the number of shallow boundaries announced by the client. - int64 shallows = 6; - // Deepen is one of "deepen ", "deepen-since ", "deepen-not ". - // [deepen |deepen-since |deepen-not ] - string deepen = 7; - // Filter is specified by the client. - string filter = 8; -} diff --git a/internal/gitaly/vendored/gitalypb/service_config.pb.go b/internal/gitaly/vendored/gitalypb/service_config.pb.go deleted file mode 100644 index 64f50188..00000000 --- a/internal/gitaly/vendored/gitalypb/service_config.pb.go +++ /dev/null @@ -1,705 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc v3.21.7 -// source: service_config.proto - -package gitalypb - -import ( - reflect "reflect" - sync "sync" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - durationpb "google.golang.org/protobuf/types/known/durationpb" - wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" -) - -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 ServiceConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - LoadBalancingConfig []*LoadBalancingConfig `protobuf:"bytes,1,rep,name=load_balancing_config,json=loadBalancingConfig,proto3" json:"load_balancing_config,omitempty"` - MethodConfig []*MethodConfig `protobuf:"bytes,2,rep,name=method_config,json=methodConfig,proto3" json:"method_config,omitempty"` -} - -func (x *ServiceConfig) Reset() { - *x = ServiceConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_service_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ServiceConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ServiceConfig) ProtoMessage() {} - -func (x *ServiceConfig) ProtoReflect() protoreflect.Message { - mi := &file_service_config_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 ServiceConfig.ProtoReflect.Descriptor instead. -func (*ServiceConfig) Descriptor() ([]byte, []int) { - return file_service_config_proto_rawDescGZIP(), []int{0} -} - -func (x *ServiceConfig) GetLoadBalancingConfig() []*LoadBalancingConfig { - if x != nil { - return x.LoadBalancingConfig - } - return nil -} - -func (x *ServiceConfig) GetMethodConfig() []*MethodConfig { - if x != nil { - return x.MethodConfig - } - return nil -} - -type LoadBalancingConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Policy: - // - // *LoadBalancingConfig_PickFirst - // *LoadBalancingConfig_RoundRobin - Policy isLoadBalancingConfig_Policy `protobuf_oneof:"policy"` -} - -func (x *LoadBalancingConfig) Reset() { - *x = LoadBalancingConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_service_config_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *LoadBalancingConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LoadBalancingConfig) ProtoMessage() {} - -func (x *LoadBalancingConfig) ProtoReflect() protoreflect.Message { - mi := &file_service_config_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 LoadBalancingConfig.ProtoReflect.Descriptor instead. -func (*LoadBalancingConfig) Descriptor() ([]byte, []int) { - return file_service_config_proto_rawDescGZIP(), []int{1} -} - -func (m *LoadBalancingConfig) GetPolicy() isLoadBalancingConfig_Policy { - if m != nil { - return m.Policy - } - return nil -} - -func (x *LoadBalancingConfig) GetPickFirst() *PickFirstConfig { - if x, ok := x.GetPolicy().(*LoadBalancingConfig_PickFirst); ok { - return x.PickFirst - } - return nil -} - -func (x *LoadBalancingConfig) GetRoundRobin() *RoundRobinConfig { - if x, ok := x.GetPolicy().(*LoadBalancingConfig_RoundRobin); ok { - return x.RoundRobin - } - return nil -} - -type isLoadBalancingConfig_Policy interface { - isLoadBalancingConfig_Policy() -} - -type LoadBalancingConfig_PickFirst struct { - PickFirst *PickFirstConfig `protobuf:"bytes,1,opt,name=pick_first,proto3,oneof"` -} - -type LoadBalancingConfig_RoundRobin struct { - RoundRobin *RoundRobinConfig `protobuf:"bytes,2,opt,name=round_robin,proto3,oneof"` -} - -func (*LoadBalancingConfig_PickFirst) isLoadBalancingConfig_Policy() {} - -func (*LoadBalancingConfig_RoundRobin) isLoadBalancingConfig_Policy() {} - -type PickFirstConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *PickFirstConfig) Reset() { - *x = PickFirstConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_service_config_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PickFirstConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PickFirstConfig) ProtoMessage() {} - -func (x *PickFirstConfig) ProtoReflect() protoreflect.Message { - mi := &file_service_config_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 PickFirstConfig.ProtoReflect.Descriptor instead. -func (*PickFirstConfig) Descriptor() ([]byte, []int) { - return file_service_config_proto_rawDescGZIP(), []int{2} -} - -type RoundRobinConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *RoundRobinConfig) Reset() { - *x = RoundRobinConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_service_config_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RoundRobinConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RoundRobinConfig) ProtoMessage() {} - -func (x *RoundRobinConfig) ProtoReflect() protoreflect.Message { - mi := &file_service_config_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 RoundRobinConfig.ProtoReflect.Descriptor instead. -func (*RoundRobinConfig) Descriptor() ([]byte, []int) { - return file_service_config_proto_rawDescGZIP(), []int{3} -} - -type MethodConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name []*MethodConfig_Name `protobuf:"bytes,1,rep,name=name,proto3" json:"name,omitempty"` - WaitForReady *wrapperspb.BoolValue `protobuf:"bytes,2,opt,name=wait_for_ready,json=waitForReady,proto3" json:"wait_for_ready,omitempty"` - Timeout *durationpb.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"` - MaxRequestMessageBytes *wrapperspb.UInt32Value `protobuf:"bytes,4,opt,name=max_request_message_bytes,json=maxRequestMessageBytes,proto3" json:"max_request_message_bytes,omitempty"` - MaxResponseMessageBytes *wrapperspb.UInt32Value `protobuf:"bytes,5,opt,name=max_response_message_bytes,json=maxResponseMessageBytes,proto3" json:"max_response_message_bytes,omitempty"` - RetryPolicy *MethodConfig_RetryPolicy `protobuf:"bytes,6,opt,name=retry_policy,json=retryPolicy,proto3" json:"retry_policy,omitempty"` -} - -func (x *MethodConfig) Reset() { - *x = MethodConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_service_config_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MethodConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MethodConfig) ProtoMessage() {} - -func (x *MethodConfig) ProtoReflect() protoreflect.Message { - mi := &file_service_config_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 MethodConfig.ProtoReflect.Descriptor instead. -func (*MethodConfig) Descriptor() ([]byte, []int) { - return file_service_config_proto_rawDescGZIP(), []int{4} -} - -func (x *MethodConfig) GetName() []*MethodConfig_Name { - if x != nil { - return x.Name - } - return nil -} - -func (x *MethodConfig) GetWaitForReady() *wrapperspb.BoolValue { - if x != nil { - return x.WaitForReady - } - return nil -} - -func (x *MethodConfig) GetTimeout() *durationpb.Duration { - if x != nil { - return x.Timeout - } - return nil -} - -func (x *MethodConfig) GetMaxRequestMessageBytes() *wrapperspb.UInt32Value { - if x != nil { - return x.MaxRequestMessageBytes - } - return nil -} - -func (x *MethodConfig) GetMaxResponseMessageBytes() *wrapperspb.UInt32Value { - if x != nil { - return x.MaxResponseMessageBytes - } - return nil -} - -func (x *MethodConfig) GetRetryPolicy() *MethodConfig_RetryPolicy { - if x != nil { - return x.RetryPolicy - } - return nil -} - -type MethodConfig_Name struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` - Method string `protobuf:"bytes,2,opt,name=method,proto3" json:"method,omitempty"` -} - -func (x *MethodConfig_Name) Reset() { - *x = MethodConfig_Name{} - if protoimpl.UnsafeEnabled { - mi := &file_service_config_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MethodConfig_Name) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MethodConfig_Name) ProtoMessage() {} - -func (x *MethodConfig_Name) ProtoReflect() protoreflect.Message { - mi := &file_service_config_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 MethodConfig_Name.ProtoReflect.Descriptor instead. -func (*MethodConfig_Name) Descriptor() ([]byte, []int) { - return file_service_config_proto_rawDescGZIP(), []int{4, 0} -} - -func (x *MethodConfig_Name) GetService() string { - if x != nil { - return x.Service - } - return "" -} - -func (x *MethodConfig_Name) GetMethod() string { - if x != nil { - return x.Method - } - return "" -} - -type MethodConfig_RetryPolicy struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - MaxAttempts uint32 `protobuf:"varint,1,opt,name=max_attempts,json=maxAttempts,proto3" json:"max_attempts,omitempty"` - InitialBackoff *durationpb.Duration `protobuf:"bytes,2,opt,name=initial_backoff,json=initialBackoff,proto3" json:"initial_backoff,omitempty"` - MaxBackoff *durationpb.Duration `protobuf:"bytes,3,opt,name=max_backoff,json=maxBackoff,proto3" json:"max_backoff,omitempty"` - BackoffMultiplier float32 `protobuf:"fixed32,4,opt,name=backoff_multiplier,json=backoffMultiplier,proto3" json:"backoff_multiplier,omitempty"` - RetryableStatusCodes []string `protobuf:"bytes,5,rep,name=retryable_status_codes,json=retryableStatusCodes,proto3" json:"retryable_status_codes,omitempty"` -} - -func (x *MethodConfig_RetryPolicy) Reset() { - *x = MethodConfig_RetryPolicy{} - if protoimpl.UnsafeEnabled { - mi := &file_service_config_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MethodConfig_RetryPolicy) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MethodConfig_RetryPolicy) ProtoMessage() {} - -func (x *MethodConfig_RetryPolicy) ProtoReflect() protoreflect.Message { - mi := &file_service_config_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 MethodConfig_RetryPolicy.ProtoReflect.Descriptor instead. -func (*MethodConfig_RetryPolicy) Descriptor() ([]byte, []int) { - return file_service_config_proto_rawDescGZIP(), []int{4, 1} -} - -func (x *MethodConfig_RetryPolicy) GetMaxAttempts() uint32 { - if x != nil { - return x.MaxAttempts - } - return 0 -} - -func (x *MethodConfig_RetryPolicy) GetInitialBackoff() *durationpb.Duration { - if x != nil { - return x.InitialBackoff - } - return nil -} - -func (x *MethodConfig_RetryPolicy) GetMaxBackoff() *durationpb.Duration { - if x != nil { - return x.MaxBackoff - } - return nil -} - -func (x *MethodConfig_RetryPolicy) GetBackoffMultiplier() float32 { - if x != nil { - return x.BackoffMultiplier - } - return 0 -} - -func (x *MethodConfig_RetryPolicy) GetRetryableStatusCodes() []string { - if x != nil { - return x.RetryableStatusCodes - } - return nil -} - -var File_service_config_proto protoreflect.FileDescriptor - -var file_service_config_proto_rawDesc = []byte{ - 0x0a, 0x14, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x1a, 0x1e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, - 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, - 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9b, - 0x01, 0x0a, 0x0d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x12, 0x4f, 0x0a, 0x15, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x69, - 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x1b, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x6c, - 0x61, 0x6e, 0x63, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x13, 0x6c, 0x6f, - 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x12, 0x39, 0x0a, 0x0d, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, - 0x79, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0c, - 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x98, 0x01, 0x0a, - 0x13, 0x4c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x69, 0x6e, 0x67, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x12, 0x39, 0x0a, 0x0a, 0x70, 0x69, 0x63, 0x6b, 0x5f, 0x66, 0x69, 0x72, - 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, - 0x79, 0x2e, 0x50, 0x69, 0x63, 0x6b, 0x46, 0x69, 0x72, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x48, 0x00, 0x52, 0x0a, 0x70, 0x69, 0x63, 0x6b, 0x5f, 0x66, 0x69, 0x72, 0x73, 0x74, 0x12, - 0x3c, 0x0a, 0x0b, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x72, 0x6f, 0x62, 0x69, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x52, 0x6f, - 0x75, 0x6e, 0x64, 0x52, 0x6f, 0x62, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x00, - 0x52, 0x0b, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x72, 0x6f, 0x62, 0x69, 0x6e, 0x42, 0x08, 0x0a, - 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x11, 0x0a, 0x0f, 0x50, 0x69, 0x63, 0x6b, 0x46, - 0x69, 0x72, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x12, 0x0a, 0x10, 0x52, 0x6f, - 0x75, 0x6e, 0x64, 0x52, 0x6f, 0x62, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0xff, - 0x05, 0x0a, 0x0c, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, - 0x2d, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x40, - 0x0a, 0x0e, 0x77, 0x61, 0x69, 0x74, 0x5f, 0x66, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x79, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x52, 0x0c, 0x77, 0x61, 0x69, 0x74, 0x46, 0x6f, 0x72, 0x52, 0x65, 0x61, 0x64, 0x79, - 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, - 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x57, 0x0a, 0x19, 0x6d, 0x61, 0x78, 0x5f, 0x72, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x62, 0x79, 0x74, - 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x33, - 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x16, 0x6d, 0x61, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x59, - 0x0a, 0x1a, 0x6d, 0x61, 0x78, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x52, 0x17, 0x6d, 0x61, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x43, 0x0a, 0x0c, 0x72, 0x65, 0x74, - 0x72, 0x79, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x20, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x52, 0x65, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, - 0x79, 0x52, 0x0b, 0x72, 0x65, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x1a, 0x38, - 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x1a, 0x95, 0x02, 0x0a, 0x0b, 0x52, 0x65, 0x74, - 0x72, 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x61, 0x78, 0x5f, - 0x61, 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, - 0x6d, 0x61, 0x78, 0x41, 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x73, 0x12, 0x42, 0x0a, 0x0f, 0x69, - 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x0e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x42, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x12, - 0x3a, 0x0a, 0x0b, 0x6d, 0x61, 0x78, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x0a, 0x6d, 0x61, 0x78, 0x42, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x12, 0x2d, 0x0a, 0x12, 0x62, - 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x5f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x69, 0x65, - 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x02, 0x52, 0x11, 0x62, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, - 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x34, 0x0a, 0x16, 0x72, 0x65, - 0x74, 0x72, 0x79, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, - 0x6f, 0x64, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x14, 0x72, 0x65, 0x74, 0x72, - 0x79, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x73, - 0x42, 0x5e, 0x5a, 0x5c, 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, - 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2d, 0x6f, 0x72, 0x67, 0x2f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x2d, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x69, - 0x74, 0x6c, 0x61, 0x62, 0x2d, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x36, 0x2f, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2f, 0x76, - 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x65, 0x64, 0x2f, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x70, 0x62, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_service_config_proto_rawDescOnce sync.Once - file_service_config_proto_rawDescData = file_service_config_proto_rawDesc -) - -func file_service_config_proto_rawDescGZIP() []byte { - file_service_config_proto_rawDescOnce.Do(func() { - file_service_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_config_proto_rawDescData) - }) - return file_service_config_proto_rawDescData -} - -var file_service_config_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_service_config_proto_goTypes = []interface{}{ - (*ServiceConfig)(nil), // 0: gitaly.ServiceConfig - (*LoadBalancingConfig)(nil), // 1: gitaly.LoadBalancingConfig - (*PickFirstConfig)(nil), // 2: gitaly.PickFirstConfig - (*RoundRobinConfig)(nil), // 3: gitaly.RoundRobinConfig - (*MethodConfig)(nil), // 4: gitaly.MethodConfig - (*MethodConfig_Name)(nil), // 5: gitaly.MethodConfig.Name - (*MethodConfig_RetryPolicy)(nil), // 6: gitaly.MethodConfig.RetryPolicy - (*wrapperspb.BoolValue)(nil), // 7: google.protobuf.BoolValue - (*durationpb.Duration)(nil), // 8: google.protobuf.Duration - (*wrapperspb.UInt32Value)(nil), // 9: google.protobuf.UInt32Value -} -var file_service_config_proto_depIdxs = []int32{ - 1, // 0: gitaly.ServiceConfig.load_balancing_config:type_name -> gitaly.LoadBalancingConfig - 4, // 1: gitaly.ServiceConfig.method_config:type_name -> gitaly.MethodConfig - 2, // 2: gitaly.LoadBalancingConfig.pick_first:type_name -> gitaly.PickFirstConfig - 3, // 3: gitaly.LoadBalancingConfig.round_robin:type_name -> gitaly.RoundRobinConfig - 5, // 4: gitaly.MethodConfig.name:type_name -> gitaly.MethodConfig.Name - 7, // 5: gitaly.MethodConfig.wait_for_ready:type_name -> google.protobuf.BoolValue - 8, // 6: gitaly.MethodConfig.timeout:type_name -> google.protobuf.Duration - 9, // 7: gitaly.MethodConfig.max_request_message_bytes:type_name -> google.protobuf.UInt32Value - 9, // 8: gitaly.MethodConfig.max_response_message_bytes:type_name -> google.protobuf.UInt32Value - 6, // 9: gitaly.MethodConfig.retry_policy:type_name -> gitaly.MethodConfig.RetryPolicy - 8, // 10: gitaly.MethodConfig.RetryPolicy.initial_backoff:type_name -> google.protobuf.Duration - 8, // 11: gitaly.MethodConfig.RetryPolicy.max_backoff:type_name -> google.protobuf.Duration - 12, // [12:12] is the sub-list for method output_type - 12, // [12:12] is the sub-list for method input_type - 12, // [12:12] is the sub-list for extension type_name - 12, // [12:12] is the sub-list for extension extendee - 0, // [0:12] is the sub-list for field type_name -} - -func init() { file_service_config_proto_init() } -func file_service_config_proto_init() { - if File_service_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_service_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ServiceConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LoadBalancingConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PickFirstConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RoundRobinConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_config_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MethodConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_config_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MethodConfig_Name); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_config_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MethodConfig_RetryPolicy); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_service_config_proto_msgTypes[1].OneofWrappers = []interface{}{ - (*LoadBalancingConfig_PickFirst)(nil), - (*LoadBalancingConfig_RoundRobin)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_service_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 7, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_service_config_proto_goTypes, - DependencyIndexes: file_service_config_proto_depIdxs, - MessageInfos: file_service_config_proto_msgTypes, - }.Build() - File_service_config_proto = out.File - file_service_config_proto_rawDesc = nil - file_service_config_proto_goTypes = nil - file_service_config_proto_depIdxs = nil -} diff --git a/internal/gitaly/vendored/gitalypb/service_config.proto b/internal/gitaly/vendored/gitalypb/service_config.proto deleted file mode 100644 index 0d175f6b..00000000 --- a/internal/gitaly/vendored/gitalypb/service_config.proto +++ /dev/null @@ -1,82 +0,0 @@ -syntax = "proto3"; - -package gitaly; - -import "google/protobuf/duration.proto"; -import "google/protobuf/wrappers.proto"; - -option go_package = "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/gitalypb"; - -// ServiceConfig defines the configuration that allows service owners to publish parameters to be -// automatically used by all clients of their service. gRPC doesn't export this protobuf. So, we -// built a minimized version to for Gitaly use. The completed version is defined at -// https://github.com/grpc/grpc-proto/blob/master/grpc/service_config/service_config.proto -message ServiceConfig { - // protolint:disable:next REPEATED_FIELD_NAMES_PLURALIZED - repeated LoadBalancingConfig load_balancing_config = 1; - // protolint:disable:next REPEATED_FIELD_NAMES_PLURALIZED - repeated MethodConfig method_config = 2; -} - -// LoadBalancingConfig wraps around the round-robin strategies. Only one strategy can be selected. -message LoadBalancingConfig { - oneof policy { - // PickFirst strategy - PickFirstConfig pick_first = 1 [json_name = "pick_first"]; - // RoundRobin strategy - RoundRobinConfig round_robin = 2 [json_name = "round_robin"]; - } -} - -// PickFirstConfig signals the pick_first load-balancing strategy. This strategy is the default -// strategy of grpc client libraries so that the connection has only one subchannel, which is the -// first address after resolution -message PickFirstConfig { -} - -// RoundRobinConfig indicates the round_robin strategy. This strategy distributes the incoming -// requests to active subchannels in a round-robin fashion. -message RoundRobinConfig { -} - -// Configuration for a method. -message MethodConfig { - // Name is an object indicating which services/methods being affected by the config - message Name { - // service is name of the service,including its package. For example: gitaly.SmartHTTPService - string service = 1; - // method is the name of the method within the above service. Empty method name implies the - // method policy is effective for all methods of the service - string method = 2; - } - - // RetryPolicy defines the configuration for exponential backoff when a request fails - message RetryPolicy { - // max_attempts is the total retry attempts client perform before bailing out - uint32 max_attempts = 1; - // initial_backoff is the minimum delay for the first retries - google.protobuf.Duration initial_backoff = 2; - // max_backoff is the minimum delay - google.protobuf.Duration max_backoff = 3; - // backoff_multiplier is the factor determining "how fast" the delay increases after each retry - float backoff_multiplier = 4; - // retryable_status_codes defines the list of eligible status codes. The status must be in - // capitalized snake_case form. For example, UNAVAILABLE, FAILED_PRECONDITION - repeated string retryable_status_codes = 5; - } - - // name defines the list of affected services/methods - // The name should be is the definition of grpc. Nothing we can do about it - // protolint:disable:next REPEATED_FIELD_NAMES_PLURALIZED - repeated Name name = 1; - // The following fields are unused by Gitaly at the moment. Please refer to the original - // documentation for more information - // protolint:disable FIELDS_HAVE_COMMENT - google.protobuf.BoolValue wait_for_ready = 2; - google.protobuf.Duration timeout = 3; - google.protobuf.UInt32Value max_request_message_bytes = 4; - google.protobuf.UInt32Value max_response_message_bytes = 5; - // protolint:enable FIELDS_HAVE_COMMENT - // retry_policy defines the exponential backoff configuration for the affected services/methods - RetryPolicy retry_policy = 6; -} diff --git a/internal/gitaly/vendored/gitalypb/shared.pb.go b/internal/gitaly/vendored/gitalypb/shared.pb.go deleted file mode 100644 index e2019752..00000000 --- a/internal/gitaly/vendored/gitalypb/shared.pb.go +++ /dev/null @@ -1,1505 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc v3.21.7 -// source: shared.proto - -package gitalypb - -import ( - reflect "reflect" - sync "sync" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" -) - -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 ObjectType int32 - -const ( - ObjectType_UNKNOWN ObjectType = 0 - ObjectType_COMMIT ObjectType = 1 - ObjectType_BLOB ObjectType = 2 - ObjectType_TREE ObjectType = 3 - ObjectType_TAG ObjectType = 4 -) - -// Enum value maps for ObjectType. -var ( - ObjectType_name = map[int32]string{ - 0: "UNKNOWN", - 1: "COMMIT", - 2: "BLOB", - 3: "TREE", - 4: "TAG", - } - ObjectType_value = map[string]int32{ - "UNKNOWN": 0, - "COMMIT": 1, - "BLOB": 2, - "TREE": 3, - "TAG": 4, - } -) - -func (x ObjectType) Enum() *ObjectType { - p := new(ObjectType) - *p = x - return p -} - -func (x ObjectType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ObjectType) Descriptor() protoreflect.EnumDescriptor { - return file_shared_proto_enumTypes[0].Descriptor() -} - -func (ObjectType) Type() protoreflect.EnumType { - return &file_shared_proto_enumTypes[0] -} - -func (x ObjectType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ObjectType.Descriptor instead. -func (ObjectType) EnumDescriptor() ([]byte, []int) { - return file_shared_proto_rawDescGZIP(), []int{0} -} - -type ObjectFormat int32 - -const ( - ObjectFormat_OBJECT_FORMAT_UNSPECIFIED ObjectFormat = 0 - ObjectFormat_OBJECT_FORMAT_SHA1 ObjectFormat = 1 - ObjectFormat_OBJECT_FORMAT_SHA256 ObjectFormat = 2 -) - -// Enum value maps for ObjectFormat. -var ( - ObjectFormat_name = map[int32]string{ - 0: "OBJECT_FORMAT_UNSPECIFIED", - 1: "OBJECT_FORMAT_SHA1", - 2: "OBJECT_FORMAT_SHA256", - } - ObjectFormat_value = map[string]int32{ - "OBJECT_FORMAT_UNSPECIFIED": 0, - "OBJECT_FORMAT_SHA1": 1, - "OBJECT_FORMAT_SHA256": 2, - } -) - -func (x ObjectFormat) Enum() *ObjectFormat { - p := new(ObjectFormat) - *p = x - return p -} - -func (x ObjectFormat) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ObjectFormat) Descriptor() protoreflect.EnumDescriptor { - return file_shared_proto_enumTypes[1].Descriptor() -} - -func (ObjectFormat) Type() protoreflect.EnumType { - return &file_shared_proto_enumTypes[1] -} - -func (x ObjectFormat) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ObjectFormat.Descriptor instead. -func (ObjectFormat) EnumDescriptor() ([]byte, []int) { - return file_shared_proto_rawDescGZIP(), []int{1} -} - -type SignatureType int32 - -const ( - SignatureType_NONE SignatureType = 0 - SignatureType_PGP SignatureType = 1 - SignatureType_X509 SignatureType = 2 - SignatureType_SSH SignatureType = 3 -) - -// Enum value maps for SignatureType. -var ( - SignatureType_name = map[int32]string{ - 0: "NONE", - 1: "PGP", - 2: "X509", - 3: "SSH", - } - SignatureType_value = map[string]int32{ - "NONE": 0, - "PGP": 1, - "X509": 2, - "SSH": 3, - } -) - -func (x SignatureType) Enum() *SignatureType { - p := new(SignatureType) - *p = x - return p -} - -func (x SignatureType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SignatureType) Descriptor() protoreflect.EnumDescriptor { - return file_shared_proto_enumTypes[2].Descriptor() -} - -func (SignatureType) Type() protoreflect.EnumType { - return &file_shared_proto_enumTypes[2] -} - -func (x SignatureType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use SignatureType.Descriptor instead. -func (SignatureType) EnumDescriptor() ([]byte, []int) { - return file_shared_proto_rawDescGZIP(), []int{2} -} - -type SortDirection int32 - -const ( - SortDirection_ASCENDING SortDirection = 0 - SortDirection_DESCENDING SortDirection = 1 -) - -// Enum value maps for SortDirection. -var ( - SortDirection_name = map[int32]string{ - 0: "ASCENDING", - 1: "DESCENDING", - } - SortDirection_value = map[string]int32{ - "ASCENDING": 0, - "DESCENDING": 1, - } -) - -func (x SortDirection) Enum() *SortDirection { - p := new(SortDirection) - *p = x - return p -} - -func (x SortDirection) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SortDirection) Descriptor() protoreflect.EnumDescriptor { - return file_shared_proto_enumTypes[3].Descriptor() -} - -func (SortDirection) Type() protoreflect.EnumType { - return &file_shared_proto_enumTypes[3] -} - -func (x SortDirection) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use SortDirection.Descriptor instead. -func (SortDirection) EnumDescriptor() ([]byte, []int) { - return file_shared_proto_rawDescGZIP(), []int{3} -} - -type Repository struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - StorageName string `protobuf:"bytes,2,opt,name=storage_name,json=storageName,proto3" json:"storage_name,omitempty"` - RelativePath string `protobuf:"bytes,3,opt,name=relative_path,json=relativePath,proto3" json:"relative_path,omitempty"` - GitObjectDirectory string `protobuf:"bytes,4,opt,name=git_object_directory,json=gitObjectDirectory,proto3" json:"git_object_directory,omitempty"` - GitAlternateObjectDirectories []string `protobuf:"bytes,5,rep,name=git_alternate_object_directories,json=gitAlternateObjectDirectories,proto3" json:"git_alternate_object_directories,omitempty"` - GlRepository string `protobuf:"bytes,6,opt,name=gl_repository,json=glRepository,proto3" json:"gl_repository,omitempty"` - GlProjectPath string `protobuf:"bytes,8,opt,name=gl_project_path,json=glProjectPath,proto3" json:"gl_project_path,omitempty"` -} - -func (x *Repository) Reset() { - *x = Repository{} - if protoimpl.UnsafeEnabled { - mi := &file_shared_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Repository) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Repository) ProtoMessage() {} - -func (x *Repository) ProtoReflect() protoreflect.Message { - mi := &file_shared_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 Repository.ProtoReflect.Descriptor instead. -func (*Repository) Descriptor() ([]byte, []int) { - return file_shared_proto_rawDescGZIP(), []int{0} -} - -func (x *Repository) GetStorageName() string { - if x != nil { - return x.StorageName - } - return "" -} - -func (x *Repository) GetRelativePath() string { - if x != nil { - return x.RelativePath - } - return "" -} - -func (x *Repository) GetGitObjectDirectory() string { - if x != nil { - return x.GitObjectDirectory - } - return "" -} - -func (x *Repository) GetGitAlternateObjectDirectories() []string { - if x != nil { - return x.GitAlternateObjectDirectories - } - return nil -} - -func (x *Repository) GetGlRepository() string { - if x != nil { - return x.GlRepository - } - return "" -} - -func (x *Repository) GetGlProjectPath() string { - if x != nil { - return x.GlProjectPath - } - return "" -} - -type CommitTrailer struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *CommitTrailer) Reset() { - *x = CommitTrailer{} - if protoimpl.UnsafeEnabled { - mi := &file_shared_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CommitTrailer) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CommitTrailer) ProtoMessage() {} - -func (x *CommitTrailer) ProtoReflect() protoreflect.Message { - mi := &file_shared_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 CommitTrailer.ProtoReflect.Descriptor instead. -func (*CommitTrailer) Descriptor() ([]byte, []int) { - return file_shared_proto_rawDescGZIP(), []int{1} -} - -func (x *CommitTrailer) GetKey() []byte { - if x != nil { - return x.Key - } - return nil -} - -func (x *CommitTrailer) GetValue() []byte { - if x != nil { - return x.Value - } - return nil -} - -type CommitStatInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Additions int32 `protobuf:"varint,1,opt,name=additions,proto3" json:"additions,omitempty"` - Deletions int32 `protobuf:"varint,2,opt,name=deletions,proto3" json:"deletions,omitempty"` - ChangedFiles int32 `protobuf:"varint,3,opt,name=changed_files,json=changedFiles,proto3" json:"changed_files,omitempty"` -} - -func (x *CommitStatInfo) Reset() { - *x = CommitStatInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_shared_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CommitStatInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CommitStatInfo) ProtoMessage() {} - -func (x *CommitStatInfo) ProtoReflect() protoreflect.Message { - mi := &file_shared_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 CommitStatInfo.ProtoReflect.Descriptor instead. -func (*CommitStatInfo) Descriptor() ([]byte, []int) { - return file_shared_proto_rawDescGZIP(), []int{2} -} - -func (x *CommitStatInfo) GetAdditions() int32 { - if x != nil { - return x.Additions - } - return 0 -} - -func (x *CommitStatInfo) GetDeletions() int32 { - if x != nil { - return x.Deletions - } - return 0 -} - -func (x *CommitStatInfo) GetChangedFiles() int32 { - if x != nil { - return x.ChangedFiles - } - return 0 -} - -type GitCommit struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Subject []byte `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"` - Body []byte `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"` - Author *CommitAuthor `protobuf:"bytes,4,opt,name=author,proto3" json:"author,omitempty"` - Committer *CommitAuthor `protobuf:"bytes,5,opt,name=committer,proto3" json:"committer,omitempty"` - ParentIds []string `protobuf:"bytes,6,rep,name=parent_ids,json=parentIds,proto3" json:"parent_ids,omitempty"` - BodySize int64 `protobuf:"varint,7,opt,name=body_size,json=bodySize,proto3" json:"body_size,omitempty"` - SignatureType SignatureType `protobuf:"varint,8,opt,name=signature_type,json=signatureType,proto3,enum=gitaly.SignatureType" json:"signature_type,omitempty"` - TreeId string `protobuf:"bytes,9,opt,name=tree_id,json=treeId,proto3" json:"tree_id,omitempty"` - Trailers []*CommitTrailer `protobuf:"bytes,10,rep,name=trailers,proto3" json:"trailers,omitempty"` - ShortStats *CommitStatInfo `protobuf:"bytes,11,opt,name=short_stats,json=shortStats,proto3" json:"short_stats,omitempty"` - ReferencedBy [][]byte `protobuf:"bytes,12,rep,name=referenced_by,json=referencedBy,proto3" json:"referenced_by,omitempty"` - Encoding string `protobuf:"bytes,13,opt,name=encoding,proto3" json:"encoding,omitempty"` -} - -func (x *GitCommit) Reset() { - *x = GitCommit{} - if protoimpl.UnsafeEnabled { - mi := &file_shared_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GitCommit) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GitCommit) ProtoMessage() {} - -func (x *GitCommit) ProtoReflect() protoreflect.Message { - mi := &file_shared_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 GitCommit.ProtoReflect.Descriptor instead. -func (*GitCommit) Descriptor() ([]byte, []int) { - return file_shared_proto_rawDescGZIP(), []int{3} -} - -func (x *GitCommit) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *GitCommit) GetSubject() []byte { - if x != nil { - return x.Subject - } - return nil -} - -func (x *GitCommit) GetBody() []byte { - if x != nil { - return x.Body - } - return nil -} - -func (x *GitCommit) GetAuthor() *CommitAuthor { - if x != nil { - return x.Author - } - return nil -} - -func (x *GitCommit) GetCommitter() *CommitAuthor { - if x != nil { - return x.Committer - } - return nil -} - -func (x *GitCommit) GetParentIds() []string { - if x != nil { - return x.ParentIds - } - return nil -} - -func (x *GitCommit) GetBodySize() int64 { - if x != nil { - return x.BodySize - } - return 0 -} - -func (x *GitCommit) GetSignatureType() SignatureType { - if x != nil { - return x.SignatureType - } - return SignatureType_NONE -} - -func (x *GitCommit) GetTreeId() string { - if x != nil { - return x.TreeId - } - return "" -} - -func (x *GitCommit) GetTrailers() []*CommitTrailer { - if x != nil { - return x.Trailers - } - return nil -} - -func (x *GitCommit) GetShortStats() *CommitStatInfo { - if x != nil { - return x.ShortStats - } - return nil -} - -func (x *GitCommit) GetReferencedBy() [][]byte { - if x != nil { - return x.ReferencedBy - } - return nil -} - -func (x *GitCommit) GetEncoding() string { - if x != nil { - return x.Encoding - } - return "" -} - -type CommitAuthor struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Email []byte `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` - Date *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=date,proto3" json:"date,omitempty"` - Timezone []byte `protobuf:"bytes,4,opt,name=timezone,proto3" json:"timezone,omitempty"` -} - -func (x *CommitAuthor) Reset() { - *x = CommitAuthor{} - if protoimpl.UnsafeEnabled { - mi := &file_shared_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CommitAuthor) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CommitAuthor) ProtoMessage() {} - -func (x *CommitAuthor) ProtoReflect() protoreflect.Message { - mi := &file_shared_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 CommitAuthor.ProtoReflect.Descriptor instead. -func (*CommitAuthor) Descriptor() ([]byte, []int) { - return file_shared_proto_rawDescGZIP(), []int{4} -} - -func (x *CommitAuthor) GetName() []byte { - if x != nil { - return x.Name - } - return nil -} - -func (x *CommitAuthor) GetEmail() []byte { - if x != nil { - return x.Email - } - return nil -} - -func (x *CommitAuthor) GetDate() *timestamppb.Timestamp { - if x != nil { - return x.Date - } - return nil -} - -func (x *CommitAuthor) GetTimezone() []byte { - if x != nil { - return x.Timezone - } - return nil -} - -type ExitStatus struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Value int32 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *ExitStatus) Reset() { - *x = ExitStatus{} - if protoimpl.UnsafeEnabled { - mi := &file_shared_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExitStatus) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExitStatus) ProtoMessage() {} - -func (x *ExitStatus) ProtoReflect() protoreflect.Message { - mi := &file_shared_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 ExitStatus.ProtoReflect.Descriptor instead. -func (*ExitStatus) Descriptor() ([]byte, []int) { - return file_shared_proto_rawDescGZIP(), []int{5} -} - -func (x *ExitStatus) GetValue() int32 { - if x != nil { - return x.Value - } - return 0 -} - -type Branch struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - TargetCommit *GitCommit `protobuf:"bytes,2,opt,name=target_commit,json=targetCommit,proto3" json:"target_commit,omitempty"` -} - -func (x *Branch) Reset() { - *x = Branch{} - if protoimpl.UnsafeEnabled { - mi := &file_shared_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Branch) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Branch) ProtoMessage() {} - -func (x *Branch) ProtoReflect() protoreflect.Message { - mi := &file_shared_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 Branch.ProtoReflect.Descriptor instead. -func (*Branch) Descriptor() ([]byte, []int) { - return file_shared_proto_rawDescGZIP(), []int{6} -} - -func (x *Branch) GetName() []byte { - if x != nil { - return x.Name - } - return nil -} - -func (x *Branch) GetTargetCommit() *GitCommit { - if x != nil { - return x.TargetCommit - } - return nil -} - -type Tag struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` - TargetCommit *GitCommit `protobuf:"bytes,3,opt,name=target_commit,json=targetCommit,proto3" json:"target_commit,omitempty"` - Message []byte `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"` - MessageSize int64 `protobuf:"varint,5,opt,name=message_size,json=messageSize,proto3" json:"message_size,omitempty"` - Tagger *CommitAuthor `protobuf:"bytes,6,opt,name=tagger,proto3" json:"tagger,omitempty"` - SignatureType SignatureType `protobuf:"varint,7,opt,name=signature_type,json=signatureType,proto3,enum=gitaly.SignatureType" json:"signature_type,omitempty"` -} - -func (x *Tag) Reset() { - *x = Tag{} - if protoimpl.UnsafeEnabled { - mi := &file_shared_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Tag) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Tag) ProtoMessage() {} - -func (x *Tag) ProtoReflect() protoreflect.Message { - mi := &file_shared_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 Tag.ProtoReflect.Descriptor instead. -func (*Tag) Descriptor() ([]byte, []int) { - return file_shared_proto_rawDescGZIP(), []int{7} -} - -func (x *Tag) GetName() []byte { - if x != nil { - return x.Name - } - return nil -} - -func (x *Tag) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *Tag) GetTargetCommit() *GitCommit { - if x != nil { - return x.TargetCommit - } - return nil -} - -func (x *Tag) GetMessage() []byte { - if x != nil { - return x.Message - } - return nil -} - -func (x *Tag) GetMessageSize() int64 { - if x != nil { - return x.MessageSize - } - return 0 -} - -func (x *Tag) GetTagger() *CommitAuthor { - if x != nil { - return x.Tagger - } - return nil -} - -func (x *Tag) GetSignatureType() SignatureType { - if x != nil { - return x.SignatureType - } - return SignatureType_NONE -} - -type User struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - GlId string `protobuf:"bytes,1,opt,name=gl_id,json=glId,proto3" json:"gl_id,omitempty"` - Name []byte `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Email []byte `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` - GlUsername string `protobuf:"bytes,4,opt,name=gl_username,json=glUsername,proto3" json:"gl_username,omitempty"` - Timezone string `protobuf:"bytes,5,opt,name=timezone,proto3" json:"timezone,omitempty"` -} - -func (x *User) Reset() { - *x = User{} - if protoimpl.UnsafeEnabled { - mi := &file_shared_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *User) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*User) ProtoMessage() {} - -func (x *User) ProtoReflect() protoreflect.Message { - mi := &file_shared_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 User.ProtoReflect.Descriptor instead. -func (*User) Descriptor() ([]byte, []int) { - return file_shared_proto_rawDescGZIP(), []int{8} -} - -func (x *User) GetGlId() string { - if x != nil { - return x.GlId - } - return "" -} - -func (x *User) GetName() []byte { - if x != nil { - return x.Name - } - return nil -} - -func (x *User) GetEmail() []byte { - if x != nil { - return x.Email - } - return nil -} - -func (x *User) GetGlUsername() string { - if x != nil { - return x.GlUsername - } - return "" -} - -func (x *User) GetTimezone() string { - if x != nil { - return x.Timezone - } - return "" -} - -type ObjectPool struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` -} - -func (x *ObjectPool) Reset() { - *x = ObjectPool{} - if protoimpl.UnsafeEnabled { - mi := &file_shared_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ObjectPool) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ObjectPool) ProtoMessage() {} - -func (x *ObjectPool) ProtoReflect() protoreflect.Message { - mi := &file_shared_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 ObjectPool.ProtoReflect.Descriptor instead. -func (*ObjectPool) Descriptor() ([]byte, []int) { - return file_shared_proto_rawDescGZIP(), []int{9} -} - -func (x *ObjectPool) GetRepository() *Repository { - if x != nil { - return x.Repository - } - return nil -} - -type PaginationParameter struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - PageToken string `protobuf:"bytes,1,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - Limit int32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` -} - -func (x *PaginationParameter) Reset() { - *x = PaginationParameter{} - if protoimpl.UnsafeEnabled { - mi := &file_shared_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PaginationParameter) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PaginationParameter) ProtoMessage() {} - -func (x *PaginationParameter) ProtoReflect() protoreflect.Message { - mi := &file_shared_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 PaginationParameter.ProtoReflect.Descriptor instead. -func (*PaginationParameter) Descriptor() ([]byte, []int) { - return file_shared_proto_rawDescGZIP(), []int{10} -} - -func (x *PaginationParameter) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -func (x *PaginationParameter) GetLimit() int32 { - if x != nil { - return x.Limit - } - return 0 -} - -type PaginationCursor struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NextCursor string `protobuf:"bytes,1,opt,name=next_cursor,json=nextCursor,proto3" json:"next_cursor,omitempty"` -} - -func (x *PaginationCursor) Reset() { - *x = PaginationCursor{} - if protoimpl.UnsafeEnabled { - mi := &file_shared_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PaginationCursor) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PaginationCursor) ProtoMessage() {} - -func (x *PaginationCursor) ProtoReflect() protoreflect.Message { - mi := &file_shared_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 PaginationCursor.ProtoReflect.Descriptor instead. -func (*PaginationCursor) Descriptor() ([]byte, []int) { - return file_shared_proto_rawDescGZIP(), []int{11} -} - -func (x *PaginationCursor) GetNextCursor() string { - if x != nil { - return x.NextCursor - } - return "" -} - -type GlobalOptions struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - LiteralPathspecs bool `protobuf:"varint,1,opt,name=literal_pathspecs,json=literalPathspecs,proto3" json:"literal_pathspecs,omitempty"` -} - -func (x *GlobalOptions) Reset() { - *x = GlobalOptions{} - if protoimpl.UnsafeEnabled { - mi := &file_shared_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GlobalOptions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GlobalOptions) ProtoMessage() {} - -func (x *GlobalOptions) ProtoReflect() protoreflect.Message { - mi := &file_shared_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 GlobalOptions.ProtoReflect.Descriptor instead. -func (*GlobalOptions) Descriptor() ([]byte, []int) { - return file_shared_proto_rawDescGZIP(), []int{12} -} - -func (x *GlobalOptions) GetLiteralPathspecs() bool { - if x != nil { - return x.LiteralPathspecs - } - return false -} - -var File_shared_proto protoreflect.FileDescriptor - -var file_shared_proto_rawDesc = []byte{ - 0x0a, 0x0c, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, - 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0a, 0x6c, 0x69, 0x6e, 0x74, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0xae, 0x02, 0x0a, 0x0a, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, - 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, - 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x50, 0x61, 0x74, 0x68, 0x12, 0x30, 0x0a, 0x14, 0x67, 0x69, - 0x74, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, - 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x67, 0x69, 0x74, 0x4f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x47, 0x0a, 0x20, - 0x67, 0x69, 0x74, 0x5f, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x65, 0x5f, 0x6f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, - 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x1d, 0x67, 0x69, 0x74, 0x41, 0x6c, 0x74, 0x65, 0x72, - 0x6e, 0x61, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, - 0x6f, 0x72, 0x69, 0x65, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x67, 0x6c, 0x5f, 0x72, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x67, 0x6c, - 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x26, 0x0a, 0x0f, 0x67, 0x6c, - 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0d, 0x67, 0x6c, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x61, - 0x74, 0x68, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x4a, 0x04, 0x08, 0x07, 0x10, 0x08, 0x52, 0x04, - 0x70, 0x61, 0x74, 0x68, 0x22, 0x37, 0x0a, 0x0d, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x54, 0x72, - 0x61, 0x69, 0x6c, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x71, 0x0a, - 0x0e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, - 0x1c, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x09, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1c, 0x0a, - 0x09, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x63, - 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x0c, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x73, - 0x22, 0xeb, 0x03, 0x0a, 0x09, 0x47, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, - 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x2c, 0x0a, 0x06, - 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, - 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x41, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x12, 0x32, 0x0a, 0x09, 0x63, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, - 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x41, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x72, 0x12, 0x1d, - 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x06, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x73, 0x12, 0x1b, 0x0a, - 0x09, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x08, 0x62, 0x6f, 0x64, 0x79, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x3c, 0x0a, 0x0e, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x53, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x72, 0x65, 0x65, - 0x5f, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x72, 0x65, 0x65, 0x49, - 0x64, 0x12, 0x31, 0x0a, 0x08, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x18, 0x0a, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x43, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x54, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x52, 0x08, 0x74, 0x72, 0x61, 0x69, - 0x6c, 0x65, 0x72, 0x73, 0x12, 0x37, 0x0a, 0x0b, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x5f, 0x73, 0x74, - 0x61, 0x74, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x69, 0x74, 0x61, - 0x6c, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x49, 0x6e, 0x66, - 0x6f, 0x52, 0x0a, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x23, 0x0a, - 0x0d, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x0c, - 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0c, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x64, - 0x42, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x0d, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x22, 0x84, - 0x01, 0x0a, 0x0c, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x2e, 0x0a, 0x04, 0x64, 0x61, 0x74, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x52, 0x04, 0x64, 0x61, 0x74, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x69, 0x6d, - 0x65, 0x7a, 0x6f, 0x6e, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x74, 0x69, 0x6d, - 0x65, 0x7a, 0x6f, 0x6e, 0x65, 0x22, 0x22, 0x0a, 0x0a, 0x45, 0x78, 0x69, 0x74, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x54, 0x0a, 0x06, 0x42, 0x72, 0x61, - 0x6e, 0x63, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x0d, 0x74, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, - 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x47, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x52, 0x0c, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x22, - 0x8a, 0x02, 0x0a, 0x03, 0x54, 0x61, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x36, 0x0a, 0x0d, 0x74, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x47, 0x69, 0x74, 0x43, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x0c, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x43, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x21, 0x0a, - 0x0c, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x0b, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, - 0x12, 0x2c, 0x0a, 0x06, 0x74, 0x61, 0x67, 0x67, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x14, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x52, 0x06, 0x74, 0x61, 0x67, 0x67, 0x65, 0x72, 0x12, 0x3c, - 0x0a, 0x0e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, - 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0d, 0x73, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0x82, 0x01, 0x0a, - 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x13, 0x0a, 0x05, 0x67, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x67, 0x6c, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, - 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x65, - 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1f, 0x0a, 0x0b, 0x67, 0x6c, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x67, 0x6c, 0x55, 0x73, 0x65, - 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x69, 0x6d, 0x65, 0x7a, 0x6f, 0x6e, - 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x69, 0x6d, 0x65, 0x7a, 0x6f, 0x6e, - 0x65, 0x22, 0x46, 0x0a, 0x0a, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x6f, 0x6f, 0x6c, 0x12, - 0x38, 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, 0x42, 0x04, 0x90, 0xc6, 0x2c, 0x01, 0x52, 0x0a, 0x72, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x22, 0x4a, 0x0a, 0x13, 0x50, 0x61, 0x67, - 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, - 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, - 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, - 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x33, 0x0a, 0x10, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x43, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x6e, 0x65, 0x78, - 0x74, 0x5f, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x6e, 0x65, 0x78, 0x74, 0x43, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x22, 0x3c, 0x0a, 0x0d, 0x47, 0x6c, - 0x6f, 0x62, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x6c, - 0x69, 0x74, 0x65, 0x72, 0x61, 0x6c, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x73, 0x70, 0x65, 0x63, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x6c, 0x69, 0x74, 0x65, 0x72, 0x61, 0x6c, 0x50, - 0x61, 0x74, 0x68, 0x73, 0x70, 0x65, 0x63, 0x73, 0x2a, 0x42, 0x0a, 0x0a, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, - 0x4e, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x4f, 0x4d, 0x4d, 0x49, 0x54, 0x10, 0x01, 0x12, - 0x08, 0x0a, 0x04, 0x42, 0x4c, 0x4f, 0x42, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x54, 0x52, 0x45, - 0x45, 0x10, 0x03, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x41, 0x47, 0x10, 0x04, 0x2a, 0x5f, 0x0a, 0x0c, - 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x1d, 0x0a, 0x19, - 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x55, 0x4e, - 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x4f, - 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x53, 0x48, 0x41, - 0x31, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x46, 0x4f, - 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x02, 0x2a, 0x35, 0x0a, - 0x0d, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, - 0x0a, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x50, 0x47, 0x50, 0x10, - 0x01, 0x12, 0x08, 0x0a, 0x04, 0x58, 0x35, 0x30, 0x39, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x53, - 0x53, 0x48, 0x10, 0x03, 0x2a, 0x2e, 0x0a, 0x0d, 0x53, 0x6f, 0x72, 0x74, 0x44, 0x69, 0x72, 0x65, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0d, 0x0a, 0x09, 0x41, 0x53, 0x43, 0x45, 0x4e, 0x44, 0x49, - 0x4e, 0x47, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x44, 0x45, 0x53, 0x43, 0x45, 0x4e, 0x44, 0x49, - 0x4e, 0x47, 0x10, 0x01, 0x42, 0x5e, 0x5a, 0x5c, 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2d, 0x6f, 0x72, 0x67, 0x2f, 0x63, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x2d, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2f, 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2d, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x76, - 0x31, 0x36, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x69, 0x74, 0x61, - 0x6c, 0x79, 0x2f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x65, 0x64, 0x2f, 0x67, 0x69, 0x74, 0x61, - 0x6c, 0x79, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_shared_proto_rawDescOnce sync.Once - file_shared_proto_rawDescData = file_shared_proto_rawDesc -) - -func file_shared_proto_rawDescGZIP() []byte { - file_shared_proto_rawDescOnce.Do(func() { - file_shared_proto_rawDescData = protoimpl.X.CompressGZIP(file_shared_proto_rawDescData) - }) - return file_shared_proto_rawDescData -} - -var file_shared_proto_enumTypes = make([]protoimpl.EnumInfo, 4) -var file_shared_proto_msgTypes = make([]protoimpl.MessageInfo, 13) -var file_shared_proto_goTypes = []interface{}{ - (ObjectType)(0), // 0: gitaly.ObjectType - (ObjectFormat)(0), // 1: gitaly.ObjectFormat - (SignatureType)(0), // 2: gitaly.SignatureType - (SortDirection)(0), // 3: gitaly.SortDirection - (*Repository)(nil), // 4: gitaly.Repository - (*CommitTrailer)(nil), // 5: gitaly.CommitTrailer - (*CommitStatInfo)(nil), // 6: gitaly.CommitStatInfo - (*GitCommit)(nil), // 7: gitaly.GitCommit - (*CommitAuthor)(nil), // 8: gitaly.CommitAuthor - (*ExitStatus)(nil), // 9: gitaly.ExitStatus - (*Branch)(nil), // 10: gitaly.Branch - (*Tag)(nil), // 11: gitaly.Tag - (*User)(nil), // 12: gitaly.User - (*ObjectPool)(nil), // 13: gitaly.ObjectPool - (*PaginationParameter)(nil), // 14: gitaly.PaginationParameter - (*PaginationCursor)(nil), // 15: gitaly.PaginationCursor - (*GlobalOptions)(nil), // 16: gitaly.GlobalOptions - (*timestamppb.Timestamp)(nil), // 17: google.protobuf.Timestamp -} -var file_shared_proto_depIdxs = []int32{ - 8, // 0: gitaly.GitCommit.author:type_name -> gitaly.CommitAuthor - 8, // 1: gitaly.GitCommit.committer:type_name -> gitaly.CommitAuthor - 2, // 2: gitaly.GitCommit.signature_type:type_name -> gitaly.SignatureType - 5, // 3: gitaly.GitCommit.trailers:type_name -> gitaly.CommitTrailer - 6, // 4: gitaly.GitCommit.short_stats:type_name -> gitaly.CommitStatInfo - 17, // 5: gitaly.CommitAuthor.date:type_name -> google.protobuf.Timestamp - 7, // 6: gitaly.Branch.target_commit:type_name -> gitaly.GitCommit - 7, // 7: gitaly.Tag.target_commit:type_name -> gitaly.GitCommit - 8, // 8: gitaly.Tag.tagger:type_name -> gitaly.CommitAuthor - 2, // 9: gitaly.Tag.signature_type:type_name -> gitaly.SignatureType - 4, // 10: gitaly.ObjectPool.repository:type_name -> gitaly.Repository - 11, // [11:11] is the sub-list for method output_type - 11, // [11:11] 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_shared_proto_init() } -func file_shared_proto_init() { - if File_shared_proto != nil { - return - } - file_lint_proto_init() - if !protoimpl.UnsafeEnabled { - file_shared_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Repository); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_shared_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommitTrailer); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_shared_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommitStatInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_shared_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GitCommit); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_shared_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommitAuthor); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_shared_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExitStatus); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_shared_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Branch); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_shared_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Tag); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_shared_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*User); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_shared_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ObjectPool); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_shared_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PaginationParameter); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_shared_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PaginationCursor); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_shared_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GlobalOptions); 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_shared_proto_rawDesc, - NumEnums: 4, - NumMessages: 13, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_shared_proto_goTypes, - DependencyIndexes: file_shared_proto_depIdxs, - EnumInfos: file_shared_proto_enumTypes, - MessageInfos: file_shared_proto_msgTypes, - }.Build() - File_shared_proto = out.File - file_shared_proto_rawDesc = nil - file_shared_proto_goTypes = nil - file_shared_proto_depIdxs = nil -} diff --git a/internal/gitaly/vendored/gitalypb/shared.proto b/internal/gitaly/vendored/gitalypb/shared.proto deleted file mode 100644 index 943c1bb6..00000000 --- a/internal/gitaly/vendored/gitalypb/shared.proto +++ /dev/null @@ -1,241 +0,0 @@ -syntax = "proto3"; - -package gitaly; - -import "google/protobuf/timestamp.proto"; -import "lint.proto"; - -option go_package = "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/gitalypb"; - -// This comment is left unintentionally blank. -enum ObjectType { - // This comment is left unintentionally blank. - UNKNOWN = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH - // This comment is left unintentionally blank. - COMMIT = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX - // This comment is left unintentionally blank. - BLOB = 2; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX - // This comment is left unintentionally blank. - TREE = 3; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX - // This comment is left unintentionally blank. - TAG = 4; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX -} - -// ObjectFormat is the object format that a Git repository can use. -enum ObjectFormat { - // OBJECT_FORMAT_UNSPECIFIED is the default object type when it has not been explicitly requested - // by the client. Defaults to OBJECT_FORMAT_SHA1. - OBJECT_FORMAT_UNSPECIFIED = 0; - // OBJECT_FORMAT_SHA1 is the object format based on the SHA1 hash. - OBJECT_FORMAT_SHA1 = 1; - // OBJECT_FORMAT_SHA256 is the object format based on the SHA256 hash. This is experimental. - OBJECT_FORMAT_SHA256 = 2; -} - -// This comment is left unintentionally blank. -enum SignatureType { - // This comment is left unintentionally blank. - NONE = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH - // This comment is left unintentionally blank. - PGP = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX - // This comment is left unintentionally blank. - X509 = 2; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX - // This comment is left unintentionally blank. - SSH = 3; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX - // maybe add X509+TSA or other combinations at a later step -} - -// This comment is left unintentionally blank. -message Repository { - // DEPRECATED: https://gitlab.com/gitlab-org/gitaly/issues/151 - reserved 1; - reserved "path"; - - // This comment is left unintentionally blank. - string storage_name = 2; - // This comment is left unintentionally blank. - string relative_path = 3; - // Sets the GIT_OBJECT_DIRECTORY envvar on git commands to the value of this field. - // It influences the object storage directory the SHA1 directories are created underneath. - string git_object_directory = 4; - // Sets the GIT_ALTERNATE_OBJECT_DIRECTORIES envvar on git commands to the values of this field. - // It influences the list of Git object directories which can be used to search for Git objects. - repeated string git_alternate_object_directories = 5; - // Used in callbacks to GitLab so that it knows what repository the event is - // associated with. May be left empty on RPC's that do not perform callbacks. - // During project creation, `gl_repository` may not be known. - string gl_repository = 6; - reserved 7; - // The human-readable GitLab project path (e.g. gitlab-org/gitlab-ce). - // When hashed storage is use, this associates a project path with its - // path on disk. The name can change over time (e.g. when a project is - // renamed). This is primarily used for logging/debugging at the - // moment. - string gl_project_path = 8; -} - -// A single Git trailer (https://git-scm.com/docs/git-interpret-trailers) -// key-value pair. -message CommitTrailer { - // The key of the trailer, such as `Signed-off-by`. - bytes key = 1; - // The value of the trailer, such as `Alice `. - bytes value = 2; -} - -// CommitStatInfo includes the number of changed lines and files in the commit. -message CommitStatInfo { - // additions is the number of line additions in the commit. - int32 additions = 1; - // deletions is the number of lines deleted in the commit. - int32 deletions = 2; - // changed_files is the number of files changed in the commit. - int32 changed_files = 3; -} - -// Corresponds to Gitlab::Git::Commit -message GitCommit { - // This comment is left unintentionally blank. - string id = 1; - // This comment is left unintentionally blank. - bytes subject = 2; - // This comment is left unintentionally blank. - bytes body = 3; - // This comment is left unintentionally blank. - CommitAuthor author = 4; - // This comment is left unintentionally blank. - CommitAuthor committer = 5; - // This comment is left unintentionally blank. - repeated string parent_ids = 6; - // If body exceeds a certain threshold, it will be nullified, - // but its size will be set in body_size so we can know if - // a commit had a body in the first place. - int64 body_size = 7; - // This comment is left unintentionally blank. - SignatureType signature_type = 8; - // The tree ID will always be filled, even if the tree is empty. In that case - // the value will be `4b825dc642cb6eb9a060e54bf8d69288fbee4904`. - // That value is equivalent to `git hash-object -t tree /dev/null` - string tree_id = 9; - // The list of Git trailers (https://git-scm.com/docs/git-interpret-trailers) - // found in this commit's message. The number of trailers and their key/value - // sizes are limited. If a trailer exceeds these size limits, it and any - // trailers that follow it are not included. - repeated CommitTrailer trailers = 10; - // The stats include additions, deletions and changed_files, - // they are only set when `include_shortstat == true`. - CommitStatInfo short_stats = 11; - // referenced_by contains fully-qualified reference names (e.g refs/heads/main) - // that point to the commit. - repeated bytes referenced_by = 12; // protolint:disable:this REPEATED_FIELD_NAMES_PLURALIZED - // The encoding of the commit message. This field will only be present if - // `i18n.commitEncoding` was set to a value other than "UTF-8" at the time - // this commit was made. - // See: https://git-scm.com/docs/git-commit#_discussion - string encoding = 13; -} - -// This comment is left unintentionally blank. -message CommitAuthor { - // This comment is left unintentionally blank. - bytes name = 1; - // This comment is left unintentionally blank. - bytes email = 2; - // This comment is left unintentionally blank. - google.protobuf.Timestamp date = 3; - // This comment is left unintentionally blank. - bytes timezone = 4; -} - -// This comment is left unintentionally blank. -message ExitStatus { - // This comment is left unintentionally blank. - int32 value = 1; -} - -// Corresponds to Gitlab::Git::Branch -message Branch { - // This comment is left unintentionally blank. - bytes name = 1; - // This comment is left unintentionally blank. - GitCommit target_commit = 2; -} - -// This comment is left unintentionally blank. -message Tag { - // This comment is left unintentionally blank. - bytes name = 1; - // This comment is left unintentionally blank. - string id = 2; - // This comment is left unintentionally blank. - GitCommit target_commit = 3; - // If message exceeds a certain threshold, it will be nullified, - // but its size will be set in message_size so we can know if - // a tag had a message in the first place. - bytes message = 4; - // This comment is left unintentionally blank. - int64 message_size = 5; - // This comment is left unintentionally blank. - CommitAuthor tagger = 6; - // This comment is left unintentionally blank. - SignatureType signature_type = 7; -} - -// This comment is left unintentionally blank. -message User { - // This comment is left unintentionally blank. - string gl_id = 1; - // This comment is left unintentionally blank. - bytes name = 2; - // This comment is left unintentionally blank. - bytes email = 3; - // This comment is left unintentionally blank. - string gl_username = 4; - // Timezone is the timezone as configured by the user in the web interface. This - // timezone may be used when new commits are created via RPC calls. - string timezone = 5; -} - -// This comment is left unintentionally blank. -message ObjectPool { - // This comment is left unintentionally blank. - Repository repository = 1 [(gitaly.repository)=true]; -} - -// This comment is left unintentionally blank. -message PaginationParameter { - // Instructs pagination to start sending results after the provided page - // token appears. A page token allows for a generic pattern to uniquely - // identify a result or 'page'. Each paginated RPC may interpret a page - // token differently. - string page_token = 1; - // When fully consuming the response the client will receive _at most_ - // `limit` number of resulting objects. Note that the number of response - // messages might be much lower, as some response messages already send - // multiple objects per message. - // When the limit is smaller than 0, it will be normalized to 2147483647 - // on the server side. When limit is not set, it defaults to 0, and no - // results are send in the response. - int32 limit = 2; -} - -// This comment is left unintentionally blank. -message PaginationCursor { - // To the caller, this is an opaque token to indicate what the caller - // should present as a page_token to get subsequent results. - string next_cursor = 1; -} - -// https://git-scm.com/docs/git/#_options -message GlobalOptions { - // Treat pathspecs literally (i.e. no globbing, no pathspec magic) - bool literal_pathspecs = 1; -} - -// SortDirection defines the sort direction. -enum SortDirection { - // ASCENDING sorts by the sort key in ascending order. - ASCENDING = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH - // DESCENDING sorts by the sort key in descending order. - DESCENDING = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX -} diff --git a/internal/gitaly/vendored/gitalypb/smarthttp.pb.go b/internal/gitaly/vendored/gitalypb/smarthttp.pb.go deleted file mode 100644 index 0f1ce78f..00000000 --- a/internal/gitaly/vendored/gitalypb/smarthttp.pb.go +++ /dev/null @@ -1,625 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc v3.21.7 -// source: smarthttp.proto - -package gitalypb - -import ( - reflect "reflect" - sync "sync" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -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 InfoRefsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` - GitConfigOptions []string `protobuf:"bytes,2,rep,name=git_config_options,json=gitConfigOptions,proto3" json:"git_config_options,omitempty"` - GitProtocol string `protobuf:"bytes,3,opt,name=git_protocol,json=gitProtocol,proto3" json:"git_protocol,omitempty"` -} - -func (x *InfoRefsRequest) Reset() { - *x = InfoRefsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_smarthttp_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *InfoRefsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InfoRefsRequest) ProtoMessage() {} - -func (x *InfoRefsRequest) ProtoReflect() protoreflect.Message { - mi := &file_smarthttp_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 InfoRefsRequest.ProtoReflect.Descriptor instead. -func (*InfoRefsRequest) Descriptor() ([]byte, []int) { - return file_smarthttp_proto_rawDescGZIP(), []int{0} -} - -func (x *InfoRefsRequest) GetRepository() *Repository { - if x != nil { - return x.Repository - } - return nil -} - -func (x *InfoRefsRequest) GetGitConfigOptions() []string { - if x != nil { - return x.GitConfigOptions - } - return nil -} - -func (x *InfoRefsRequest) GetGitProtocol() string { - if x != nil { - return x.GitProtocol - } - return "" -} - -type InfoRefsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` -} - -func (x *InfoRefsResponse) Reset() { - *x = InfoRefsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_smarthttp_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *InfoRefsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InfoRefsResponse) ProtoMessage() {} - -func (x *InfoRefsResponse) ProtoReflect() protoreflect.Message { - mi := &file_smarthttp_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 InfoRefsResponse.ProtoReflect.Descriptor instead. -func (*InfoRefsResponse) Descriptor() ([]byte, []int) { - return file_smarthttp_proto_rawDescGZIP(), []int{1} -} - -func (x *InfoRefsResponse) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -type PostUploadPackWithSidechannelRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` - GitConfigOptions []string `protobuf:"bytes,2,rep,name=git_config_options,json=gitConfigOptions,proto3" json:"git_config_options,omitempty"` - GitProtocol string `protobuf:"bytes,3,opt,name=git_protocol,json=gitProtocol,proto3" json:"git_protocol,omitempty"` -} - -func (x *PostUploadPackWithSidechannelRequest) Reset() { - *x = PostUploadPackWithSidechannelRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_smarthttp_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PostUploadPackWithSidechannelRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PostUploadPackWithSidechannelRequest) ProtoMessage() {} - -func (x *PostUploadPackWithSidechannelRequest) ProtoReflect() protoreflect.Message { - mi := &file_smarthttp_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 PostUploadPackWithSidechannelRequest.ProtoReflect.Descriptor instead. -func (*PostUploadPackWithSidechannelRequest) Descriptor() ([]byte, []int) { - return file_smarthttp_proto_rawDescGZIP(), []int{2} -} - -func (x *PostUploadPackWithSidechannelRequest) GetRepository() *Repository { - if x != nil { - return x.Repository - } - return nil -} - -func (x *PostUploadPackWithSidechannelRequest) GetGitConfigOptions() []string { - if x != nil { - return x.GitConfigOptions - } - return nil -} - -func (x *PostUploadPackWithSidechannelRequest) GetGitProtocol() string { - if x != nil { - return x.GitProtocol - } - return "" -} - -type PostUploadPackWithSidechannelResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - PackfileNegotiationStatistics *PackfileNegotiationStatistics `protobuf:"bytes,1,opt,name=packfile_negotiation_statistics,json=packfileNegotiationStatistics,proto3" json:"packfile_negotiation_statistics,omitempty"` -} - -func (x *PostUploadPackWithSidechannelResponse) Reset() { - *x = PostUploadPackWithSidechannelResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_smarthttp_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PostUploadPackWithSidechannelResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PostUploadPackWithSidechannelResponse) ProtoMessage() {} - -func (x *PostUploadPackWithSidechannelResponse) ProtoReflect() protoreflect.Message { - mi := &file_smarthttp_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 PostUploadPackWithSidechannelResponse.ProtoReflect.Descriptor instead. -func (*PostUploadPackWithSidechannelResponse) Descriptor() ([]byte, []int) { - return file_smarthttp_proto_rawDescGZIP(), []int{3} -} - -func (x *PostUploadPackWithSidechannelResponse) GetPackfileNegotiationStatistics() *PackfileNegotiationStatistics { - if x != nil { - return x.PackfileNegotiationStatistics - } - return nil -} - -type PostReceivePackRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - GlId string `protobuf:"bytes,3,opt,name=gl_id,json=glId,proto3" json:"gl_id,omitempty"` - GlRepository string `protobuf:"bytes,4,opt,name=gl_repository,json=glRepository,proto3" json:"gl_repository,omitempty"` - GlUsername string `protobuf:"bytes,5,opt,name=gl_username,json=glUsername,proto3" json:"gl_username,omitempty"` - GitProtocol string `protobuf:"bytes,6,opt,name=git_protocol,json=gitProtocol,proto3" json:"git_protocol,omitempty"` - GitConfigOptions []string `protobuf:"bytes,7,rep,name=git_config_options,json=gitConfigOptions,proto3" json:"git_config_options,omitempty"` -} - -func (x *PostReceivePackRequest) Reset() { - *x = PostReceivePackRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_smarthttp_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PostReceivePackRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PostReceivePackRequest) ProtoMessage() {} - -func (x *PostReceivePackRequest) ProtoReflect() protoreflect.Message { - mi := &file_smarthttp_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 PostReceivePackRequest.ProtoReflect.Descriptor instead. -func (*PostReceivePackRequest) Descriptor() ([]byte, []int) { - return file_smarthttp_proto_rawDescGZIP(), []int{4} -} - -func (x *PostReceivePackRequest) GetRepository() *Repository { - if x != nil { - return x.Repository - } - return nil -} - -func (x *PostReceivePackRequest) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -func (x *PostReceivePackRequest) GetGlId() string { - if x != nil { - return x.GlId - } - return "" -} - -func (x *PostReceivePackRequest) GetGlRepository() string { - if x != nil { - return x.GlRepository - } - return "" -} - -func (x *PostReceivePackRequest) GetGlUsername() string { - if x != nil { - return x.GlUsername - } - return "" -} - -func (x *PostReceivePackRequest) GetGitProtocol() string { - if x != nil { - return x.GitProtocol - } - return "" -} - -func (x *PostReceivePackRequest) GetGitConfigOptions() []string { - if x != nil { - return x.GitConfigOptions - } - return nil -} - -type PostReceivePackResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` -} - -func (x *PostReceivePackResponse) Reset() { - *x = PostReceivePackResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_smarthttp_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PostReceivePackResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PostReceivePackResponse) ProtoMessage() {} - -func (x *PostReceivePackResponse) ProtoReflect() protoreflect.Message { - mi := &file_smarthttp_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 PostReceivePackResponse.ProtoReflect.Descriptor instead. -func (*PostReceivePackResponse) Descriptor() ([]byte, []int) { - return file_smarthttp_proto_rawDescGZIP(), []int{5} -} - -func (x *PostReceivePackResponse) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -var File_smarthttp_proto protoreflect.FileDescriptor - -var file_smarthttp_proto_rawDesc = []byte{ - 0x0a, 0x0f, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x06, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x1a, 0x0a, 0x6c, 0x69, 0x6e, 0x74, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0e, 0x70, 0x61, 0x63, 0x6b, 0x66, 0x69, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0c, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0x9c, 0x01, 0x0a, 0x0f, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x66, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 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, 0x42, - 0x04, 0x98, 0xc6, 0x2c, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, - 0x79, 0x12, 0x2c, 0x0a, 0x12, 0x67, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, - 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x67, - 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, - 0x21, 0x0a, 0x0c, 0x67, 0x69, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x67, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, - 0x6f, 0x6c, 0x22, 0x26, 0x0a, 0x10, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x66, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xb1, 0x01, 0x0a, 0x24, 0x50, - 0x6f, 0x73, 0x74, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x57, 0x69, 0x74, - 0x68, 0x53, 0x69, 0x64, 0x65, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x38, 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, 0x42, 0x04, 0x98, 0xc6, 0x2c, - 0x01, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x2c, 0x0a, - 0x12, 0x67, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x6f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x67, 0x69, 0x74, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x67, - 0x69, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x67, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x22, 0x96, - 0x01, 0x0a, 0x25, 0x50, 0x6f, 0x73, 0x74, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x61, 0x63, - 0x6b, 0x57, 0x69, 0x74, 0x68, 0x53, 0x69, 0x64, 0x65, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6d, 0x0a, 0x1f, 0x70, 0x61, 0x63, 0x6b, - 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6e, 0x65, 0x67, 0x6f, 0x74, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x66, - 0x69, 0x6c, 0x65, 0x4e, 0x65, 0x67, 0x6f, 0x74, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, - 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x1d, 0x70, 0x61, 0x63, 0x6b, 0x66, 0x69, - 0x6c, 0x65, 0x4e, 0x65, 0x67, 0x6f, 0x74, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, - 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x22, 0x92, 0x02, 0x0a, 0x16, 0x50, 0x6f, 0x73, 0x74, - 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x38, 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, 0x42, 0x04, 0x98, 0xc6, 0x2c, 0x01, - 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, - 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, - 0x12, 0x13, 0x0a, 0x05, 0x67, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x67, 0x6c, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x67, 0x6c, 0x5f, 0x72, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x67, 0x6c, - 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x67, 0x6c, - 0x5f, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0a, 0x67, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x67, - 0x69, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x67, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x2c, - 0x0a, 0x12, 0x67, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x6f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x67, 0x69, 0x74, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x2d, 0x0a, 0x17, - 0x50, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x32, 0xa0, 0x03, 0x0a, 0x10, - 0x53, 0x6d, 0x61, 0x72, 0x74, 0x48, 0x54, 0x54, 0x50, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x12, 0x51, 0x0a, 0x12, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x66, 0x73, 0x55, 0x70, 0x6c, 0x6f, - 0x61, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x12, 0x17, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, - 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x66, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x18, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x66, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, - 0x02, 0x30, 0x01, 0x12, 0x52, 0x0a, 0x13, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x66, 0x73, 0x52, - 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x12, 0x17, 0x2e, 0x67, 0x69, 0x74, - 0x61, 0x6c, 0x79, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x66, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x49, 0x6e, 0x66, - 0x6f, 0x52, 0x65, 0x66, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, - 0x97, 0x28, 0x02, 0x08, 0x02, 0x30, 0x01, 0x12, 0x84, 0x01, 0x0a, 0x1d, 0x50, 0x6f, 0x73, 0x74, - 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x57, 0x69, 0x74, 0x68, 0x53, 0x69, - 0x64, 0x65, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x2c, 0x2e, 0x67, 0x69, 0x74, 0x61, - 0x6c, 0x79, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x61, 0x63, - 0x6b, 0x57, 0x69, 0x74, 0x68, 0x53, 0x69, 0x64, 0x65, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, - 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x57, - 0x69, 0x74, 0x68, 0x53, 0x69, 0x64, 0x65, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x02, 0x12, 0x5e, - 0x0a, 0x0f, 0x50, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x50, 0x61, 0x63, - 0x6b, 0x12, 0x1e, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x52, - 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x1f, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x52, - 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x01, 0x28, 0x01, 0x30, 0x01, 0x42, 0x5e, - 0x5a, 0x5c, 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x69, 0x74, - 0x6c, 0x61, 0x62, 0x2d, 0x6f, 0x72, 0x67, 0x2f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2d, - 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x69, 0x74, 0x6c, - 0x61, 0x62, 0x2d, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x36, 0x2f, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2f, 0x76, 0x65, 0x6e, - 0x64, 0x6f, 0x72, 0x65, 0x64, 0x2f, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x70, 0x62, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_smarthttp_proto_rawDescOnce sync.Once - file_smarthttp_proto_rawDescData = file_smarthttp_proto_rawDesc -) - -func file_smarthttp_proto_rawDescGZIP() []byte { - file_smarthttp_proto_rawDescOnce.Do(func() { - file_smarthttp_proto_rawDescData = protoimpl.X.CompressGZIP(file_smarthttp_proto_rawDescData) - }) - return file_smarthttp_proto_rawDescData -} - -var file_smarthttp_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_smarthttp_proto_goTypes = []interface{}{ - (*InfoRefsRequest)(nil), // 0: gitaly.InfoRefsRequest - (*InfoRefsResponse)(nil), // 1: gitaly.InfoRefsResponse - (*PostUploadPackWithSidechannelRequest)(nil), // 2: gitaly.PostUploadPackWithSidechannelRequest - (*PostUploadPackWithSidechannelResponse)(nil), // 3: gitaly.PostUploadPackWithSidechannelResponse - (*PostReceivePackRequest)(nil), // 4: gitaly.PostReceivePackRequest - (*PostReceivePackResponse)(nil), // 5: gitaly.PostReceivePackResponse - (*Repository)(nil), // 6: gitaly.Repository - (*PackfileNegotiationStatistics)(nil), // 7: gitaly.PackfileNegotiationStatistics -} -var file_smarthttp_proto_depIdxs = []int32{ - 6, // 0: gitaly.InfoRefsRequest.repository:type_name -> gitaly.Repository - 6, // 1: gitaly.PostUploadPackWithSidechannelRequest.repository:type_name -> gitaly.Repository - 7, // 2: gitaly.PostUploadPackWithSidechannelResponse.packfile_negotiation_statistics:type_name -> gitaly.PackfileNegotiationStatistics - 6, // 3: gitaly.PostReceivePackRequest.repository:type_name -> gitaly.Repository - 0, // 4: gitaly.SmartHTTPService.InfoRefsUploadPack:input_type -> gitaly.InfoRefsRequest - 0, // 5: gitaly.SmartHTTPService.InfoRefsReceivePack:input_type -> gitaly.InfoRefsRequest - 2, // 6: gitaly.SmartHTTPService.PostUploadPackWithSidechannel:input_type -> gitaly.PostUploadPackWithSidechannelRequest - 4, // 7: gitaly.SmartHTTPService.PostReceivePack:input_type -> gitaly.PostReceivePackRequest - 1, // 8: gitaly.SmartHTTPService.InfoRefsUploadPack:output_type -> gitaly.InfoRefsResponse - 1, // 9: gitaly.SmartHTTPService.InfoRefsReceivePack:output_type -> gitaly.InfoRefsResponse - 3, // 10: gitaly.SmartHTTPService.PostUploadPackWithSidechannel:output_type -> gitaly.PostUploadPackWithSidechannelResponse - 5, // 11: gitaly.SmartHTTPService.PostReceivePack:output_type -> gitaly.PostReceivePackResponse - 8, // [8:12] is the sub-list for method output_type - 4, // [4:8] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name -} - -func init() { file_smarthttp_proto_init() } -func file_smarthttp_proto_init() { - if File_smarthttp_proto != nil { - return - } - file_lint_proto_init() - file_packfile_proto_init() - file_shared_proto_init() - if !protoimpl.UnsafeEnabled { - file_smarthttp_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InfoRefsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_smarthttp_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InfoRefsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_smarthttp_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PostUploadPackWithSidechannelRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_smarthttp_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PostUploadPackWithSidechannelResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_smarthttp_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PostReceivePackRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_smarthttp_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PostReceivePackResponse); 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_smarthttp_proto_rawDesc, - NumEnums: 0, - NumMessages: 6, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_smarthttp_proto_goTypes, - DependencyIndexes: file_smarthttp_proto_depIdxs, - MessageInfos: file_smarthttp_proto_msgTypes, - }.Build() - File_smarthttp_proto = out.File - file_smarthttp_proto_rawDesc = nil - file_smarthttp_proto_goTypes = nil - file_smarthttp_proto_depIdxs = nil -} diff --git a/internal/gitaly/vendored/gitalypb/smarthttp.proto b/internal/gitaly/vendored/gitalypb/smarthttp.proto deleted file mode 100644 index 36cc3fd3..00000000 --- a/internal/gitaly/vendored/gitalypb/smarthttp.proto +++ /dev/null @@ -1,121 +0,0 @@ -syntax = "proto3"; - -package gitaly; - -import "lint.proto"; -import "packfile.proto"; -import "shared.proto"; - -option go_package = "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/gitalypb"; - -// SmartHTTPService is a service that provides RPCs required for HTTP-based Git -// clones via the smart HTTP protocol. -service SmartHTTPService { - // InfoRefsUploadPack provides the response for GET /info/refs?service=git-upload-pack. - // It is invoked when the client fetches packs from the server, meaning the server will - // upload the packs to that client. The client doesn't upload new objects. This is used - // to advertise the references available on the server to the client via - // git-upload-pack(1)'s `--advertise-refs` option. - rpc InfoRefsUploadPack(InfoRefsRequest) returns (stream InfoRefsResponse) { - option (op_type) = { - op: ACCESSOR - }; - } - - // InfoRefsReceivePack provides the response for GET /info/refs?service=git-receive-pack. - // It is invoked when the client pushes packs to the server, meaning the server - // will fetch the packs from the client. This is used to advertise the references - // available on the server to the client via git-receive-pack(1)'s `--advertise-refs` - // option. - rpc InfoRefsReceivePack(InfoRefsRequest) returns (stream InfoRefsResponse) { - option (op_type) = { - op: ACCESSOR - }; - } - - - // PostUploadPackWithSidechannel provides the response for POST /upload-pack. It - // used to transfer pack files from the server to the client via sidechannels. This - // is invoked when the client executes `git fetch`. - // - // More info on sidechannels: https://gitlab.com/gitlab-org/gitaly/-/blob/master/doc/sidechannel.md - rpc PostUploadPackWithSidechannel(PostUploadPackWithSidechannelRequest) returns (PostUploadPackWithSidechannelResponse) { - option (op_type) = { - op: ACCESSOR - }; - } - - // PostReceivePack provides the response for POST /receive-pack. It used to transfer - // pack files from the client to the server. This is invoked when the client executes `git push`. - rpc PostReceivePack(stream PostReceivePackRequest) returns (stream PostReceivePackResponse) { - option (op_type) = { - op: MUTATOR - }; - } -} - -// InfoRefsRequest is a request for the InfoRefsUploadPack and InfoRefsUploadPack rpcs. -message InfoRefsRequest { - // Repository is the repository on which to operate. - Repository repository = 1 [(target_repository)=true]; - // GitConfigOptions are parameters to use with git -c (key=value pairs). - repeated string git_config_options = 2; - // GitProtocol is the git protocol version. - string git_protocol = 3; -} - -// InfoRefsResponse is the response of InfoRefsUploadPack and InfoRefsUploadPack rpcs. -// It is used to provide the client with the servers advertised refs. -message InfoRefsResponse { - // Data is the raw data copied from the stdout of git-upload-pack(1) or - // git-receive-pack(1) when used with the `--advertise-refs` flag. - bytes data = 1; -} - -// PostUploadPackWithSidechannelRequest is the request for the PostUploadPackWithSidechannel rpc. -message PostUploadPackWithSidechannelRequest { - // Repository is the repository on which to operate. - Repository repository = 1 [(target_repository)=true]; - // GitConfigOptions are parameters to use with git -c (key=value pairs). - repeated string git_config_options = 2; - // GitProtocol is the git protocol version. - string git_protocol = 3; -} - -// PostUploadPackWithSidechannelResponse is the response for the PostUploadPackWithSidechannel rpc. -// This is an empty response since the raw data is transferred to the client via the sidechannel -// exclusively. -message PostUploadPackWithSidechannelResponse { - // Packfile negotiation statistics. - PackfileNegotiationStatistics packfile_negotiation_statistics = 1; -} - -// PostReceivePackRequest is the request for the PostReceivePack rpc. It is a stream used to -// transfer the raw data from the client to the servers stdin of git-receive-pack(1) process. -message PostReceivePackRequest { - // Repository is the repository on which to operate. - // It should only be present in the first message of the stream. - Repository repository = 1 [(target_repository)=true]; - // Data is the raw data to be copied to stdin of 'git receive-pack'. - bytes data = 2; - // GlID is the GitLab ID of the user. This is used by Git {pre,post}-receive hooks. - // It should only be present in the first message of the stream. - string gl_id = 3; - // GlRepository refers to the GitLab repository. This is used by Git {pre,post}-receive hooks. - // It should only be present in the first message of the stream. - string gl_repository = 4; - // GlID is the GitLab Username of the user. This is used by Git {pre,post}-receive hooks. - // It should only be present in the first message of the stream. - string gl_username = 5; - // GitProtocol is the git protocol version. - string git_protocol = 6; - // GitConfigOptions are parameters to use with git -c (key=value pairs). - repeated string git_config_options = 7; -} - -// PostReceivePackResponse is the response for the PostReceivePack rpc. It is a stream used to -// transfer the raw data from the stdout of git-receive-pack(1) from the server to the client. -message PostReceivePackResponse { - // Data is the raw data from the stdout of 'git receive-pack'. - bytes data = 1; -} diff --git a/internal/gitaly/vendored/gitalypb/smarthttp_grpc.pb.go b/internal/gitaly/vendored/gitalypb/smarthttp_grpc.pb.go deleted file mode 100644 index c3850e2d..00000000 --- a/internal/gitaly/vendored/gitalypb/smarthttp_grpc.pb.go +++ /dev/null @@ -1,308 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v3.21.7 -// source: smarthttp.proto - -package gitalypb - -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 - -const ( - SmartHTTPService_InfoRefsUploadPack_FullMethodName = "/gitaly.SmartHTTPService/InfoRefsUploadPack" - SmartHTTPService_InfoRefsReceivePack_FullMethodName = "/gitaly.SmartHTTPService/InfoRefsReceivePack" - SmartHTTPService_PostUploadPackWithSidechannel_FullMethodName = "/gitaly.SmartHTTPService/PostUploadPackWithSidechannel" - SmartHTTPService_PostReceivePack_FullMethodName = "/gitaly.SmartHTTPService/PostReceivePack" -) - -// SmartHTTPServiceClient is the client API for SmartHTTPService 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 SmartHTTPServiceClient interface { - InfoRefsUploadPack(ctx context.Context, in *InfoRefsRequest, opts ...grpc.CallOption) (SmartHTTPService_InfoRefsUploadPackClient, error) - InfoRefsReceivePack(ctx context.Context, in *InfoRefsRequest, opts ...grpc.CallOption) (SmartHTTPService_InfoRefsReceivePackClient, error) - PostUploadPackWithSidechannel(ctx context.Context, in *PostUploadPackWithSidechannelRequest, opts ...grpc.CallOption) (*PostUploadPackWithSidechannelResponse, error) - PostReceivePack(ctx context.Context, opts ...grpc.CallOption) (SmartHTTPService_PostReceivePackClient, error) -} - -type smartHTTPServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewSmartHTTPServiceClient(cc grpc.ClientConnInterface) SmartHTTPServiceClient { - return &smartHTTPServiceClient{cc} -} - -func (c *smartHTTPServiceClient) InfoRefsUploadPack(ctx context.Context, in *InfoRefsRequest, opts ...grpc.CallOption) (SmartHTTPService_InfoRefsUploadPackClient, error) { - stream, err := c.cc.NewStream(ctx, &SmartHTTPService_ServiceDesc.Streams[0], SmartHTTPService_InfoRefsUploadPack_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &smartHTTPServiceInfoRefsUploadPackClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type SmartHTTPService_InfoRefsUploadPackClient interface { - Recv() (*InfoRefsResponse, error) - grpc.ClientStream -} - -type smartHTTPServiceInfoRefsUploadPackClient struct { - grpc.ClientStream -} - -func (x *smartHTTPServiceInfoRefsUploadPackClient) Recv() (*InfoRefsResponse, error) { - m := new(InfoRefsResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *smartHTTPServiceClient) InfoRefsReceivePack(ctx context.Context, in *InfoRefsRequest, opts ...grpc.CallOption) (SmartHTTPService_InfoRefsReceivePackClient, error) { - stream, err := c.cc.NewStream(ctx, &SmartHTTPService_ServiceDesc.Streams[1], SmartHTTPService_InfoRefsReceivePack_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &smartHTTPServiceInfoRefsReceivePackClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type SmartHTTPService_InfoRefsReceivePackClient interface { - Recv() (*InfoRefsResponse, error) - grpc.ClientStream -} - -type smartHTTPServiceInfoRefsReceivePackClient struct { - grpc.ClientStream -} - -func (x *smartHTTPServiceInfoRefsReceivePackClient) Recv() (*InfoRefsResponse, error) { - m := new(InfoRefsResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *smartHTTPServiceClient) PostUploadPackWithSidechannel(ctx context.Context, in *PostUploadPackWithSidechannelRequest, opts ...grpc.CallOption) (*PostUploadPackWithSidechannelResponse, error) { - out := new(PostUploadPackWithSidechannelResponse) - err := c.cc.Invoke(ctx, SmartHTTPService_PostUploadPackWithSidechannel_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *smartHTTPServiceClient) PostReceivePack(ctx context.Context, opts ...grpc.CallOption) (SmartHTTPService_PostReceivePackClient, error) { - stream, err := c.cc.NewStream(ctx, &SmartHTTPService_ServiceDesc.Streams[2], SmartHTTPService_PostReceivePack_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &smartHTTPServicePostReceivePackClient{stream} - return x, nil -} - -type SmartHTTPService_PostReceivePackClient interface { - Send(*PostReceivePackRequest) error - Recv() (*PostReceivePackResponse, error) - grpc.ClientStream -} - -type smartHTTPServicePostReceivePackClient struct { - grpc.ClientStream -} - -func (x *smartHTTPServicePostReceivePackClient) Send(m *PostReceivePackRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *smartHTTPServicePostReceivePackClient) Recv() (*PostReceivePackResponse, error) { - m := new(PostReceivePackResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// SmartHTTPServiceServer is the server API for SmartHTTPService service. -// All implementations must embed UnimplementedSmartHTTPServiceServer -// for forward compatibility -type SmartHTTPServiceServer interface { - InfoRefsUploadPack(*InfoRefsRequest, SmartHTTPService_InfoRefsUploadPackServer) error - InfoRefsReceivePack(*InfoRefsRequest, SmartHTTPService_InfoRefsReceivePackServer) error - PostUploadPackWithSidechannel(context.Context, *PostUploadPackWithSidechannelRequest) (*PostUploadPackWithSidechannelResponse, error) - PostReceivePack(SmartHTTPService_PostReceivePackServer) error - mustEmbedUnimplementedSmartHTTPServiceServer() -} - -// UnimplementedSmartHTTPServiceServer must be embedded to have forward compatible implementations. -type UnimplementedSmartHTTPServiceServer struct { -} - -func (UnimplementedSmartHTTPServiceServer) InfoRefsUploadPack(*InfoRefsRequest, SmartHTTPService_InfoRefsUploadPackServer) error { - return status.Errorf(codes.Unimplemented, "method InfoRefsUploadPack not implemented") -} -func (UnimplementedSmartHTTPServiceServer) InfoRefsReceivePack(*InfoRefsRequest, SmartHTTPService_InfoRefsReceivePackServer) error { - return status.Errorf(codes.Unimplemented, "method InfoRefsReceivePack not implemented") -} -func (UnimplementedSmartHTTPServiceServer) PostUploadPackWithSidechannel(context.Context, *PostUploadPackWithSidechannelRequest) (*PostUploadPackWithSidechannelResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method PostUploadPackWithSidechannel not implemented") -} -func (UnimplementedSmartHTTPServiceServer) PostReceivePack(SmartHTTPService_PostReceivePackServer) error { - return status.Errorf(codes.Unimplemented, "method PostReceivePack not implemented") -} -func (UnimplementedSmartHTTPServiceServer) mustEmbedUnimplementedSmartHTTPServiceServer() {} - -// UnsafeSmartHTTPServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to SmartHTTPServiceServer will -// result in compilation errors. -type UnsafeSmartHTTPServiceServer interface { - mustEmbedUnimplementedSmartHTTPServiceServer() -} - -func RegisterSmartHTTPServiceServer(s grpc.ServiceRegistrar, srv SmartHTTPServiceServer) { - s.RegisterService(&SmartHTTPService_ServiceDesc, srv) -} - -func _SmartHTTPService_InfoRefsUploadPack_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(InfoRefsRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(SmartHTTPServiceServer).InfoRefsUploadPack(m, &smartHTTPServiceInfoRefsUploadPackServer{stream}) -} - -type SmartHTTPService_InfoRefsUploadPackServer interface { - Send(*InfoRefsResponse) error - grpc.ServerStream -} - -type smartHTTPServiceInfoRefsUploadPackServer struct { - grpc.ServerStream -} - -func (x *smartHTTPServiceInfoRefsUploadPackServer) Send(m *InfoRefsResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _SmartHTTPService_InfoRefsReceivePack_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(InfoRefsRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(SmartHTTPServiceServer).InfoRefsReceivePack(m, &smartHTTPServiceInfoRefsReceivePackServer{stream}) -} - -type SmartHTTPService_InfoRefsReceivePackServer interface { - Send(*InfoRefsResponse) error - grpc.ServerStream -} - -type smartHTTPServiceInfoRefsReceivePackServer struct { - grpc.ServerStream -} - -func (x *smartHTTPServiceInfoRefsReceivePackServer) Send(m *InfoRefsResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _SmartHTTPService_PostUploadPackWithSidechannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PostUploadPackWithSidechannelRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SmartHTTPServiceServer).PostUploadPackWithSidechannel(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: SmartHTTPService_PostUploadPackWithSidechannel_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SmartHTTPServiceServer).PostUploadPackWithSidechannel(ctx, req.(*PostUploadPackWithSidechannelRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _SmartHTTPService_PostReceivePack_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(SmartHTTPServiceServer).PostReceivePack(&smartHTTPServicePostReceivePackServer{stream}) -} - -type SmartHTTPService_PostReceivePackServer interface { - Send(*PostReceivePackResponse) error - Recv() (*PostReceivePackRequest, error) - grpc.ServerStream -} - -type smartHTTPServicePostReceivePackServer struct { - grpc.ServerStream -} - -func (x *smartHTTPServicePostReceivePackServer) Send(m *PostReceivePackResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *smartHTTPServicePostReceivePackServer) Recv() (*PostReceivePackRequest, error) { - m := new(PostReceivePackRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// SmartHTTPService_ServiceDesc is the grpc.ServiceDesc for SmartHTTPService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var SmartHTTPService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "gitaly.SmartHTTPService", - HandlerType: (*SmartHTTPServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "PostUploadPackWithSidechannel", - Handler: _SmartHTTPService_PostUploadPackWithSidechannel_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "InfoRefsUploadPack", - Handler: _SmartHTTPService_InfoRefsUploadPack_Handler, - ServerStreams: true, - }, - { - StreamName: "InfoRefsReceivePack", - Handler: _SmartHTTPService_InfoRefsReceivePack_Handler, - ServerStreams: true, - }, - { - StreamName: "PostReceivePack", - Handler: _SmartHTTPService_PostReceivePack_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "smarthttp.proto", -} diff --git a/internal/gitaly/vendored/gittest/BUILD.bazel b/internal/gitaly/vendored/gittest/BUILD.bazel deleted file mode 100644 index e9a80477..00000000 --- a/internal/gitaly/vendored/gittest/BUILD.bazel +++ /dev/null @@ -1,12 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "gittest", - srcs = ["pktline.go"], - importpath = "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/gittest", - visibility = ["//:__subpackages__"], - deps = [ - "//internal/gitaly/vendored/pktline", - "@com_github_stretchr_testify//require", - ], -) diff --git a/internal/gitaly/vendored/gittest/pktline.go b/internal/gitaly/vendored/gittest/pktline.go deleted file mode 100644 index 377cc65d..00000000 --- a/internal/gitaly/vendored/gittest/pktline.go +++ /dev/null @@ -1,25 +0,0 @@ -package gittest - -import ( - "io" - "testing" - - "github.com/stretchr/testify/require" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/pktline" -) - -// WritePktlineString writes the pktline-formatted data into the writer. -func WritePktlineString(t testing.TB, writer io.Writer, data string) { - _, err := pktline.WriteString(writer, data) - require.NoError(t, err) -} - -// WritePktlineFlush writes the pktline-formatted flush into the writer. -func WritePktlineFlush(t testing.TB, writer io.Writer) { - require.NoError(t, pktline.WriteFlush(writer)) -} - -// WritePktlineDelim writes the pktline-formatted delimiter into the writer. -func WritePktlineDelim(t testing.TB, writer io.Writer) { - require.NoError(t, pktline.WriteDelim(writer)) -} diff --git a/internal/gitaly/vendored/grpc/client/BUILD.bazel b/internal/gitaly/vendored/grpc/client/BUILD.bazel deleted file mode 100644 index 6f59423b..00000000 --- a/internal/gitaly/vendored/grpc/client/BUILD.bazel +++ /dev/null @@ -1,20 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "client", - srcs = [ - "address_parser.go", - "dial.go", - ], - importpath = "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/grpc/client", - visibility = ["//:__subpackages__"], - deps = [ - "//internal/gitaly/vendored/dnsresolver", - "//internal/gitaly/vendored/gitalypb", - "@org_golang_google_grpc//:grpc", - "@org_golang_google_grpc//credentials", - "@org_golang_google_grpc//credentials/insecure", - "@org_golang_google_grpc//keepalive", - "@org_golang_google_protobuf//encoding/protojson", - ], -) diff --git a/internal/gitaly/vendored/grpc/client/address_parser.go b/internal/gitaly/vendored/grpc/client/address_parser.go deleted file mode 100644 index 1d0d560c..00000000 --- a/internal/gitaly/vendored/grpc/client/address_parser.go +++ /dev/null @@ -1,38 +0,0 @@ -package client - -import ( - "fmt" - "net/url" - "strings" -) - -// extractHostFromRemoteURL will convert Gitaly-style URL addresses of the form -// scheme://host:port to the "host:port" addresses used by `grpc.Dial` -func extractHostFromRemoteURL(rawAddress string) (hostAndPort string, err error) { - u, err := url.Parse(rawAddress) - if err != nil { - return "", fmt.Errorf("failed to parse remote addresses: %w", err) - } - - if u.Path != "" { - return "", fmt.Errorf("remote addresses should not have a path: %q", u.Path) - } - - if u.Host == "" { - return "", fmt.Errorf("remote addresses should have a host") - } - - return u.Host, nil -} - -// extractPathFromSocketURL will convert Gitaly-style URL addresses of the form -// unix:/path/to/socket into file paths: `/path/to/socket` -const unixPrefix = "unix:" - -func extractPathFromSocketURL(rawAddress string) (socketPath string, err error) { - if !strings.HasPrefix(rawAddress, unixPrefix) { - return "", fmt.Errorf("invalid socket address: %s", rawAddress) - } - - return strings.TrimPrefix(rawAddress, unixPrefix), nil -} diff --git a/internal/gitaly/vendored/grpc/client/dial.go b/internal/gitaly/vendored/grpc/client/dial.go deleted file mode 100644 index 7179525c..00000000 --- a/internal/gitaly/vendored/grpc/client/dial.go +++ /dev/null @@ -1,232 +0,0 @@ -package client - -import ( - "context" - "crypto/tls" - "crypto/x509" - "fmt" - "net" - "net/url" - "time" - - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/dnsresolver" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/gitalypb" - "google.golang.org/grpc" - "google.golang.org/grpc/credentials" - "google.golang.org/grpc/credentials/insecure" - "google.golang.org/grpc/keepalive" - "google.golang.org/protobuf/encoding/protojson" -) - -type connectionType int - -const ( - invalidConnection connectionType = iota - tcpConnection - tlsConnection - unixConnection - dnsConnection -) - -func getConnectionType(rawAddress string) connectionType { - u, err := url.Parse(rawAddress) - if err != nil { - return invalidConnection - } - - switch u.Scheme { - case "tls": - return tlsConnection - case "unix": - return unixConnection - case "tcp": - return tcpConnection - case "dns": - return dnsConnection - default: - return invalidConnection - } -} - -// Handshaker is an interface that allows for wrapping the transport credentials -// with a custom handshake. -type Handshaker interface { - // ClientHandshake wraps the provided credentials and returns new credentials. - ClientHandshake(credentials.TransportCredentials) credentials.TransportCredentials -} - -type dialConfig struct { - handshaker Handshaker - grpcOpts []grpc.DialOption - creds credentials.TransportCredentials -} - -// DialOption is an option that can be passed to Dial. -type DialOption func(*dialConfig) - -// WithHandshaker sets up the given handshaker so that it's passed as the transport credentials -// which would be otherwise set. The transport credentials returned by handshaker are then set -// instead. -func WithHandshaker(handshaker Handshaker) DialOption { - return func(cfg *dialConfig) { - cfg.handshaker = handshaker - } -} - -// WithGrpcOptions will set up the given gRPC dial options so that they will be used when calling -// `grpc.DialContext()`. -func WithGrpcOptions(opts []grpc.DialOption) DialOption { - return func(cfg *dialConfig) { - cfg.grpcOpts = opts - } -} - -// WithTransportCredentials sets up the given credentials. By default, non-TLS connections will use -// insecure credentials whereas TLS connections will use the x509 system certificate pool. This -// option allows callers to override these defaults. -func WithTransportCredentials(creds credentials.TransportCredentials) DialOption { - return func(cfg *dialConfig) { - cfg.creds = creds - } -} - -// Dial dials a Gitaly node serving at the given address. Dial is used by the public 'client' package -// and the expected behavior is mostly documented there. -func Dial(ctx context.Context, rawAddress string, opts ...DialOption) (*grpc.ClientConn, error) { - var dialCfg dialConfig - for _, opt := range opts { - opt(&dialCfg) - } - - // copy to avoid potentially mutating the backing array of the passed slice - connOpts := cloneOpts(dialCfg.grpcOpts) - - var canonicalAddress string - var err error - var secure bool - - switch getConnectionType(rawAddress) { - case invalidConnection: - return nil, fmt.Errorf("invalid connection string: %q", rawAddress) - case tlsConnection: - canonicalAddress, err = extractHostFromRemoteURL(rawAddress) // Ensure the form: "host:port" ... - if err != nil { - return nil, fmt.Errorf("failed to extract host for 'tls' connection: %w", err) - } - - secure = true - case tcpConnection: - canonicalAddress, err = extractHostFromRemoteURL(rawAddress) // Ensure the form: "host:port" ... - if err != nil { - return nil, fmt.Errorf("failed to extract host for 'tcp' connection: %w", err) - } - case dnsConnection: - err = dnsresolver.ValidateURL(rawAddress) - if err != nil { - return nil, fmt.Errorf("failed to parse target for 'dns' connection: %w", err) - } - canonicalAddress = rawAddress // DNS Resolver will handle this - - case unixConnection: - canonicalAddress = rawAddress // This will be overridden by the custom dialer... - connOpts = append( - connOpts, - // Use a custom dialer to ensure that we don't experience - // issues in environments that have proxy configurations - // https://gitlab.com/gitlab-org/gitaly/merge_requests/1072#note_140408512 - grpc.WithContextDialer(func(ctx context.Context, addr string) (conn net.Conn, err error) { - path, err := extractPathFromSocketURL(addr) - if err != nil { - return nil, fmt.Errorf("failed to extract host for 'unix' connection: %w", err) - } - - d := net.Dialer{} - return d.DialContext(ctx, "unix", path) - }), - ) - } - - transportCredentials := dialCfg.creds - if transportCredentials == nil { - if !secure { - transportCredentials = insecure.NewCredentials() - } else { - certPool, err := x509.SystemCertPool() // nolint: govet - if err != nil { - return nil, fmt.Errorf("failed to get system certificat pool for 'tls' connection: %w", err) - } - - transportCredentials = credentials.NewTLS(&tls.Config{ - RootCAs: certPool, - MinVersion: tls.VersionTLS12, - }) - } - } - - if dialCfg.handshaker != nil { - transportCredentials = dialCfg.handshaker.ClientHandshake(transportCredentials) - } - - connOpts = append(connOpts, - grpc.WithTransportCredentials(transportCredentials), - // grpc.KeepaliveParams must be specified at least as large as what is allowed by the - // server-side grpc.KeepaliveEnforcementPolicy - grpc.WithKeepaliveParams(keepalive.ClientParameters{ - Time: 20 * time.Second, - PermitWithoutStream: true, - }), - // grpc.WithDisableServiceConfig ignores the service config provided by resolvers - // when they resolve the target. gRPC provides this feature to inject service - // config from external sources (DNS TXT record, for example). Gitaly doesn't need - // this feature. When we implement a custom client-side load balancer, this feature - // can even break the balancer. So, we should better disable it. - // For more information, please visit - // - https://github.com/grpc/proposal/blob/master/A2-service-configs-in-dns.md - grpc.WithDisableServiceConfig(), - // grpc.WithDefaultServiceConfig sets the recommended client-side load balancing - // configuration to client dial. By default, gRPC clients don't support client-side load - // balancing. After the connection to a host is established for the first time, that - // client always sticks to that host. In all Gitaly clients, the connection is cached - // somehow, usually one connection per host. It means they always stick to the same - // host until the process restarts. This is not a problem in pure Gitaly environment. - // In a cluster with more than one Praefect node, this behavior may cause serious - // workload skew, especially after a fail-over event. - // - // This option configures the load balancing strategy to `round_robin`. This is a - // built-in strategy grpc-go provides. When combining with service discovery via DNS, - // a client can distribute its requests to all discovered nodes in a round-robin - // fashion. The client can detect the connectivity changes, such as a node goes - // down/up again. It evicts subsequent requests accordingly. - // - // For more information: - // https://gitlab.com/groups/gitlab-org/-/epics/8971#note_1207008162 - grpc.WithDefaultServiceConfig(defaultServiceConfig()), - ) - - conn, err := grpc.DialContext(ctx, canonicalAddress, connOpts...) - if err != nil { - return nil, fmt.Errorf("failed to dial %q connection: %w", canonicalAddress, err) - } - - return conn, nil -} - -func cloneOpts(opts []grpc.DialOption) []grpc.DialOption { - clone := make([]grpc.DialOption, len(opts)) - copy(clone, opts) - return clone -} - -func defaultServiceConfig() string { - serviceConfig := &gitalypb.ServiceConfig{ - LoadBalancingConfig: []*gitalypb.LoadBalancingConfig{{ - Policy: &gitalypb.LoadBalancingConfig_RoundRobin{}, - }}, - } - configJSON, err := protojson.Marshal(serviceConfig) - if err != nil { - panic("fail to convert service config from protobuf to json") - } - - return string(configJSON) -} diff --git a/internal/gitaly/vendored/pktline/BUILD.bazel b/internal/gitaly/vendored/pktline/BUILD.bazel deleted file mode 100644 index 3cfe5ca8..00000000 --- a/internal/gitaly/vendored/pktline/BUILD.bazel +++ /dev/null @@ -1,16 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") -load("//build:build.bzl", "go_custom_test") - -go_library( - name = "pktline", - srcs = ["pktline.go"], - importpath = "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/pktline", - visibility = ["//:__subpackages__"], -) - -go_custom_test( - name = "pktline_test", - srcs = ["pkt_line_test.go"], - embed = [":pktline"], - deps = ["@com_github_stretchr_testify//require"], -) diff --git a/internal/gitaly/vendored/pktline/pkt_line_test.go b/internal/gitaly/vendored/pktline/pkt_line_test.go deleted file mode 100644 index 9e048fdc..00000000 --- a/internal/gitaly/vendored/pktline/pkt_line_test.go +++ /dev/null @@ -1,157 +0,0 @@ -package pktline - -import ( - "bytes" - "strings" - "testing" - - "github.com/stretchr/testify/require" -) - -var largestString = strings.Repeat("z", 65516) - -func TestScanner(t *testing.T) { - largestPacket := "fff0" + largestString - testCases := []struct { - desc string - in string - out []string - fail bool - }{ - { - desc: "happy path", - in: "0010hello world!000000010010hello world!", - out: []string{"0010hello world!", "0000", "0001", "0010hello world!"}, - }, - { - desc: "large input", - in: "0010hello world!0000" + largestPacket + "0000", - out: []string{"0010hello world!", "0000", largestPacket, "0000"}, - }, - { - desc: "missing byte middle", - in: "0010hello world!00000010010hello world!", - out: []string{"0010hello world!", "0000", "0010010hello wor"}, - fail: true, - }, - { - desc: "unfinished prefix", - in: "0010hello world!000", - out: []string{"0010hello world!"}, - fail: true, - }, - { - desc: "short read in data, only prefix", - in: "0010hello world!0005", - out: []string{"0010hello world!"}, - fail: true, - }, - } - - for _, tc := range testCases { - t.Run(tc.desc, func(t *testing.T) { - scanner := NewScanner(strings.NewReader(tc.in), make([]byte, MaxPktSize)) - var output []string - for scanner.Scan() { - output = append(output, scanner.Text()) - } - - if tc.fail { - require.Error(t, scanner.Err()) - } else { - require.NoError(t, scanner.Err()) - } - - require.Equal(t, tc.out, output) - }) - } -} - -func TestData(t *testing.T) { - testCases := []struct { - in string - out string - }{ - {in: "0008abcd", out: "abcd"}, - {in: "invalid packet", out: "lid packet"}, - {in: "0005wrong length prefix", out: "wrong length prefix"}, - {in: "0000", out: ""}, - } - - for _, tc := range testCases { - t.Run(tc.in, func(t *testing.T) { - require.Equal(t, tc.out, string(Data([]byte(tc.in)))) - }) - } -} - -func TestIsFlush(t *testing.T) { - testCases := []struct { - in string - flush bool - }{ - {in: "0008abcd", flush: false}, - {in: "invalid packet", flush: false}, - {in: "0000", flush: true}, - {in: "0001", flush: false}, - } - - for _, tc := range testCases { - t.Run(tc.in, func(t *testing.T) { - require.Equal(t, tc.flush, IsFlush([]byte(tc.in))) - }) - } -} - -func TestWriteString(t *testing.T) { - testCases := []struct { - desc string - in string - out string - fail bool - }{ - { - desc: "empty string", - in: "", - out: "0004", - }, - { - desc: "small string", - in: "hello world!", - out: "0010hello world!", - }, - { - desc: "largest possible string", - in: largestString, - out: "fff0" + largestString, - }, - { - desc: "string that is too large", - in: "x" + largestString, - fail: true, - }, - } - - for _, tc := range testCases { - t.Run(tc.desc, func(t *testing.T) { - w := &bytes.Buffer{} - n, err := WriteString(w, tc.in) - - if tc.fail { - require.Error(t, err) - return - } - - require.NoError(t, err) - require.Equal(t, len(tc.in), n, "number of bytes written reported by WriteString") - - require.Equal(t, tc.out, w.String()) - }) - } -} - -func TestWriteFlush(t *testing.T) { - w := &bytes.Buffer{} - require.NoError(t, WriteFlush(w)) - require.Equal(t, "0000", w.String()) -} diff --git a/internal/gitaly/vendored/pktline/pktline.go b/internal/gitaly/vendored/pktline/pktline.go deleted file mode 100644 index 7ec31ac5..00000000 --- a/internal/gitaly/vendored/pktline/pktline.go +++ /dev/null @@ -1,117 +0,0 @@ -package pktline - -// Utility functions for working with the Git pkt-line format. See -// https://github.com/git/git/blob/master/Documentation/technical/protocol-common.txt - -import ( - "bufio" - "bytes" - "fmt" - "io" - "strconv" - "unsafe" -) - -const ( - // MaxPktSize is the maximum size of content of a Git pktline side-band-64k - // packet, excluding size of length and band number - // https://gitlab.com/gitlab-org/git/-/blob/v2.30.0/pkt-line.h#L216 - MaxPktSize = 65520 - pktDelim = "0001" -) - -// NewScanner returns a bufio.Scanner that splits on Git pktline boundaries -// Buf must be at least MaxPktSize large. -func NewScanner(r io.Reader, buf []byte) *bufio.Scanner { - scanner := bufio.NewScanner(r) - scanner.Buffer(buf[0:MaxPktSize:MaxPktSize], MaxPktSize) - scanner.Split(pktLineSplitter) - return scanner -} - -// Data returns the packet pkt without its length header. The length -// header is not validated. Returns an empty slice when pkt is a magic packet such -// as '0000'. -func Data(pkt []byte) []byte { - return pkt[4:] -} - -// IsFlush detects the special flush packet '0000' -func IsFlush(pkt []byte) bool { - return bytes.Equal(pkt, PktFlush()) -} - -// WriteString writes a string with pkt-line framing -func WriteString(w io.Writer, str string) (int, error) { - pktLen := len(str) + 4 - if pktLen > MaxPktSize { - return 0, fmt.Errorf("string too large: %d bytes", len(str)) - } - - _, err := fmt.Fprintf(w, "%04x%s", pktLen, str) - return len(str), err -} - -// WriteFlush writes a pkt flush packet. -func WriteFlush(w io.Writer) error { - _, err := w.Write(PktFlush()) - return err -} - -// WriteDelim writes a pkt delim packet. -func WriteDelim(w io.Writer) error { - _, err := fmt.Fprint(w, pktDelim) - return err -} - -// PktDone returns the bytes for a "done" packet. -func PktDone() []byte { - return []byte("0009done\n") -} - -// PktFlush returns the bytes for a "flush" packet. -func PktFlush() []byte { - return []byte("0000") -} - -func pktLineSplitter(data []byte, atEOF bool) (advance int, token []byte, err error) { - if len(data) < 4 { - if atEOF && len(data) > 0 { - return 0, nil, fmt.Errorf("pktLineSplitter: incomplete length prefix on %q", data) - } - return 0, nil, nil // want more data - } - - // We have at least 4 bytes available so we can decode the 4-hex digit - // length prefix of the packet line. Avoid allocating memory for parsing. - lenSliceStr := unsafe.String(unsafe.SliceData(data), 4) - - pktLength64, err := strconv.ParseUint(lenSliceStr, 16, 0) - if err != nil { - return 0, nil, fmt.Errorf("pktLineSplitter: decode length: %w", err) - } - - // Cast is safe because we requested an int-size number from strconv.ParseInt - pktLength := int(pktLength64) - - if pktLength < 0 { - return 0, nil, fmt.Errorf("pktLineSplitter: invalid length: %d", pktLength) - } - - if pktLength < 4 { - // Special case: magic empty packet 0000, 0001, 0002 or 0003. - return 4, data[:4], nil - } - - if len(data) < pktLength { - // data contains incomplete packet - - if atEOF { - return 0, nil, io.ErrUnexpectedEOF - } - - return 0, nil, nil // want more data - } - - return pktLength, data[:pktLength], nil -} diff --git a/internal/gitaly/vendored/stats/BUILD.bazel b/internal/gitaly/vendored/stats/BUILD.bazel deleted file mode 100644 index e4b6c545..00000000 --- a/internal/gitaly/vendored/stats/BUILD.bazel +++ /dev/null @@ -1,23 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") -load("//build:build.bzl", "go_custom_test") - -go_library( - name = "stats", - srcs = ["reference_discovery.go"], - importpath = "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/stats", - visibility = ["//:__subpackages__"], - deps = [ - "//internal/gitaly/vendored/pktline", - "//internal/tool/memz", - ], -) - -go_custom_test( - name = "stats_test", - srcs = ["reference_discovery_test.go"], - embed = [":stats"], - deps = [ - "//internal/gitaly/vendored/gittest", - "@com_github_stretchr_testify//require", - ], -) diff --git a/internal/gitaly/vendored/stats/reference_discovery.go b/internal/gitaly/vendored/stats/reference_discovery.go deleted file mode 100644 index c5592c50..00000000 --- a/internal/gitaly/vendored/stats/reference_discovery.go +++ /dev/null @@ -1,116 +0,0 @@ -package stats - -import ( - "bytes" - "errors" - "fmt" - "io" - - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/pktline" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/memz" -) - -// Reference as used by the reference discovery protocol. -type Reference struct { - // Oid is the object ID the reference points to - Oid []byte - // Name of the reference. The name will be suffixed with ^{} in case - // the reference is the peeled commit. - Name []byte -} - -// ReferenceCb is a callback that consumes parsed references. -// WARNING: It must not hold onto the byte slices as the backing array is reused! Make copies if needed. -// Returns true if reference parsing should stop. -type ReferenceCb func(Reference) bool - -type referenceDiscoveryState int - -const ( - referenceDiscoveryExpectService referenceDiscoveryState = iota - referenceDiscoveryExpectFlush - referenceDiscoveryExpectRefWithCaps - referenceDiscoveryExpectRef - referenceDiscoveryExpectEnd -) - -// ParseReferenceDiscovery parses a client's reference discovery stream and -// calls cb with references. It returns an error in case -// it couldn't make sense of the client's request. -// -// Expected protocol: -// - "# service=git-upload-pack\n" -// - FLUSH -// - " \x00\n" -// - " \n" -// - ... -// - FLUSH -func ParseReferenceDiscovery(body io.Reader, cb ReferenceCb) error { - state := referenceDiscoveryExpectService - buf := memz.Get64k() - defer memz.Put64k(buf) - scanner := pktline.NewScanner(body, buf) - - for scanner.Scan() { - pkt := scanner.Bytes() - data := bytes.TrimSuffix(pktline.Data(pkt), []byte{'\n'}) - - switch state { - case referenceDiscoveryExpectService: - if !bytes.Equal(data, []byte("# service=git-upload-pack")) { - return fmt.Errorf("unexpected header %q", data) - } - - state = referenceDiscoveryExpectFlush - case referenceDiscoveryExpectFlush: - if !pktline.IsFlush(pkt) { - return errors.New("missing flush after service announcement") - } - - state = referenceDiscoveryExpectRefWithCaps - case referenceDiscoveryExpectRefWithCaps: - if len(data) == 0 { // no refs in an empty repo - state = referenceDiscoveryExpectEnd - continue - } - split0, _, found := bytes.Cut(data, []byte{0}) - if !found { - return errors.New("invalid first reference line") - } - - ref0, ref1, found := bytes.Cut(split0, []byte{' '}) - if !found { - return errors.New("invalid reference line") - } - if cb(Reference{Oid: ref0, Name: ref1}) { - return nil - } - - state = referenceDiscoveryExpectRef - case referenceDiscoveryExpectRef: - if pktline.IsFlush(pkt) { - state = referenceDiscoveryExpectEnd - continue - } - - split0, split1, found := bytes.Cut(data, []byte{' '}) - if !found { - return errors.New("invalid reference line") - } - if cb(Reference{Oid: split0, Name: split1}) { - return nil - } - case referenceDiscoveryExpectEnd: - return errors.New("received packet after flush") - } - } - - if err := scanner.Err(); err != nil { - return err - } - if state != referenceDiscoveryExpectEnd { - return errors.New("discovery ended prematurely") - } - - return nil -} diff --git a/internal/gitaly/vendored/stats/reference_discovery_test.go b/internal/gitaly/vendored/stats/reference_discovery_test.go deleted file mode 100644 index 172015aa..00000000 --- a/internal/gitaly/vendored/stats/reference_discovery_test.go +++ /dev/null @@ -1,117 +0,0 @@ -package stats - -import ( - "bytes" - "testing" - - "github.com/stretchr/testify/require" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/gittest" -) - -const ( - oid1 = "78fb81a02b03f0013360292ec5106763af32c287" - oid2 = "0f6394307cd7d4909be96a0c818d8094a4cb0e5b" -) - -func BenchmarkMultipleRefsAndCapsParse(b *testing.B) { - buf := &bytes.Buffer{} - gittest.WritePktlineString(b, buf, "# service=git-upload-pack\n") - gittest.WritePktlineFlush(b, buf) - gittest.WritePktlineString(b, buf, oid1+" HEAD\x00first second") - gittest.WritePktlineString(b, buf, oid2+" refs/heads/master") - gittest.WritePktlineFlush(b, buf) - data := buf.Bytes() - r := bytes.NewReader(data) - b.ReportAllocs() - b.ResetTimer() // don't take the stuff above into account - for i := 0; i < b.N; i++ { - err := ParseReferenceDiscovery(r, func(ref Reference) bool { return false }) - if err != nil { - b.Fatal(err) - } - r.Reset(data) - } -} - -func TestSingleRefParses(t *testing.T) { - buf := &bytes.Buffer{} - gittest.WritePktlineString(t, buf, "# service=git-upload-pack\n") - gittest.WritePktlineFlush(t, buf) - gittest.WritePktlineString(t, buf, oid1+" HEAD\x00capability") - gittest.WritePktlineFlush(t, buf) - - var refs []Reference - err := ParseReferenceDiscovery(buf, accumulateRefs(&refs)) - require.NoError(t, err) - require.Equal(t, []Reference{{Oid: []byte(oid1), Name: []byte("HEAD")}}, refs) -} - -func TestMultipleRefsAndCapsParse(t *testing.T) { - buf := &bytes.Buffer{} - gittest.WritePktlineString(t, buf, "# service=git-upload-pack\n") - gittest.WritePktlineFlush(t, buf) - gittest.WritePktlineString(t, buf, oid1+" HEAD\x00first second") - gittest.WritePktlineString(t, buf, oid2+" refs/heads/master") - gittest.WritePktlineFlush(t, buf) - - var refs []Reference - err := ParseReferenceDiscovery(buf, accumulateRefs(&refs)) - require.NoError(t, err) - require.Equal(t, []Reference{{Oid: []byte(oid1), Name: []byte("HEAD")}, {Oid: []byte(oid2), Name: []byte("refs/heads/master")}}, refs) -} - -func TestInvalidHeaderFails(t *testing.T) { - buf := &bytes.Buffer{} - gittest.WritePktlineString(t, buf, "# service=invalid\n") - gittest.WritePktlineFlush(t, buf) - gittest.WritePktlineString(t, buf, oid1+" HEAD\x00caps") - gittest.WritePktlineFlush(t, buf) - - err := ParseReferenceDiscovery(buf, func(ref Reference) bool { return false }) - require.Error(t, err) -} - -func TestMissingRefsReturnsNoRefs(t *testing.T) { - buf := &bytes.Buffer{} - gittest.WritePktlineString(t, buf, "# service=git-upload-pack\n") - gittest.WritePktlineFlush(t, buf) - // no refs here. Empty repository without any refs. - gittest.WritePktlineFlush(t, buf) - - var refs []Reference - err := ParseReferenceDiscovery(buf, accumulateRefs(&refs)) - require.NoError(t, err) - require.Empty(t, refs) -} - -func TestInvalidRefFail(t *testing.T) { - buf := &bytes.Buffer{} - gittest.WritePktlineString(t, buf, "# service=git-upload-pack\n") - gittest.WritePktlineFlush(t, buf) - gittest.WritePktlineString(t, buf, oid1+" HEAD\x00caps") - gittest.WritePktlineString(t, buf, oid2) - gittest.WritePktlineFlush(t, buf) - - err := ParseReferenceDiscovery(buf, func(ref Reference) bool { return false }) - require.Error(t, err) -} - -func TestMissingTrailingFlushFails(t *testing.T) { - buf := &bytes.Buffer{} - gittest.WritePktlineString(t, buf, "# service=git-upload-pack\n") - gittest.WritePktlineFlush(t, buf) - gittest.WritePktlineString(t, buf, oid1+" HEAD\x00caps") - - err := ParseReferenceDiscovery(buf, func(ref Reference) bool { return false }) - require.Error(t, err) -} - -func accumulateRefs(refs *[]Reference) ReferenceCb { - return func(ref Reference) bool { - *refs = append(*refs, Reference{ - Oid: bytes.Clone(ref.Oid), - Name: bytes.Clone(ref.Name), - }) - return false - } -} diff --git a/internal/gitaly/vendored/structerr/BUILD.bazel b/internal/gitaly/vendored/structerr/BUILD.bazel deleted file mode 100644 index cc6787e4..00000000 --- a/internal/gitaly/vendored/structerr/BUILD.bazel +++ /dev/null @@ -1,14 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "structerr", - srcs = ["error.go"], - importpath = "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/structerr", - visibility = ["//:__subpackages__"], - deps = [ - "@org_golang_google_grpc//codes", - "@org_golang_google_grpc//status", - "@org_golang_google_protobuf//proto", - "@org_golang_google_protobuf//types/known/anypb", - ], -) diff --git a/internal/gitaly/vendored/structerr/error.go b/internal/gitaly/vendored/structerr/error.go deleted file mode 100644 index 9778b850..00000000 --- a/internal/gitaly/vendored/structerr/error.go +++ /dev/null @@ -1,380 +0,0 @@ -package structerr - -import ( - "errors" - "fmt" - "sort" - - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/known/anypb" -) - -// MetadataItem is an item that associated a metadata key with an arbitrary value. -type MetadataItem struct { - // Key is the key of the metadata item that will be used as the logging key. - Key string - // Value is the value of the metadata item that will be formatted as the logging value. - Value any -} - -// Error is a structured error that contains additional details. -type Error struct { - err error - code codes.Code - details []proto.Message - // metadata is the array of metadata items added to this error. Note that we explicitly - // don't use a map here so that we don't have any allocation overhead here in the general - // case where there is no metadata. - metadata []MetadataItem -} - -type grpcStatuser interface { - GRPCStatus() *status.Status -} - -func newError(code codes.Code, format string, a ...any) Error { - for i, arg := range a { - err, ok := arg.(error) - if !ok { - continue - } - - if errors.As(err, &(Error{})) { - // We need to explicitly handle this, otherwise `status.FromError()` would - // return these because we implement `GRPCStatus()`. - continue - } - - // If we see any wrapped gRPC error, then we retain its error code and details. - // Note that we cannot use `status.FromError()` here, as that would only return an - // error in case the immediate error is a gRPC status error. - var wrappedGRPCStatus grpcStatuser - if errors.As(err, &wrappedGRPCStatus) { - grpcStatus := wrappedGRPCStatus.GRPCStatus() - - // The error message from gRPC errors is awkward because they include - // RPC-specific constructs. This is awkward especially in the case where - // these are embedded in the middle of an error message. - // - // So if we see that the top-level error is a gRPC error, then we only use - // the status message as error message. But otherwise, we use the top-level - // error message. - message := err.Error() - if st, ok := status.FromError(err); ok { - message = st.Message() - } - - var details []proto.Message - for _, detail := range grpcStatus.Details() { - if detailProto, ok := detail.(proto.Message); ok { - details = append(details, detailProto) - } - } - - a[i] = Error{ - err: errors.New(message), - code: grpcStatus.Code(), - details: details, - } - } - } - - formattedErr := fmt.Errorf(format, a...) - - // When we wrap an Error, we retain its error code. The intent of this is to retain the most - // specific error code we have in the general case. As `Unknown` does not really count as a - // specific error code, we will ignore these errors. - // - // Note that this impacts our middleware status handler, where we wrap non-context-errors - // via `structerr.NewInternal()`. The result is that the caller should never see any - // `Unknown` errors. - var wrappedErr Error - if errors.As(formattedErr, &wrappedErr) { - if wrappedErr.code != codes.Unknown { - code = wrappedErr.code - } - } - - return Error{ - err: formattedErr, - code: code, - } -} - -// New returns a new Error with an Unknown error code. This constructor should be used in the -// general case where it is not clear what the specific error category is. As Unknown errors get -// treated specially, they will be overridden when wrapped with an error that has a more specific -// error code. -func New(format string, a ...any) Error { - return newError(codes.Unknown, format, a...) -} - -// NewAborted constructs a new error code with the Aborted error code. Please refer to New for -// further details. -func NewAborted(format string, a ...any) Error { - return newError(codes.Aborted, format, a...) -} - -// NewAlreadyExists constructs a new error code with the AlreadyExists error code. Please refer to -// New for further details. -func NewAlreadyExists(format string, a ...any) Error { - return newError(codes.AlreadyExists, format, a...) -} - -// NewCanceled constructs a new error code with the Canceled error code. Please refer to New for -// further details. -func NewCanceled(format string, a ...any) Error { - return newError(codes.Canceled, format, a...) -} - -// NewDataLoss constructs a new error code with the DataLoss error code. Please refer to New for -// further details. -func NewDataLoss(format string, a ...any) Error { - return newError(codes.DataLoss, format, a...) -} - -// NewDeadlineExceeded constructs a new error code with the DeadlineExceeded error code. Please -// refer to New for further details. -func NewDeadlineExceeded(format string, a ...any) Error { - return newError(codes.DeadlineExceeded, format, a...) -} - -// NewFailedPrecondition constructs a new error code with the FailedPrecondition error code. Please -// refer to New for further details. -func NewFailedPrecondition(format string, a ...any) Error { - return newError(codes.FailedPrecondition, format, a...) -} - -// NewInternal constructs a new error code with the Internal error code. Please refer to New for -// further details. -func NewInternal(format string, a ...any) Error { - return newError(codes.Internal, format, a...) -} - -// NewInvalidArgument constructs a new error code with the InvalidArgument error code. Please refer -// to New for further details. -func NewInvalidArgument(format string, a ...any) Error { - return newError(codes.InvalidArgument, format, a...) -} - -// NewNotFound constructs a new error code with the NotFound error code. Please refer to New for -// further details. -func NewNotFound(format string, a ...any) Error { - return newError(codes.NotFound, format, a...) -} - -// NewPermissionDenied constructs a new error code with the PermissionDenied error code. Please -// refer to New for further details. -func NewPermissionDenied(format string, a ...any) Error { - return newError(codes.PermissionDenied, format, a...) -} - -// NewResourceExhausted constructs a new error code with the ResourceExhausted error code. Please -// refer to New for further details. -func NewResourceExhausted(format string, a ...any) Error { - return newError(codes.ResourceExhausted, format, a...) -} - -// NewUnavailable constructs a new error code with the Unavailable error code. Please refer to New for further details. -// Please note that the Unavailable status code is a signal telling clients to retry automatically. This auto-retry -// mechanism is handled at the library layer, without client consensus. Typically, it is used for the situations where -// the gRPC is not available or is not responding. Here are some discrete examples: -// -// - Server downtime: The server hosting the gRPC service is down for maintenance or has crashed. -// - Network issues: Connectivity problems between the client and server, like network congestion or a broken connection, -// can cause the service to appear unavailable. -// - Load balancing failure: In a distributed system, the load balancer may be unable to route the client's request to a -// healthy instance of the gRPC service. This can happen if all instances are down or if the load balancer is -// misconfigured. -// - TLS/SSL handshake failure: If there's a problem during the TLS/SSL handshake between the client and the server, the -// connection may fail, leading to an UNAVAILABLE status code. -// -// Thus, this status code should be used by interceptors or network-related components. gRPC handlers should use another -// status code instead. -func NewUnavailable(format string, a ...any) Error { - return newError(codes.Unavailable, format, a...) -} - -// NewUnauthenticated constructs a new error code with the Unauthenticated error code. Please refer -// to New for further details. -func NewUnauthenticated(format string, a ...any) Error { - return newError(codes.Unauthenticated, format, a...) -} - -// NewUnimplemented constructs a new error code with the Unimplemented error code. Please refer to -// New for further details. -func NewUnimplemented(format string, a ...any) Error { - return newError(codes.Unimplemented, format, a...) -} - -// Error returns the error message of the Error. -func (e Error) Error() string { - return e.err.Error() -} - -// Unwrap returns the wrapped error if any, otherwise it returns nil. -func (e Error) Unwrap() error { - return errors.Unwrap(e.err) -} - -// Is checks whether the error is equivalent to the target error. Errors are only considered -// equivalent if the GRPC representation of this error is the same. -func (e Error) Is(targetErr error) bool { - target, ok := targetErr.(Error) // nolint: errorlint - if !ok { - return false - } - - return errors.Is(e.GRPCStatus().Err(), target.GRPCStatus().Err()) -} - -// Code returns the error code of the Error. -func (e Error) Code() codes.Code { - return e.code -} - -// GRPCStatus returns the gRPC status of this error. -func (e Error) GRPCStatus() *status.Status { - st := status.New(e.Code(), e.Error()) - - if details := e.Details(); len(details) > 0 { - proto := st.Proto() - - for _, detail := range details { - marshaled, err := anypb.New(detail) - if err != nil { - return status.New(codes.Internal, fmt.Sprintf("marshaling error details: %v", err)) - } - - proto.Details = append(proto.Details, marshaled) - } - - st = status.FromProto(proto) - } - - return st -} - -// errorChain returns the complete chain of `structerr.Error`s wrapped by this error, including the -// error itself. -func (e Error) errorChain() []Error { - var result []Error - for err := error(e); err != nil; err = errors.Unwrap(err) { - if structErr, ok := err.(Error); ok { // nolint: errorlint - result = append(result, structErr) - } - } - return result -} - -// Metadata returns the Error's metadata. Please refer to `ExtractMetadata()` for the exact semantics of this function. -func (e Error) Metadata() map[string]any { - return ExtractMetadata(e) -} - -// MetadataItems returns a copy of all metadata items added to this error. This function has the -// same semantics as `Metadata()`. The results are sorted by their metadata key. -func (e Error) MetadataItems() []MetadataItem { - metadata := e.Metadata() - - items := make([]MetadataItem, 0, len(metadata)) - for key, value := range metadata { - items = append(items, MetadataItem{Key: key, Value: value}) - } - - sort.Slice(items, func(i, j int) bool { - return items[i].Key < items[j].Key - }) - - return items -} - -// WithMetadata adds an additional metadata item to the Error. The metadata has the intent to -// provide more context around errors to the consumer of the Error. Calling this function multiple -// times with the same key will override any previous values. -func (e Error) WithMetadata(key string, value any) Error { - for i, metadataItem := range e.metadata { - // In case the key already exists we override it. - if metadataItem.Key == key { - e.metadata[i].Value = value - return e - } - } - - // Otherwise we append a new metadata item. - e.metadata = append(e.metadata, MetadataItem{ - Key: key, Value: value, - }) - return e -} - -// WithMetadataItems is a convenience function to append multiple metadata items to an error. It -// behaves the same as if `WithMetadata()` was called for each of the items separately. -func (e Error) WithMetadataItems(items ...MetadataItem) Error { - for _, item := range items { - e = e.WithMetadata(item.Key, item.Value) - } - return e -} - -// Details returns the chain error details set by this and any wrapped Error. The returned array -// contains error details ordered from top-level error details to bottom-level error details. -func (e Error) Details() []proto.Message { - var details []proto.Message - for _, err := range e.errorChain() { - details = append(details, err.details...) - } - return details -} - -// WithDetail sets the Error detail that provides additional structured information about the error -// via gRPC so that callers can programmatically determine the exact circumstances of an error. -func (e Error) WithDetail(detail proto.Message) Error { - e.details = append(e.details, detail) - return e -} - -// WithGRPCCode overrides the gRPC code embedded into the error. -func (e Error) WithGRPCCode(code codes.Code) Error { - e.code = code - return e -} - -// ErrorMetadater is an interface that can be implemented by error types in order to provide custom metadata items -// without itself being a `structerr.Error`. -type ErrorMetadater interface { - // ErrorMetadata returns the list of metadata items attached to this error. - ErrorMetadata() []MetadataItem -} - -// ExtractMetadata extracts metadata from the given error if any of the errors in its chain contain any. Errors may -// contain in case they are either a `structerr.Error` or in case they implement the `ErrorMetadater` interface. The -// metadata will contain the combination of all added metadata of this error as well as any wrapped Errors. -// -// When the same metada key exists multiple times in the error chain, then the value that is -// highest up the callchain will be returned. This is done because in general, the higher up the -// callchain one is the more context is available. -func ExtractMetadata(err error) map[string]any { - metadata := map[string]any{} - - for ; err != nil; err = errors.Unwrap(err) { - var metadataItems []MetadataItem - if structerr, ok := err.(Error); ok { // nolint: errorlint - metadataItems = structerr.metadata - } else if errorMetadater, ok := err.(ErrorMetadater); ok { // nolint: errorlint - metadataItems = errorMetadater.ErrorMetadata() - } else { - continue - } - - for _, m := range metadataItems { - if _, exists := metadata[m.Key]; !exists { - metadata[m.Key] = m.Value - } - } - } - - return metadata -} diff --git a/internal/gitlab/api/api_extra.go b/internal/gitlab/api/api_extra.go index 1341a52c..ceab5782 100644 --- a/internal/gitlab/api/api_extra.go +++ b/internal/gitlab/api/api_extra.go @@ -10,7 +10,6 @@ func (a *GetAgentInfoResponse) ToApiAgentInfo() *api.AgentInfo { ProjectId: a.ProjectId, Name: a.AgentName, GitalyInfo: a.GitalyInfo, - Repository: a.GitalyRepository.ToGitalyRepository(), DefaultBranch: a.DefaultBranch, } } @@ -19,7 +18,6 @@ func (p *GetProjectInfoResponse) ToApiProjectInfo() *api.ProjectInfo { return &api.ProjectInfo{ ProjectId: p.ProjectId, GitalyInfo: p.GitalyInfo, - Repository: p.GitalyRepository.ToGitalyRepository(), DefaultBranch: p.DefaultBranch, } } diff --git a/internal/module/agent_configuration/server/factory.go b/internal/module/agent_configuration/server/factory.go index 25b3c3a5..29a4f176 100644 --- a/internal/module/agent_configuration/server/factory.go +++ b/internal/module/agent_configuration/server/factory.go @@ -27,7 +27,6 @@ func (f *Factory) New(config *modserver.Config) (modserver.Module, error) { agentCfg := config.Config.Agent.Configuration rpc.RegisterAgentConfigurationServer(config.AgentServer, &fakeServer{ serverApi: config.Api, - gitaly: config.Gitaly, gitLabClient: config.GitLabClient, agentRegisterer: f.AgentRegisterer, maxConfigurationFileSize: int64(agentCfg.MaxConfigurationFileSize), diff --git a/internal/module/agent_configuration/server/fake.go b/internal/module/agent_configuration/server/fake.go index 4ecb6b96..51c6aa0a 100644 --- a/internal/module/agent_configuration/server/fake.go +++ b/internal/module/agent_configuration/server/fake.go @@ -4,7 +4,6 @@ import ( "context" "errors" "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/api" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly" "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitlab" "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/agent_configuration/rpc" "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/agent_tracker" @@ -24,7 +23,6 @@ import ( type fakeServer struct { rpc.UnimplementedAgentConfigurationServer serverApi modserver.Api - gitaly gitaly.PoolInterface gitLabClient gitlab.ClientInterface agentRegisterer agent_tracker.Registerer maxConfigurationFileSize int64 @@ -85,14 +83,6 @@ func (s *fakeServer) GetConfiguration(req *rpc.ConfigurationRequest, server rpc. }) } -func (s *fakeServer) poll(ctx context.Context, agentInfo *api.AgentInfo, lastProcessedCommitId string) (*gitaly.PollInfo, error) { - p, err := s.gitaly.Poller(ctx, agentInfo.GitalyInfo) - if err != nil { - return nil, err - } - return p.Poll(ctx, agentInfo.Repository, lastProcessedCommitId, "refs/heads/"+agentInfo.DefaultBranch) -} - func (s *fakeServer) sendConfigResponse(server rpc.AgentConfiguration_GetConfigurationServer, agentInfo *api.AgentInfo, configFile *agentcfg.ConfigurationFile, commitId string) error { return server.Send(&rpc.ConfigurationResponse{ @@ -101,7 +91,6 @@ func (s *fakeServer) sendConfigResponse(server rpc.AgentConfiguration_GetConfigu Observability: configFile.Observability, AgentId: agentInfo.Id, ProjectId: agentInfo.ProjectId, - ProjectPath: agentInfo.Repository.GlProjectPath, CiAccess: configFile.CiAccess, ContainerScanning: configFile.ContainerScanning, RemoteDevelopment: configFile.RemoteDevelopment, diff --git a/internal/module/agent_configuration/server/server.go b/internal/module/agent_configuration/server/server.go deleted file mode 100644 index c90292d8..00000000 --- a/internal/module/agent_configuration/server/server.go +++ /dev/null @@ -1,247 +0,0 @@ -package server - -import ( - "bytes" - "context" - "errors" - "fmt" - "path" - - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/api" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitlab" - gapi "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitlab/api" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/agent_configuration" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/agent_configuration/rpc" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/agent_tracker" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/modserver" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/errz" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/logz" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/mathz" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/retry" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/syncz" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/pkg/agentcfg" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/pkg/event" - "go.uber.org/zap" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/encoding/protojson" - "google.golang.org/protobuf/types/known/timestamppb" - "k8s.io/apimachinery/pkg/util/wait" - "sigs.k8s.io/yaml" -) - -type server struct { - rpc.UnimplementedAgentConfigurationServer - serverApi modserver.Api - gitaly gitaly.PoolInterface - gitLabClient gitlab.ClientInterface - agentRegisterer agent_tracker.Registerer - maxConfigurationFileSize int64 - getConfigurationPollConfig retry.PollConfigFactory - gitLabExternalUrl string -} - -func (s *server) GetConfiguration(req *rpc.ConfigurationRequest, server rpc.AgentConfiguration_GetConfigurationServer) error { - connectedAgentInfo := &agent_tracker.ConnectedAgentInfo{ - AgentMeta: req.AgentMeta, - ConnectedAt: timestamppb.Now(), - ConnectionId: mathz.Int63(), - } - ctx := server.Context() - rpcApi := modserver.AgentRpcApiFromContext(ctx) - log := rpcApi.Log() - defer s.maybeUnregisterAgent(log, rpcApi, connectedAgentInfo, req.SkipRegister) - - pollCfg := s.getConfigurationPollConfig() - - wh := syncz.NewComparableWorkerHolder[string]( - func(projectId string) syncz.Worker { - return syncz.WorkerFunc(func(ctx context.Context) { - s.serverApi.OnGitPushEvent(ctx, func(ctx context.Context, e *event.GitPushEvent) { - // NOTE: yes, the req.ProjectId is NOT a project id, but a full project path ... - if e.Project.FullPath == projectId { - pollCfg.Poke() - } - }) - }) - }, - ) - defer wh.StopAndWait() - - lastProcessedCommitId := req.CommitId - return rpcApi.PollWithBackoff(pollCfg, func() (error, retry.AttemptResult) { - // This call is made on each poll because: - // - it checks that the agent's token is still valid - // - repository location in Gitaly might have changed - agentInfo, err := rpcApi.AgentInfo(ctx, log) - if err != nil { - if status.Code(err) == codes.Unavailable { - return nil, retry.Backoff - } - return err, retry.Done - } - wh.ApplyConfig(ctx, agentInfo.Repository.GlProjectPath) - // re-define log to avoid accidentally using the old one - log := log.With(logz.AgentId(agentInfo.Id), logz.ProjectId(agentInfo.Repository.GlProjectPath)) // nolint:govet - s.maybeRegisterAgent(ctx, log, rpcApi, connectedAgentInfo, agentInfo, req.SkipRegister) - info, err := s.poll(ctx, agentInfo, lastProcessedCommitId) - if err != nil { - switch gitaly.ErrorCodeFromError(err) { // nolint:exhaustive - case gitaly.NotFound: // ref not found - return status.Errorf(codes.NotFound, "Config: repository poll failed: %v", err), retry.Done - default: - rpcApi.HandleProcessingError(log, agentInfo.Id, "Config: repository poll failed", err) - return nil, retry.Backoff - } - } - if info.EmptyRepository { - log.Debug("Config: empty repository") - return nil, retry.Continue - } - if !info.UpdateAvailable { - log.Debug("Config: no updates", logz.CommitId(lastProcessedCommitId)) - return nil, retry.Continue - } - log.Info("Config: new commit", logz.CommitId(info.CommitId)) - configFile, err := s.fetchConfiguration(ctx, agentInfo, info.CommitId) - if err != nil { - rpcApi.HandleProcessingError(log, agentInfo.Id, "Config: failed to fetch", err) - var ue errz.UserError - if errors.As(err, &ue) { - // return the error to the client because it's a user error - return status.Errorf(codes.FailedPrecondition, "Config: %v", err), retry.Done - } - return nil, retry.Backoff - } - var wg wait.Group - defer wg.Wait() - wg.Start(func() { - err := gapi.PostAgentConfiguration(ctx, s.gitLabClient, agentInfo.Id, configFile) // nolint:govet - switch { - case err == nil: - case gitlab.IsNotFound(err): - // Agent has been deleted from DB, but it's still running in the cluster. Don't need to send this error - // to Sentry. - log.Debug("Failed to notify GitLab of new agent configuration. Deleted agent?", logz.Error(err)) - default: - rpcApi.HandleProcessingError(log, agentInfo.Id, "Failed to notify GitLab of new agent configuration", err) - } - }) - err = s.sendConfigResponse(server, agentInfo, configFile, info.CommitId) - if err != nil { - return rpcApi.HandleIoError(log, "Config: failed to send config", err), retry.Done - } - lastProcessedCommitId = info.CommitId - return nil, retry.Continue - }) -} - -func (s *server) poll(ctx context.Context, agentInfo *api.AgentInfo, lastProcessedCommitId string) (*gitaly.PollInfo, error) { - p, err := s.gitaly.Poller(ctx, agentInfo.GitalyInfo) - if err != nil { - return nil, err - } - return p.Poll(ctx, agentInfo.Repository, lastProcessedCommitId, "refs/heads/"+agentInfo.DefaultBranch) -} - -func (s *server) sendConfigResponse(server rpc.AgentConfiguration_GetConfigurationServer, - agentInfo *api.AgentInfo, configFile *agentcfg.ConfigurationFile, commitId string) error { - return server.Send(&rpc.ConfigurationResponse{ - Configuration: &agentcfg.AgentConfiguration{ - Gitops: configFile.Gitops, - Observability: configFile.Observability, - AgentId: agentInfo.Id, - ProjectId: agentInfo.ProjectId, - ProjectPath: agentInfo.Repository.GlProjectPath, - CiAccess: configFile.CiAccess, - ContainerScanning: configFile.ContainerScanning, - RemoteDevelopment: configFile.RemoteDevelopment, - Flux: configFile.Flux, - GitlabExternalUrl: s.gitLabExternalUrl, - }, - CommitId: commitId, - }) -} - -// fetchConfiguration fetches agent's configuration from a corresponding repository. -// Assumes configuration is stored in ".gitlab/agents//config.yaml" file. -// fetchConfiguration returns a wrapped context.Canceled, context.DeadlineExceeded or gRPC error if ctx signals done and interrupts a running gRPC call. -func (s *server) fetchConfiguration(ctx context.Context, agentInfo *api.AgentInfo, commitId string) (*agentcfg.ConfigurationFile, error) { - pf, err := s.gitaly.PathFetcher(ctx, agentInfo.GitalyInfo) - if err != nil { - return nil, fmt.Errorf("PathFetcher: %w", err) // wrap - } - filename := path.Join(agent_configuration.Directory, agentInfo.Name, agent_configuration.FileName) - configYAML, err := pf.FetchFile(ctx, agentInfo.Repository, []byte(commitId), []byte(filename), s.maxConfigurationFileSize) - if err != nil { - switch gitaly.ErrorCodeFromError(err) { // nolint:exhaustive - case gitaly.NotFound: - configYAML = nil // Missing config is the same as empty config - case gitaly.FileTooBig, gitaly.UnexpectedTreeEntryType: - return nil, errz.NewUserErrorWithCause(err, "agent configuration file") - default: - return nil, fmt.Errorf("fetch agent configuration: %w", err) // wrap - } - } - configFile, err := parseYAMLToConfiguration(configYAML) - if err != nil { - return nil, errz.NewUserErrorWithCause(err, "failed to parse agent configuration") - } - err = configFile.ValidateAll() - if err != nil { - return nil, errz.NewUserErrorWithCause(err, "invalid agent configuration") - } - return configFile, nil -} - -func (s *server) maybeRegisterAgent(ctx context.Context, log *zap.Logger, rpcApi modserver.AgentRpcApi, - connectedAgentInfo *agent_tracker.ConnectedAgentInfo, agentInfo *api.AgentInfo, skipRegister bool) { - // Skip registering agent if skipRegister is true. The agent will call "Register" gRPC method instead. - if skipRegister { - return - } - - if connectedAgentInfo.AgentId != 0 { - return - } - connectedAgentInfo.AgentId = agentInfo.Id - connectedAgentInfo.ProjectId = agentInfo.ProjectId - err := s.agentRegisterer.RegisterConnection(ctx, connectedAgentInfo) - if err != nil { - rpcApi.HandleProcessingError(log, agentInfo.Id, "Failed to register agent", err) - } -} - -func (s *server) maybeUnregisterAgent(log *zap.Logger, rpcApi modserver.AgentRpcApi, - connectedAgentInfo *agent_tracker.ConnectedAgentInfo, skipRegister bool) { - // Skip unregistering agent if skipRegister is true. GC will clean up the agent from the storage. - if skipRegister { - return - } - - if connectedAgentInfo.AgentId == 0 { - return - } - err := s.agentRegisterer.UnregisterConnection(context.Background(), connectedAgentInfo) - if err != nil { - rpcApi.HandleProcessingError(log, connectedAgentInfo.AgentId, "Failed to unregister agent", err) - } -} - -func parseYAMLToConfiguration(configYAML []byte) (*agentcfg.ConfigurationFile, error) { - configJSON, err := yaml.YAMLToJSON(configYAML) - if err != nil { - return nil, fmt.Errorf("YAMLToJSON: %w", err) - } - configFile := &agentcfg.ConfigurationFile{} - if bytes.Equal(configJSON, []byte("null")) { - // Empty config - return configFile, nil - } - err = protojson.Unmarshal(configJSON, configFile) - if err != nil { - return nil, fmt.Errorf("protojson.Unmarshal: %w", err) - } - return configFile, nil -} diff --git a/internal/module/agent_configuration/server/server_test.go b/internal/module/agent_configuration/server/server_test.go deleted file mode 100644 index 691d6725..00000000 --- a/internal/module/agent_configuration/server/server_test.go +++ /dev/null @@ -1,409 +0,0 @@ -package server - -import ( - "context" - "fmt" - "net/http" - "strconv" - "testing" - "time" - - "github.com/google/go-cmp/cmp" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/api" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly" - gapi "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitlab/api" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/agent_configuration" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/agent_configuration/rpc" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/agent_tracker" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/modserver" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/syncz" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/matcher" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/mock_agent_tracker" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/mock_gitlab" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/mock_internalgitaly" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/mock_modserver" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/mock_rpc" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/testhelpers" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/pkg/agentcfg" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/pkg/event" - "go.uber.org/mock/gomock" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/encoding/protojson" - "google.golang.org/protobuf/testing/protocmp" - "sigs.k8s.io/yaml" -) - -const ( - revision = "507ebc6de9bcac25628aa7afd52802a91a0685d8" - branchPrefix = "refs/heads/" - - maxConfigurationFileSize = 128 * 1024 -) - -var ( - projectId = "some/project" - - _ modserver.Module = (*module)(nil) - _ modserver.Factory = (*Factory)(nil) - _ modserver.ApplyDefaults = ApplyDefaults - _ rpc.AgentConfigurationServer = (*server)(nil) -) - -func TestEmptyConfig(t *testing.T) { - t.Run("comments", func(t *testing.T) { - data := []byte(` -#gitops: -# manifest_projects: -# - id: "root/gitops-manifests" -# paths: -# - glob: "/bla/**" -`) - assertEmpty(t, data) - }) - t.Run("empty", func(t *testing.T) { - data := []byte("") - assertEmpty(t, data) - }) - t.Run("newline", func(t *testing.T) { - data := []byte("\n") - assertEmpty(t, data) - }) - t.Run("missing", func(t *testing.T) { - var data []byte - assertEmpty(t, data) - }) -} - -func assertEmpty(t *testing.T, data []byte) { - config, err := parseYAMLToConfiguration(data) - require.NoError(t, err) - diff := cmp.Diff(config, &agentcfg.ConfigurationFile{}, protocmp.Transform()) - assert.Empty(t, diff) -} - -func TestYAMLToConfigurationAndBack(t *testing.T) { - testCases := []struct { - given, expected string - }{ - { - given: `{} -`, // empty config - expected: `{} -`, - }, - { - given: `gitops: {} -`, - expected: `gitops: {} -`, - }, - { - given: `gitops: - manifest_projects: [] -`, - expected: `gitops: {} -`, // empty slice is omitted - }, - { - expected: `gitops: - manifest_projects: - - id: gitlab-org/cluster-integration/gitlab-agent -`, - given: `gitops: - manifest_projects: - - id: gitlab-org/cluster-integration/gitlab-agent -`, - }, - } - - for i, tc := range testCases { - t.Run(strconv.Itoa(i), func(t *testing.T) { - config, err := parseYAMLToConfiguration([]byte(tc.given)) - require.NoError(t, err) - configJson, err := protojson.Marshal(config) - require.NoError(t, err) - configYaml, err := yaml.JSONToYAML(configJson) - require.NoError(t, err) - diff := cmp.Diff(tc.expected, string(configYaml)) - assert.Empty(t, diff) - }) - } -} - -func TestGetConfiguration_HappyPath(t *testing.T) { - s, agentInfo, ctrl, gitalyPool, resp, _ := setupServer(t) - configFile := sampleConfig() - resp.EXPECT(). - Send(matcher.ProtoEq(t, &rpc.ConfigurationResponse{ - Configuration: &agentcfg.AgentConfiguration{ - Gitops: &agentcfg.GitopsCF{ - ManifestProjects: []*agentcfg.ManifestProjectCF{ - { - Id: &projectId, - }, - }, - }, - AgentId: agentInfo.Id, - ProjectId: agentInfo.ProjectId, - ProjectPath: agentInfo.Repository.GlProjectPath, - }, - CommitId: revision, - })) - p := mock_internalgitaly.NewMockPollerInterface(ctrl) - pf := mock_internalgitaly.NewMockPathFetcherInterface(ctrl) - configFileName := agent_configuration.Directory + "/" + agentInfo.Name + "/" + agent_configuration.FileName - gomock.InOrder( - gitalyPool.EXPECT(). - Poller(gomock.Any(), matcher.ProtoEq(nil, agentInfo.GitalyInfo)). - Return(p, nil), - p.EXPECT(). - Poll(gomock.Any(), matcher.ProtoEq(nil, agentInfo.Repository), "", branchPrefix+agentInfo.DefaultBranch). - Return(&gitaly.PollInfo{ - CommitId: revision, - UpdateAvailable: true, - }, nil), - gitalyPool.EXPECT(). - PathFetcher(gomock.Any(), matcher.ProtoEq(nil, agentInfo.GitalyInfo)). - Return(pf, nil), - pf.EXPECT(). - FetchFile(gomock.Any(), matcher.ProtoEq(nil, agentInfo.Repository), []byte(revision), []byte(configFileName), int64(maxConfigurationFileSize)). - Return(configToBytes(t, configFile), nil), - ) - err := s.GetConfiguration(&rpc.ConfigurationRequest{ - AgentMeta: mock_modserver.AgentMeta(), - }, resp) - require.NoError(t, err) -} - -func TestGetConfiguration_ResumeConnection(t *testing.T) { - s, agentInfo, ctrl, gitalyPool, resp, _ := setupServer(t) - p := mock_internalgitaly.NewMockPollerInterface(ctrl) - gomock.InOrder( - gitalyPool.EXPECT(). - Poller(gomock.Any(), matcher.ProtoEq(nil, agentInfo.GitalyInfo)). - Return(p, nil), - p.EXPECT(). - Poll(gomock.Any(), matcher.ProtoEq(nil, agentInfo.Repository), revision, branchPrefix+agentInfo.DefaultBranch). - Return(&gitaly.PollInfo{ - CommitId: revision, - UpdateAvailable: false, - }, nil), - ) - err := s.GetConfiguration(&rpc.ConfigurationRequest{ - CommitId: revision, // same commit id - AgentMeta: mock_modserver.AgentMeta(), - }, resp) - require.NoError(t, err) -} - -func TestGetConfiguration_RefNotFound(t *testing.T) { - s, agentInfo, ctrl, gitalyPool, resp, _ := setupServer(t) - p := mock_internalgitaly.NewMockPollerInterface(ctrl) - gomock.InOrder( - gitalyPool.EXPECT(). - Poller(gomock.Any(), matcher.ProtoEq(nil, agentInfo.GitalyInfo)). - Return(p, nil), - p.EXPECT(). - Poll(gomock.Any(), matcher.ProtoEq(nil, agentInfo.Repository), "", branchPrefix+agentInfo.DefaultBranch). - Return(nil, gitaly.NewNotFoundError("Bla", "some/ref")), - ) - err := s.GetConfiguration(&rpc.ConfigurationRequest{ - AgentMeta: mock_modserver.AgentMeta(), - }, resp) - require.EqualError(t, err, "rpc error: code = NotFound desc = Config: repository poll failed: NotFound: Bla: file/directory/ref not found: some/ref") -} - -func TestGetConfiguration_ConfigNotFound(t *testing.T) { - s, agentInfo, ctrl, gitalyPool, resp, _ := setupServer(t) - resp.EXPECT(). - Send(matcher.ProtoEq(t, &rpc.ConfigurationResponse{ - Configuration: &agentcfg.AgentConfiguration{ - AgentId: agentInfo.Id, - ProjectId: agentInfo.ProjectId, - ProjectPath: agentInfo.Repository.GlProjectPath, - }, - CommitId: revision, - })) - p := mock_internalgitaly.NewMockPollerInterface(ctrl) - pf := mock_internalgitaly.NewMockPathFetcherInterface(ctrl) - configFileName := agent_configuration.Directory + "/" + agentInfo.Name + "/" + agent_configuration.FileName - gomock.InOrder( - gitalyPool.EXPECT(). - Poller(gomock.Any(), matcher.ProtoEq(nil, agentInfo.GitalyInfo)). - Return(p, nil), - p.EXPECT(). - Poll(gomock.Any(), matcher.ProtoEq(nil, agentInfo.Repository), "", branchPrefix+agentInfo.DefaultBranch). - Return(&gitaly.PollInfo{ - CommitId: revision, - UpdateAvailable: true, - }, nil), - gitalyPool.EXPECT(). - PathFetcher(gomock.Any(), matcher.ProtoEq(nil, agentInfo.GitalyInfo)). - Return(pf, nil), - pf.EXPECT(). - FetchFile(gomock.Any(), matcher.ProtoEq(nil, agentInfo.Repository), []byte(revision), []byte(configFileName), int64(maxConfigurationFileSize)). - Return(nil, gitaly.NewNotFoundError("Bla", "some/file")), - ) - err := s.GetConfiguration(&rpc.ConfigurationRequest{ - AgentMeta: mock_modserver.AgentMeta(), - }, resp) - require.NoError(t, err) -} - -func TestGetConfiguration_EmptyRepository(t *testing.T) { - s, agentInfo, ctrl, gitalyPool, resp, _ := setupServer(t) - p := mock_internalgitaly.NewMockPollerInterface(ctrl) - gomock.InOrder( - gitalyPool.EXPECT(). - Poller(gomock.Any(), matcher.ProtoEq(nil, agentInfo.GitalyInfo)). - Return(p, nil), - p.EXPECT(). - Poll(gomock.Any(), matcher.ProtoEq(nil, agentInfo.Repository), "", branchPrefix+agentInfo.DefaultBranch). - Return(&gitaly.PollInfo{ - EmptyRepository: true, - }, nil), - ) - err := s.GetConfiguration(&rpc.ConfigurationRequest{ - AgentMeta: mock_modserver.AgentMeta(), - }, resp) - require.NoError(t, err) -} - -func TestGetConfiguration_UserErrors(t *testing.T) { - gitalyErrs := []error{ - gitaly.NewFileTooBigError(nil, "Bla", "some/file"), - gitaly.NewUnexpectedTreeEntryTypeError("Bla", "some/file"), - } - for _, gitalyErr := range gitalyErrs { - t.Run(gitalyErr.(*gitaly.Error).Code.String(), func(t *testing.T) { // nolint: errorlint - s, agentInfo, ctrl, gitalyPool, resp, mockRpcApi := setupServer(t) - p := mock_internalgitaly.NewMockPollerInterface(ctrl) - pf := mock_internalgitaly.NewMockPathFetcherInterface(ctrl) - configFileName := agent_configuration.Directory + "/" + agentInfo.Name + "/" + agent_configuration.FileName - gomock.InOrder( - gitalyPool.EXPECT(). - Poller(gomock.Any(), matcher.ProtoEq(nil, agentInfo.GitalyInfo)). - Return(p, nil), - p.EXPECT(). - Poll(gomock.Any(), matcher.ProtoEq(nil, agentInfo.Repository), "", branchPrefix+agentInfo.DefaultBranch). - Return(&gitaly.PollInfo{ - CommitId: revision, - UpdateAvailable: true, - }, nil), - gitalyPool.EXPECT(). - PathFetcher(gomock.Any(), matcher.ProtoEq(nil, agentInfo.GitalyInfo)). - Return(pf, nil), - pf.EXPECT(). - FetchFile(gomock.Any(), matcher.ProtoEq(nil, agentInfo.Repository), []byte(revision), []byte(configFileName), int64(maxConfigurationFileSize)). - Return(nil, gitalyErr), - mockRpcApi.EXPECT(). - HandleProcessingError(gomock.Any(), testhelpers.AgentId, "Config: failed to fetch", - matcher.ErrorEq(fmt.Sprintf("agent configuration file: %v", gitalyErr))), - ) - err := s.GetConfiguration(&rpc.ConfigurationRequest{ - AgentMeta: mock_modserver.AgentMeta(), - }, resp) - assert.EqualError(t, err, fmt.Sprintf("rpc error: code = FailedPrecondition desc = Config: agent configuration file: %v", gitalyErr)) - }) - } -} - -func TestGetConfiguration_GetAgentInfo_Error(t *testing.T) { - s, _, _, resp, mockRpcApi, _, _ := setupServerBare(t, 1) - mockRpcApi.EXPECT(). - AgentInfo(gomock.Any(), gomock.Any()). - Return(nil, status.Error(codes.PermissionDenied, "expected err")) // code doesn't matter, we test that we return on error - err := s.GetConfiguration(&rpc.ConfigurationRequest{ - AgentMeta: mock_modserver.AgentMeta(), - }, resp) - assert.EqualError(t, err, "rpc error: code = PermissionDenied desc = expected err") -} - -func TestGetConfiguration_GetAgentInfo_RetriableError(t *testing.T) { - s, _, _, resp, mockRpcApi, _, _ := setupServerBare(t, 2) - gomock.InOrder( - mockRpcApi.EXPECT(). - AgentInfo(gomock.Any(), gomock.Any()). - Return(nil, status.Error(codes.Unavailable, "unavailable")), - mockRpcApi.EXPECT(). - AgentInfo(gomock.Any(), gomock.Any()). - Return(nil, status.Error(codes.PermissionDenied, "expected err")), // code doesn't matter, we test that we return on error - ) - err := s.GetConfiguration(&rpc.ConfigurationRequest{ - AgentMeta: mock_modserver.AgentMeta(), - }, resp) - assert.EqualError(t, err, "rpc error: code = PermissionDenied desc = expected err") -} - -func setupServerBare(t *testing.T, pollTimes int) (*server, *gomock.Controller, *mock_internalgitaly.MockPoolInterface, *mock_rpc.MockAgentConfiguration_GetConfigurationServer, *mock_modserver.MockAgentRpcApi, *mock_modserver.MockApi, *mock_agent_tracker.MockTracker) { - ctrl := gomock.NewController(t) - mockRpcApi := mock_modserver.NewMockAgentRpcApiWithMockPoller(ctrl, pollTimes) - mockApi := mock_modserver.NewMockApi(ctrl) - gitalyPool := mock_internalgitaly.NewMockPoolInterface(ctrl) - agentTracker := mock_agent_tracker.NewMockTracker(ctrl) - gitLabClient := mock_gitlab.SetupClient(t, gapi.AgentConfigurationApiPath, func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusNoContent) - }) - s := &server{ - serverApi: mockApi, - agentRegisterer: agentTracker, - gitaly: gitalyPool, - gitLabClient: gitLabClient, - getConfigurationPollConfig: testhelpers.NewPollConfig(10 * time.Minute), - maxConfigurationFileSize: maxConfigurationFileSize, - } - resp := mock_rpc.NewMockAgentConfiguration_GetConfigurationServer(ctrl) - resp.EXPECT(). - Context(). - Return(mock_modserver.IncomingAgentCtx(t, mockRpcApi)). - MinTimes(1) - return s, ctrl, gitalyPool, resp, mockRpcApi, mockApi, agentTracker -} - -func setupServer(t *testing.T) (*server, *api.AgentInfo, *gomock.Controller, *mock_internalgitaly.MockPoolInterface, *mock_rpc.MockAgentConfiguration_GetConfigurationServer, *mock_modserver.MockAgentRpcApi) { - s, ctrl, gitalyPool, resp, mockRpcApi, mockApi, agentTracker := setupServerBare(t, 1) - agentInfo := testhelpers.AgentInfoObj() - connMatcher := matcher.ProtoEq(t, &agent_tracker.ConnectedAgentInfo{ - AgentMeta: mock_modserver.AgentMeta(), - AgentId: agentInfo.Id, - ProjectId: agentInfo.ProjectId, - }, protocmp.IgnoreFields(&agent_tracker.ConnectedAgentInfo{}, "connected_at", "connection_id")) - gomock.InOrder( - mockRpcApi.EXPECT(). - AgentInfo(gomock.Any(), gomock.Any()). - Return(agentInfo, nil), - agentTracker.EXPECT(). - RegisterConnection(gomock.Any(), connMatcher), - ) - mockApi.EXPECT(). - OnGitPushEvent(gomock.Any(), gomock.Any()). - Do(func(ctx context.Context, cb syncz.EventCallback[*event.GitPushEvent]) { - <-ctx.Done() - }) - agentTracker.EXPECT(). - UnregisterConnection(gomock.Any(), connMatcher) - return s, agentInfo, ctrl, gitalyPool, resp, mockRpcApi -} - -func configToBytes(t *testing.T, configFile *agentcfg.ConfigurationFile) []byte { - configJson, err := protojson.Marshal(configFile) - require.NoError(t, err) - configYaml, err := yaml.JSONToYAML(configJson) - require.NoError(t, err) - return configYaml -} - -func sampleConfig() *agentcfg.ConfigurationFile { - return &agentcfg.ConfigurationFile{ - Gitops: &agentcfg.GitopsCF{ - ManifestProjects: []*agentcfg.ManifestProjectCF{ - { - Id: &projectId, - }, - }, - }, - } -} diff --git a/internal/module/configuration_project/server/factory.go b/internal/module/configuration_project/server/factory.go deleted file mode 100644 index 10151b2b..00000000 --- a/internal/module/configuration_project/server/factory.go +++ /dev/null @@ -1,26 +0,0 @@ -package server - -import ( - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/configuration_project" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/configuration_project/rpc" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/modserver" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/modshared" -) - -type Factory struct { -} - -func (f *Factory) New(config *modserver.Config) (modserver.Module, error) { - rpc.RegisterConfigurationProjectServer(config.ApiServer, &server{ - gitaly: config.Gitaly, - }) - return &module{}, nil -} - -func (f *Factory) Name() string { - return configuration_project.ModuleName -} - -func (f *Factory) StartStopPhase() modshared.ModuleStartStopPhase { - return modshared.ModuleStartBeforeServers -} diff --git a/internal/module/configuration_project/server/server.go b/internal/module/configuration_project/server/server.go deleted file mode 100644 index 6c5bdd26..00000000 --- a/internal/module/configuration_project/server/server.go +++ /dev/null @@ -1,90 +0,0 @@ -package server - -import ( - "context" - "fmt" - "regexp" - - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/gitalypb" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/agent_configuration" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/configuration_project/rpc" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/modserver" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/modshared" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/git" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/logz" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -const ( - // https://gitlab.com/gitlab-org/cluster-integration/gitlab-agent/-/blob/master/doc/identity_and_auth.md#agent-identity-and-name - agentNameRegex = `[a-z0-9](?:[-a-z0-9]*[a-z0-9])?` -) - -var ( - agentConfigFileRegex = regexp.MustCompile(fmt.Sprintf("^%s/(%s)/%s$", - regexp.QuoteMeta(agent_configuration.Directory), - agentNameRegex, - regexp.QuoteMeta(agent_configuration.FileName), - )) -) - -type server struct { - rpc.UnimplementedConfigurationProjectServer - gitaly gitaly.PoolInterface -} - -func (s *server) ListAgentConfigFiles(ctx context.Context, req *rpc.ListAgentConfigFilesRequest) (*rpc.ListAgentConfigFilesResponse, error) { - rpcApi := modserver.RpcApiFromContext(ctx) - pf, err := s.gitaly.PathFetcher(ctx, req.GitalyInfo) - if err != nil { - rpcApi.HandleProcessingError(rpcApi.Log(), modshared.NoAgentId, "PathFetcher", err) - return nil, status.Errorf(codes.Unavailable, "PathFetcher: %v", err) - } - v := &configVisitor{} - ref := git.ExplicitRefOrHead(req.DefaultBranch) - err = pf.Visit(ctx, req.Repository.ToGitalyRepository(), []byte(ref), []byte(agent_configuration.Directory), true, v) - if err != nil { - forwardErr := func() { - log := rpcApi.Log().With(logz.ProjectId(req.Repository.GlProjectPath)) - rpcApi.HandleProcessingError(log, modshared.NoAgentId, "PathFetcher", err) - } - switch gitaly.ErrorCodeFromError(err) { // nolint:exhaustive - case gitaly.InvalidArgument: - // We send this to Sentry anyway, because it shouldn't normally happen in this method. - forwardErr() - return nil, status.Errorf(codes.InvalidArgument, "PathFetcher: %v", err) - case gitaly.NotFound: - return &rpc.ListAgentConfigFilesResponse{}, nil - default: - forwardErr() - return nil, status.Errorf(codes.Unavailable, "PathFetcher: %v", err) - } - } - return &rpc.ListAgentConfigFilesResponse{ - ConfigFiles: v.resp, - }, nil -} - -type configVisitor struct { - resp []*rpc.AgentConfigFile -} - -func (c *configVisitor) Entry(entry *gitalypb.TreeEntry) (bool /* download? */, int64 /* max size */, error) { - submatch := agentConfigFileRegex.FindSubmatch(entry.Path) - if submatch == nil { - return false, 0, nil - } - c.resp = append(c.resp, &rpc.AgentConfigFile{ - Name: string(entry.Path), - AgentName: string(submatch[1]), - }) - return false, 0, nil -} - -func (c *configVisitor) StreamChunk(path []byte, data []byte) (bool, error) { - return false, nil -} - -func (c *configVisitor) EntryDone(entry *gitalypb.TreeEntry, err error) {} diff --git a/internal/module/configuration_project/server/server_test.go b/internal/module/configuration_project/server/server_test.go deleted file mode 100644 index 24931b7e..00000000 --- a/internal/module/configuration_project/server/server_test.go +++ /dev/null @@ -1,157 +0,0 @@ -package server - -import ( - "context" - "net/url" - "os" - "testing" - - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/api" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/gitalypb" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitlab" - gapi "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitlab/api" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/configuration_project/rpc" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/modserver" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/grpctool" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/ioz" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/pkg/entity" - "google.golang.org/grpc" - "google.golang.org/grpc/credentials/insecure" - "google.golang.org/protobuf/encoding/protojson" - "google.golang.org/protobuf/testing/protocmp" -) - -var ( - _ modserver.Module = &module{} - _ modserver.Factory = &Factory{} - _ rpc.ConfigurationProjectServer = &server{} - _ gitaly.FetchVisitor = (*configVisitor)(nil) -) - -func TestConfigVisitor(t *testing.T) { - tests := []struct { - path string - file *rpc.AgentConfigFile - }{ - { - path: "asdfdas", - }, - { - path: ".gitlab/agents/my-agent/config.yaml", - file: &rpc.AgentConfigFile{ - Name: ".gitlab/agents/my-agent/config.yaml", - AgentName: "my-agent", - }, - }, - { - path: ".gitlab/agents/my-agent", - }, - { - path: ".gitlab/agents/my-agent/", - }, - { - path: ".gitlab/agents/-my-agent-with-invalid-name/config.yaml", - }, - } - for _, tc := range tests { - t.Run(tc.path, func(t *testing.T) { - v := configVisitor{} - download, _, err := v.Entry(&gitalypb.TreeEntry{ - Path: []byte(tc.path), - }) - require.NoError(t, err) - assert.False(t, download) - var expected []*rpc.AgentConfigFile - if tc.file != nil { - expected = []*rpc.AgentConfigFile{tc.file} - } - assert.Empty(t, cmp.Diff(v.resp, expected, protocmp.Transform(), cmpopts.EquateEmpty())) - }) - } -} - -func TestAsClient(t *testing.T) { - kasAddress := os.Getenv("KAS_ADDRESS") - gitLabAddress := os.Getenv("GITLAB_ADDRESS") - kasSecretFile := os.Getenv("KAS_SECRET_FILE") - agentTokenFile := os.Getenv("AGENT_TOKEN_FILE") - if kasAddress == "" || kasSecretFile == "" || gitLabAddress == "" || agentTokenFile == "" { - t.SkipNow() - } - conn := constructKasConnection(t, kasAddress, kasSecretFile) - defer conn.Close() - gitLabC := constructGitLabClient(t, gitLabAddress, kasSecretFile) - agentToken, err := os.ReadFile(agentTokenFile) - require.NoError(t, err) - - agentInfo, err := gapi.GetAgentInfo(context.TODO(), gitLabC, api.AgentToken(agentToken)) - require.NoError(t, err) - - kasC := rpc.NewConfigurationProjectClient(conn) - configFiles, err := kasC.ListAgentConfigFiles(context.Background(), &rpc.ListAgentConfigFilesRequest{ - Repository: &entity.GitalyRepository{ - StorageName: agentInfo.Repository.StorageName, - RelativePath: agentInfo.Repository.RelativePath, - GitObjectDirectory: agentInfo.Repository.GitObjectDirectory, - GitAlternateObjectDirectories: agentInfo.Repository.GitAlternateObjectDirectories, - GlRepository: agentInfo.Repository.GlRepository, - GlProjectPath: agentInfo.Repository.GlProjectPath, - }, - GitalyInfo: agentInfo.GitalyInfo, - }) - require.NoError(t, err) - data, err := protojson.MarshalOptions{ - Multiline: true, - }.Marshal(configFiles) - require.NoError(t, err) - t.Logf("configFiles:\n%s", data) -} - -func constructKasConnection(t *testing.T, kasAddress, kasSecretFile string) *grpc.ClientConn { - jwtSecret, err := ioz.LoadBase64Secret(kasSecretFile) - require.NoError(t, err) - u, err := url.Parse(kasAddress) - require.NoError(t, err) - opts := []grpc.DialOption{ - grpc.WithChainStreamInterceptor( - grpctool.StreamClientValidatingInterceptor, - ), - grpc.WithChainUnaryInterceptor( - grpctool.UnaryClientValidatingInterceptor, - ), - grpc.WithTransportCredentials(insecure.NewCredentials()), - grpc.WithPerRPCCredentials(&grpctool.JwtCredentials{ - Secret: jwtSecret, - Audience: "gitlab-kas", - Issuer: "gitlab-kas", - Insecure: true, - }), - } - var addressToDial string - switch u.Scheme { - case "grpc": - addressToDial = "dns:" + u.Host - default: - t.Fatalf("unsupported scheme in GitLab Kubernetes Agent Server address: %q", u.Scheme) - } - conn, err := grpc.DialContext(context.Background(), addressToDial, opts...) - require.NoError(t, err) - return conn -} - -func constructGitLabClient(t *testing.T, gitLabAddress, gitLabSecretFile string) *gitlab.Client { - gitLabUrl, err := url.Parse(gitLabAddress) - require.NoError(t, err) - secret, err := ioz.LoadBase64Secret(gitLabSecretFile) - require.NoError(t, err) - // Secret for JWT signing - return gitlab.NewClient( - gitLabUrl, - secret, - ) -} diff --git a/internal/module/gitops/BUILD.bazel b/internal/module/gitops/BUILD.bazel deleted file mode 100644 index 57b39965..00000000 --- a/internal/module/gitops/BUILD.bazel +++ /dev/null @@ -1,8 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "gitops", - srcs = ["api.go"], - importpath = "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/gitops", - visibility = ["//:__subpackages__"], -) diff --git a/internal/module/gitops/agent/manifestops/BUILD.bazel b/internal/module/gitops/agent/manifestops/BUILD.bazel deleted file mode 100644 index da6d9288..00000000 --- a/internal/module/gitops/agent/manifestops/BUILD.bazel +++ /dev/null @@ -1,91 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") -load("//build:build.bzl", "go_custom_test") - -go_library( - name = "manifestops", - srcs = [ - "doc.go", - "factory.go", - "module.go", - "retry_pipeline.go", - "sync_decoder.go", - "worker.go", - "worker_1_watch.go", - "worker_2_decode.go", - "worker_3_apply.go", - "worker_factory.go", - ], - importpath = "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/gitops/agent/manifestops", - visibility = ["//:__subpackages__"], - deps = [ - "//internal/module/gitops", - "//internal/module/gitops/rpc", - "//internal/module/modagent", - "//internal/module/modshared", - "//internal/tool/errz", - "//internal/tool/logz", - "//internal/tool/prototool", - "//internal/tool/retry", - "//pkg/agentcfg", - "@io_k8s_apimachinery//pkg/api/meta", - "@io_k8s_apimachinery//pkg/apis/meta/v1:meta", - "@io_k8s_apimachinery//pkg/apis/meta/v1/unstructured", - "@io_k8s_apimachinery//pkg/util/wait", - "@io_k8s_cli_runtime//pkg/genericclioptions", - "@io_k8s_cli_runtime//pkg/resource", - "@io_k8s_sigs_cli_utils//pkg/apply", - "@io_k8s_sigs_cli_utils//pkg/apply/event", - "@io_k8s_sigs_cli_utils//pkg/common", - "@io_k8s_sigs_cli_utils//pkg/inventory", - "@io_k8s_sigs_cli_utils//pkg/kstatus/watcher", - "@io_k8s_sigs_cli_utils//pkg/manifestreader", - "@io_k8s_sigs_cli_utils//pkg/object", - "@io_k8s_sigs_cli_utils//pkg/object/validation", - "@io_k8s_sigs_cli_utils//pkg/printers", - "@io_k8s_utils//clock", - "@org_uber_go_zap//:zap", - ], -) - -go_custom_test( - name = "manifestops_test", - srcs = [ - "mock_for_test.go", - "module_test.go", - "retry_pipeline_test.go", - "sync_decoder_test.go", - "worker_test.go", - ], - embed = [":manifestops"], - deps = [ - "//internal/module/gitops/rpc", - "//internal/module/modagent", - "//internal/tool/retry", - "//internal/tool/testing/kube_testing", - "//internal/tool/testing/matcher", - "//internal/tool/testing/mock_k8s", - "//internal/tool/testing/mock_rpc", - "//internal/tool/testing/testhelpers", - "//pkg/agentcfg", - "@com_github_google_go_cmp//cmp", - "@com_github_google_go_cmp//cmp/cmpopts", - "@com_github_stretchr_testify//assert", - "@com_github_stretchr_testify//require", - "@io_k8s_api//core/v1:core", - "@io_k8s_apimachinery//pkg/api/meta", - "@io_k8s_apimachinery//pkg/apis/meta/v1:meta", - "@io_k8s_apimachinery//pkg/apis/meta/v1/unstructured", - "@io_k8s_apimachinery//pkg/runtime/schema", - "@io_k8s_apimachinery//pkg/util/wait", - "@io_k8s_kubectl//pkg/cmd/testing", - "@io_k8s_sigs_cli_utils//pkg/apply", - "@io_k8s_sigs_cli_utils//pkg/apply/event", - "@io_k8s_sigs_cli_utils//pkg/common", - "@io_k8s_sigs_cli_utils//pkg/inventory", - "@io_k8s_sigs_cli_utils//pkg/object", - "@io_k8s_sigs_yaml//:yaml", - "@io_k8s_utils//clock", - "@org_uber_go_mock//gomock", - "@org_uber_go_zap//zaptest", - ], -) diff --git a/internal/module/gitops/agent/manifestops/doc.go b/internal/module/gitops/agent/manifestops/doc.go deleted file mode 100644 index 1d3d6485..00000000 --- a/internal/module/gitops/agent/manifestops/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -package manifestops - -//go:generate mockgen.sh -self_package "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/gitops/agent/manifestops" -destination "mock_for_test.go" -package "manifestops" "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/gitops/agent/manifestops" "Applier" diff --git a/internal/module/gitops/agent/manifestops/factory.go b/internal/module/gitops/agent/manifestops/factory.go deleted file mode 100644 index cce6a85c..00000000 --- a/internal/module/gitops/agent/manifestops/factory.go +++ /dev/null @@ -1,95 +0,0 @@ -package manifestops - -import ( - "time" - - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/gitops" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/gitops/rpc" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/modagent" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/modshared" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/retry" - "sigs.k8s.io/cli-utils/pkg/apply" - "sigs.k8s.io/cli-utils/pkg/inventory" -) - -const ( - getObjectsToSynchronizeInitBackoff = 10 * time.Second - getObjectsToSynchronizeMaxBackoff = 5 * time.Minute - getObjectsToSynchronizeResetDuration = 10 * time.Minute - getObjectsToSynchronizeBackoffFactor = 2.0 - getObjectsToSynchronizeJitter = 1.0 - - defaultReapplyInterval = 5 * time.Minute - applierInitBackoff = 10 * time.Second - applierMaxBackoff = time.Minute - applierResetDuration = 2 * time.Minute - applierBackoffFactor = 2.0 - applierJitter = 1.0 - - decodeInitBackoff = 10 * time.Second - decodeMaxBackoff = time.Minute - decodeResetDuration = 2 * time.Minute - decodeBackoffFactor = 2.0 - decodeJitter = 1.0 -) - -type Factory struct { -} - -func (f *Factory) IsProducingLeaderModules() bool { - return true -} - -func (f *Factory) New(config *modagent.Config) (modagent.Module, error) { - invClient, err := inventory.ClusterClientFactory{ - StatusPolicy: inventory.StatusPolicyNone, - }.NewClient(config.K8sUtilFactory) - if err != nil { - return nil, err - } - applier, err := apply.NewApplierBuilder(). - WithFactory(config.K8sUtilFactory). - WithInventoryClient(invClient). - Build() - if err != nil { - return nil, err - } - return &module{ - log: config.Log, - workerFactory: &workerFactory{ - log: config.Log, - applier: applier, - restClientGetter: config.K8sUtilFactory, - gitopsClient: rpc.NewGitopsClient(config.KasConn), - watchPollConfig: retry.NewPollConfigFactory(0, retry.NewExponentialBackoffFactory( - getObjectsToSynchronizeInitBackoff, - getObjectsToSynchronizeMaxBackoff, - getObjectsToSynchronizeResetDuration, - getObjectsToSynchronizeBackoffFactor, - getObjectsToSynchronizeJitter, - )), - applierPollConfig: retry.NewPollConfigFactory(defaultReapplyInterval, retry.NewExponentialBackoffFactory( - applierInitBackoff, - applierMaxBackoff, - applierResetDuration, - applierBackoffFactor, - applierJitter, - )), - decodeRetryPolicy: retry.NewExponentialBackoffFactory( - decodeInitBackoff, - decodeMaxBackoff, - decodeResetDuration, - decodeBackoffFactor, - decodeJitter, - ), - }, - }, nil -} - -func (f *Factory) Name() string { - return gitops.AgentManifestModuleName -} - -func (f *Factory) StartStopPhase() modshared.ModuleStartStopPhase { - return modshared.ModuleStartBeforeServers -} diff --git a/internal/module/gitops/agent/manifestops/mock_for_test.go b/internal/module/gitops/agent/manifestops/mock_for_test.go deleted file mode 100644 index 21b821d7..00000000 --- a/internal/module/gitops/agent/manifestops/mock_for_test.go +++ /dev/null @@ -1,81 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/gitops/agent/manifestops (interfaces: Applier) -// -// Generated by this command: -// -// mockgen -typed -self_package gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/gitops/agent/manifestops -destination mock_for_test.go -package manifestops gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/gitops/agent/manifestops Applier -// -// Package manifestops is a generated GoMock package. -package manifestops - -import ( - context "context" - reflect "reflect" - - gomock "go.uber.org/mock/gomock" - apply "sigs.k8s.io/cli-utils/pkg/apply" - event "sigs.k8s.io/cli-utils/pkg/apply/event" - inventory "sigs.k8s.io/cli-utils/pkg/inventory" - object "sigs.k8s.io/cli-utils/pkg/object" -) - -// MockApplier is a mock of Applier interface. -type MockApplier struct { - ctrl *gomock.Controller - recorder *MockApplierMockRecorder -} - -// MockApplierMockRecorder is the mock recorder for MockApplier. -type MockApplierMockRecorder struct { - mock *MockApplier -} - -// NewMockApplier creates a new mock instance. -func NewMockApplier(ctrl *gomock.Controller) *MockApplier { - mock := &MockApplier{ctrl: ctrl} - mock.recorder = &MockApplierMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockApplier) EXPECT() *MockApplierMockRecorder { - return m.recorder -} - -// Run mocks base method. -func (m *MockApplier) Run(arg0 context.Context, arg1 inventory.Info, arg2 object.UnstructuredSet, arg3 apply.ApplierOptions) <-chan event.Event { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Run", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(<-chan event.Event) - return ret0 -} - -// Run indicates an expected call of Run. -func (mr *MockApplierMockRecorder) Run(arg0, arg1, arg2, arg3 any) *ApplierRunCall { - mr.mock.ctrl.T.Helper() - call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Run", reflect.TypeOf((*MockApplier)(nil).Run), arg0, arg1, arg2, arg3) - return &ApplierRunCall{Call: call} -} - -// ApplierRunCall wrap *gomock.Call -type ApplierRunCall struct { - *gomock.Call -} - -// Return rewrite *gomock.Call.Return -func (c *ApplierRunCall) Return(arg0 <-chan event.Event) *ApplierRunCall { - c.Call = c.Call.Return(arg0) - return c -} - -// Do rewrite *gomock.Call.Do -func (c *ApplierRunCall) Do(f func(context.Context, inventory.Info, object.UnstructuredSet, apply.ApplierOptions) <-chan event.Event) *ApplierRunCall { - c.Call = c.Call.Do(f) - return c -} - -// DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *ApplierRunCall) DoAndReturn(f func(context.Context, inventory.Info, object.UnstructuredSet, apply.ApplierOptions) <-chan event.Event) *ApplierRunCall { - c.Call = c.Call.DoAndReturn(f) - return c -} diff --git a/internal/module/gitops/agent/manifestops/module.go b/internal/module/gitops/agent/manifestops/module.go deleted file mode 100644 index 9bfd644b..00000000 --- a/internal/module/gitops/agent/manifestops/module.go +++ /dev/null @@ -1,92 +0,0 @@ -package manifestops - -import ( - "context" - "fmt" - "time" - - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/gitops" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/modagent" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/logz" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/prototool" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/pkg/agentcfg" - "go.uber.org/zap" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -const ( - defaultGitOpsManifestNamespace = metav1.NamespaceDefault - defaultGitOpsManifestPathGlob = "**/*.{yaml,yml,json}" - defaultDryRunStrategy = dryRunStrategyNone - defaultPrune = true - defaultPruneTimeout = time.Hour - defaultReconcileTimeout = time.Hour - defaultPrunePropagationPolicy = prunePropagationPolicyForeground - defaultInventoryPolicy = inventoryPolicyMustMatch -) - -type module struct { - log *zap.Logger - workerFactory *workerFactory -} - -func (m *module) Run(ctx context.Context, cfg <-chan *agentcfg.AgentConfiguration) error { - wm := modagent.NewWorkerManager[*agentcfg.ManifestProjectCF](m.log, m.workerFactory) - defer wm.StopAllWorkers() - for config := range cfg { - err := wm.ApplyConfiguration(config.AgentId, config) // nolint: contextcheck - if err != nil { - m.log.Error("Failed to apply manifest projects configuration", logz.Error(err)) - continue - } - } - return nil -} - -func (m *module) DefaultAndValidateConfiguration(config *agentcfg.AgentConfiguration) error { - prototool.NotNil(&config.Gitops) - for _, project := range config.Gitops.ManifestProjects { - // If the config doesn't specify a project, use the agent's configuration project. - if project.Id == nil { - project.Id = &config.ProjectPath - } - err := applyDefaultsToManifestProject(project) - if err != nil { - return fmt.Errorf("project %s: %w", *project.Id, err) - } - } - return nil -} - -func applyDefaultsToManifestProject(project *agentcfg.ManifestProjectCF) error { - prototool.String(&project.DefaultNamespace, defaultGitOpsManifestNamespace) - if len(project.Paths) == 0 { - project.Paths = []*agentcfg.PathCF{ - { - Glob: defaultGitOpsManifestPathGlob, - }, - } - } - prototool.Duration(&project.ReconcileTimeout, defaultReconcileTimeout) - prototool.String(&project.DryRunStrategy, defaultDryRunStrategy) - if _, ok := dryRunStrategyMapping[project.DryRunStrategy]; !ok { - return fmt.Errorf("invalid dry-run strategy: %q", project.DryRunStrategy) - } - if project.PruneOneof == nil { - project.PruneOneof = &agentcfg.ManifestProjectCF_Prune{Prune: defaultPrune} - } - prototool.Duration(&project.PruneTimeout, defaultPruneTimeout) - prototool.String(&project.PrunePropagationPolicy, defaultPrunePropagationPolicy) - if _, ok := prunePropagationPolicyMapping[project.PrunePropagationPolicy]; !ok { - return fmt.Errorf("invalid prune propagation policy: %q", project.PrunePropagationPolicy) - } - prototool.String(&project.InventoryPolicy, defaultInventoryPolicy) - if _, ok := inventoryPolicyMapping[project.InventoryPolicy]; !ok { - return fmt.Errorf("invalid inventory policy: %q", project.InventoryPolicy) - } - return nil -} - -func (m *module) Name() string { - return gitops.AgentManifestModuleName -} diff --git a/internal/module/gitops/agent/manifestops/module_test.go b/internal/module/gitops/agent/manifestops/module_test.go deleted file mode 100644 index 5744d7f0..00000000 --- a/internal/module/gitops/agent/manifestops/module_test.go +++ /dev/null @@ -1,7 +0,0 @@ -package manifestops - -import "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/modagent" - -var ( - _ modagent.Module = &module{} -) diff --git a/internal/module/gitops/agent/manifestops/retry_pipeline.go b/internal/module/gitops/agent/manifestops/retry_pipeline.go deleted file mode 100644 index 5e0e8046..00000000 --- a/internal/module/gitops/agent/manifestops/retry_pipeline.go +++ /dev/null @@ -1,89 +0,0 @@ -package manifestops - -import ( - "fmt" - "time" - - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/retry" - "k8s.io/utils/clock" -) - -type processResult byte - -const ( - // success means there was no error and output should be consumed. - success processResult = iota - // backoff means there was a retriable error, so the caller should try later. - backoff - // done means there is no output to be consumed. There may or may not have been an error. - done -) - -type processFunc[IN any, OUT any] func(input IN) (OUT, processResult) - -// retryPipeline takes a channel with input, a processor function, and a channel for output. -// It reads values from input, processes them, and, if/when successful, sends the result into the output channel. -// If processing fails, it is retried with backoff. -// Results are sent to the output eventually. The old result, if it hasn't been sent already, is discarded when a new -// one becomes available. I.e. level-based rather than edge-based behavior. -type retryPipeline[IN any, OUT any] struct { - inputCh <-chan IN - outputCh chan<- OUT - retryBackoff retry.BackoffManager - process processFunc[IN, OUT] -} - -func (p *retryPipeline[IN, OUT]) run() { - var ( - input IN - output OUT - outputCh chan<- OUT - attemptCh <-chan time.Time - attemptTimer clock.Timer - ) - stopAttemptTimer := func() { - if attemptTimer != nil { - if !attemptTimer.Stop() { - <-attemptCh - } - } - } - defer stopAttemptTimer() - for { - var ok bool - select { - case input, ok = <-p.inputCh: - if !ok { - return // nolint: govet - } - stopAttemptTimer() - readyAttemptCh := make(chan time.Time, 1) - readyAttemptCh <- time.Time{} - attemptCh = readyAttemptCh // Enable and trigger the case below - case <-attemptCh: - newOutput, res := p.process(input) - switch res { - case success: - output = newOutput - outputCh = p.outputCh // Enable the 'output' select case - attemptTimer = nil - attemptCh = nil - case backoff: - attemptTimer = p.retryBackoff.Backoff() - attemptCh = attemptTimer.C() - case done: - // Nothing to do. - // If 'output' was already set, it remains set still. - attemptTimer = nil - attemptCh = nil - default: - panic(fmt.Errorf("unknown process result: %v", res)) - } - case outputCh <- output: - // Success! - var empty OUT - output = empty // Erase contents to help GC - outputCh = nil // Disable this select case (send to nil channel blocks forever) - } - } -} diff --git a/internal/module/gitops/agent/manifestops/retry_pipeline_test.go b/internal/module/gitops/agent/manifestops/retry_pipeline_test.go deleted file mode 100644 index ec585a0a..00000000 --- a/internal/module/gitops/agent/manifestops/retry_pipeline_test.go +++ /dev/null @@ -1,91 +0,0 @@ -package manifestops - -import ( - "testing" - "time" - - "github.com/stretchr/testify/assert" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/gitops/rpc" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/utils/clock" -) - -func TestRetryPipeline_LastInputOnly(t *testing.T) { - inputCh := make(chan rpc.ObjectsToSynchronizeData) - outputCh := make(chan applyJob) - in1 := rpc.ObjectsToSynchronizeData{ - ProjectId: 1, - } - in2 := rpc.ObjectsToSynchronizeData{ - ProjectId: 2, - } - out2 := applyJob{ - commitId: "2", - } - p := retryPipeline[rpc.ObjectsToSynchronizeData, applyJob]{ - inputCh: inputCh, - outputCh: outputCh, - retryBackoff: backoffMgr(), - process: func(input rpc.ObjectsToSynchronizeData) (applyJob, processResult) { - switch input.ProjectId { // we can receive either value because `select` is not deterministic. - case in1.ProjectId: - return applyJob{}, backoff // pretend there was an issue - case in2.ProjectId: - return out2, success - default: - panic(input) - } - }, - } - go p.run() - inputCh <- in1 - inputCh <- in2 - out := <-outputCh - close(inputCh) // stops the goroutine - assert.Equal(t, out2, out) -} - -func TestRetryPipeline_LastOutputOnly(t *testing.T) { - inputCh := make(chan rpc.ObjectsToSynchronizeData) - outputCh := make(chan applyJob) - in2wait := make(chan struct{}) - in1 := rpc.ObjectsToSynchronizeData{ - ProjectId: 1, - } - in2 := rpc.ObjectsToSynchronizeData{ - ProjectId: 2, - } - out1 := applyJob{ - commitId: "1", - } - out2 := applyJob{ - commitId: "2", - } - p := retryPipeline[rpc.ObjectsToSynchronizeData, applyJob]{ - inputCh: inputCh, - outputCh: outputCh, - retryBackoff: backoffMgr(), - process: func(input rpc.ObjectsToSynchronizeData) (applyJob, processResult) { - switch input.ProjectId { // we can receive either value because `select` is not deterministic. - case in1.ProjectId: - return out1, success - case in2.ProjectId: - close(in2wait) - return out2, success - default: - panic(input) - } - }, - } - go p.run() - inputCh <- in1 - inputCh <- in2 - <-in2wait // wait for in2 to have been processed - out := <-outputCh - close(inputCh) // stops the goroutine - assert.Equal(t, out2, out) -} - -func backoffMgr() wait.BackoffManager { - return wait.NewExponentialBackoffManager(time.Minute, time.Minute, time.Minute, 2, 1, clock.RealClock{}) // nolint:staticcheck -} diff --git a/internal/module/gitops/agent/manifestops/sync_decoder.go b/internal/module/gitops/agent/manifestops/sync_decoder.go deleted file mode 100644 index d015bcd6..00000000 --- a/internal/module/gitops/agent/manifestops/sync_decoder.go +++ /dev/null @@ -1,74 +0,0 @@ -package manifestops - -import ( - "bytes" - "errors" - - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/gitops/rpc" - "k8s.io/apimachinery/pkg/api/meta" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/cli-runtime/pkg/resource" - "sigs.k8s.io/cli-utils/pkg/manifestreader" -) - -type syncDecoder struct { - restClientGetter resource.RESTClientGetter - defaultNamespace string -} - -func (d *syncDecoder) Decode(sources []rpc.ObjectSource) ([]*unstructured.Unstructured, error) { - if len(sources) == 0 { - return nil, nil - } - // 1. Parse in local mode to retrieve objects. - builder := resource.NewBuilder(d.restClientGetter). - ContinueOnError(). - Flatten(). - Unstructured(). - Local() - for _, source := range sources { - builder.Stream(bytes.NewReader(source.Data), source.Name) - } - result := builder.Do() - var objs []*unstructured.Unstructured - err := result.Visit(func(info *resource.Info, err error) error { - if err != nil { - return err - } - objs = append(objs, info.Object.(*unstructured.Unstructured)) - return nil - }) - if err != nil { - return nil, err - } - // 2. Process parsed objects - set namespace to the default one if missing - restMapper, err := d.restClientGetter.ToRESTMapper() - if err != nil { - return nil, err - } - triedToResetMapper := false - for { - err = manifestreader.SetNamespaces(restMapper, objs, d.defaultNamespace, false) - if err != nil { - if triedToResetMapper || !isUnknownTypesError(err) || !isResettableRESTMapper(restMapper) { - return nil, err - } - // Haven't tried to reset the mapper AND it's an UnknownTypesError AND the mapper is resettable. - // Reset the mapper and try one more time. - triedToResetMapper = true - meta.MaybeResetRESTMapper(restMapper) - continue - } - return objs, nil - } -} - -func isUnknownTypesError(err error) bool { - var typeErr *manifestreader.UnknownTypesError - return errors.As(err, &typeErr) -} - -func isResettableRESTMapper(mapper meta.RESTMapper) bool { - _, ok := mapper.(meta.ResettableRESTMapper) - return ok -} diff --git a/internal/module/gitops/agent/manifestops/sync_decoder_test.go b/internal/module/gitops/agent/manifestops/sync_decoder_test.go deleted file mode 100644 index baec675f..00000000 --- a/internal/module/gitops/agent/manifestops/sync_decoder_test.go +++ /dev/null @@ -1,285 +0,0 @@ -package manifestops - -import ( - "testing" - - "github.com/google/go-cmp/cmp" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/gitops/rpc" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/mock_k8s" - "go.uber.org/mock/gomock" - "k8s.io/apimachinery/pkg/api/meta" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime/schema" - cmdtesting "k8s.io/kubectl/pkg/cmd/testing" - "sigs.k8s.io/yaml" -) - -const ( - defaultNs = "ns-default" - - yamlNamespace = `apiVersion: v1 -kind: Namespace -metadata: - name: gitlab-agent -` - yamlNamespaceNs = `apiVersion: v1 -kind: Namespace -metadata: - name: gitlab-agent - namespace: ns-ns -` - yamlConfigMapNoNs = `apiVersion: v1 -kind: ConfigMap -metadata: - name: map-no-ns -` - yamlConfigMapNs = `apiVersion: v1 -kind: ConfigMap -metadata: - name: map-ns - namespace: ns-map -` - yamlCRD = `apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: issuers.cert-manager.io -spec: - group: cert-manager.io - names: - kind: Issuer - listKind: IssuerList - plural: issuers - singular: issuer - scope: Namespaced - versions: - - name: v1 - subresources: - status: {} -` - yamlCRv1 = `apiVersion: cert-manager.io/v1 -kind: Issuer -metadata: - name: ca-issuer -spec: - ca: - secretName: ca-key-pair -` - - yamlCRv2 = `apiVersion: cert-manager.io/v2 -kind: Issuer -metadata: - name: ca-issuer -spec: - ca: - secretName: ca-key-pair -` -) - -func TestSyncDecoder_HappyPath(t *testing.T) { - tests := []struct { - name string - sources []rpc.ObjectSource - expectedErr string - expectedObjects []*unstructured.Unstructured - }{ - { - name: "namespaced with namespace", - sources: []rpc.ObjectSource{ - { - Name: "config-map-ns", - Data: []byte(yamlConfigMapNs), - }, - }, - expectedObjects: []*unstructured.Unstructured{ - yaml2unstructured(t, yamlConfigMapNs, ""), - }, - }, - { - name: "namespaced without namespace", - sources: []rpc.ObjectSource{ - { - Name: "config-map-no-ns", - Data: []byte(yamlConfigMapNoNs), - }, - }, - expectedObjects: []*unstructured.Unstructured{ - yaml2unstructured(t, yamlConfigMapNoNs, defaultNs), - }, - }, - { - name: "cluster-scoped", - sources: []rpc.ObjectSource{ - { - Name: "ns", - Data: []byte(yamlNamespace), - }, - }, - expectedObjects: []*unstructured.Unstructured{ - yaml2unstructured(t, yamlNamespace, ""), - }, - }, - { - name: "cluster-scoped with namespace", - sources: []rpc.ObjectSource{ - { - Name: "ns", - Data: []byte(yamlNamespaceNs), - }, - }, - expectedErr: `resource is cluster-scoped but has a non-empty namespace "ns-ns"`, - }, - { - name: "CRD", - sources: []rpc.ObjectSource{ - { - Name: "crd", - Data: []byte(yamlCRD), - }, - }, - expectedObjects: []*unstructured.Unstructured{ - yaml2unstructured(t, yamlCRD, ""), - }, - }, - { - name: "CRD and CRv1", - sources: []rpc.ObjectSource{ - { - Name: "crv1", - Data: []byte(yamlCRv1), - }, - { - Name: "crd", - Data: []byte(yamlCRD), - }, - }, - expectedObjects: []*unstructured.Unstructured{ - yaml2unstructured(t, yamlCRv1, defaultNs), - yaml2unstructured(t, yamlCRD, ""), - }, - }, - { - name: "CRv1", - sources: []rpc.ObjectSource{ - { - Name: "crv1", - Data: []byte(yamlCRv1), - }, - }, - expectedErr: "unknown resource types: cert-manager.io/v1/Issuer", - }, - { - name: "CRD and CRv2", - sources: []rpc.ObjectSource{ - { - Name: "crv2", - Data: []byte(yamlCRv2), - }, - { - Name: "crd", - Data: []byte(yamlCRD), - }, - }, - expectedErr: "unknown resource types: cert-manager.io/v2/Issuer", - }, - } - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - factory := cmdtesting.NewTestFactory() - defer factory.Cleanup() - mapper, err := factory.ToRESTMapper() - require.NoError(t, err) - crdGV := schema.GroupVersion{Group: "apiextensions.k8s.io", Version: "v1"} - crdMapper := meta.NewDefaultRESTMapper([]schema.GroupVersion{crdGV}) - crdMapper.AddSpecific(crdGV.WithKind("CustomResourceDefinition"), - crdGV.WithResource("customresourcedefinitions"), - crdGV.WithResource("customresourcedefinition"), meta.RESTScopeRoot) - mapper = meta.MultiRESTMapper([]meta.RESTMapper{mapper, crdMapper}) - - // There is no way to override the mapper in the test factory, so we do what we can. - clientGetter := mock_k8s.NewMockRESTClientGetter(gomock.NewController(t)) - clientGetter.EXPECT(). - ToRESTMapper(). - Return(mapper, nil). - MinTimes(1) - - d := syncDecoder{ - restClientGetter: clientGetter, - defaultNamespace: defaultNs, - } - res, err := d.Decode(tc.sources) - if tc.expectedErr != "" { - require.EqualError(t, err, tc.expectedErr) - assert.Nil(t, res) - } else { - require.NoError(t, err) - assert.Empty(t, cmp.Diff(res, tc.expectedObjects)) - } - }) - } -} - -func TestSyncDecoder_AsyncCRDRegistration(t *testing.T) { - factory := cmdtesting.NewTestFactory() - defer factory.Cleanup() - - certManagerGV := schema.GroupVersion{Group: "cert-manager.io", Version: "v1"} - certManagerGVK := certManagerGV.WithKind("Issuer") - - certManagerMapper := meta.NewDefaultRESTMapper([]schema.GroupVersion{certManagerGV}) - certManagerGVRPlural := certManagerGV.WithResource("issuers") - certManagerMapper.AddSpecific(certManagerGVK, - certManagerGVRPlural, - certManagerGV.WithResource("issuer"), meta.RESTScopeNamespace) - - ctrl := gomock.NewController(t) - mapper := mock_k8s.NewMockResettableRESTMapper(ctrl) - - clientGetter := mock_k8s.NewMockRESTClientGetter(ctrl) - clientGetter.EXPECT(). - ToRESTMapper(). - Return(mapper, nil). - MinTimes(1) - gomock.InOrder( - mapper.EXPECT(). - RESTMapping(certManagerGVK.GroupKind(), certManagerGVK.Version). - Return(nil, &meta.NoKindMatchError{ - GroupKind: certManagerGVK.GroupKind(), - SearchedVersions: []string{certManagerGVK.Version}, - }), - mapper.EXPECT(). - Reset(), - mapper.EXPECT(). - RESTMapping(certManagerGVK.GroupKind(), certManagerGVK.Version). - Return(&meta.RESTMapping{ - Resource: certManagerGVRPlural, - GroupVersionKind: certManagerGVK, - Scope: meta.RESTScopeNamespace, - }, nil), - ) - - d := syncDecoder{ - restClientGetter: clientGetter, - defaultNamespace: defaultNs, - } - res, err := d.Decode([]rpc.ObjectSource{ - { - Name: "crv1", - Data: []byte(yamlCRv1), - }, - }) - require.NoError(t, err) - assert.Empty(t, cmp.Diff(res, []*unstructured.Unstructured{yaml2unstructured(t, yamlCRv1, defaultNs)})) -} - -func yaml2unstructured(t *testing.T, yml, setNamespace string) *unstructured.Unstructured { - var o unstructured.Unstructured - err := yaml.Unmarshal([]byte(yml), &o.Object) - require.NoError(t, err) - if setNamespace != "" { - err = unstructured.SetNestedField(o.Object, setNamespace, "metadata", "namespace") - require.NoError(t, err) - } - return &o -} diff --git a/internal/module/gitops/agent/manifestops/worker.go b/internal/module/gitops/agent/manifestops/worker.go deleted file mode 100644 index df774e1c..00000000 --- a/internal/module/gitops/agent/manifestops/worker.go +++ /dev/null @@ -1,43 +0,0 @@ -package manifestops - -import ( - "context" - - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/gitops/rpc" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/retry" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/pkg/agentcfg" - "go.uber.org/zap" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/cli-runtime/pkg/resource" - "sigs.k8s.io/cli-utils/pkg/apply" -) - -type worker struct { - log *zap.Logger - agentId int64 - project *agentcfg.ManifestProjectCF - applier Applier - restClientGetter resource.RESTClientGetter - applierPollConfig retry.PollConfig - applyOptions apply.ApplierOptions - decodeRetryPolicy retry.BackoffManager - objWatcher rpc.ObjectsToSynchronizeWatcherInterface -} - -func (w *worker) Run(ctx context.Context) { - // Data flow: watch() -> decode() -> apply() - desiredState := make(chan rpc.ObjectsToSynchronizeData) - jobs := make(chan applyJob) - - var wg wait.Group - defer wg.Wait() // Wait for all pipeline stages to finish - defer close(desiredState) // Close desiredState to signal decode() there is no more work to be done. - wg.Start(func() { - w.apply(jobs) - }) - wg.Start(func() { - defer close(jobs) // Close jobs to signal apply() there is no more work to be done. - w.decode(desiredState, jobs) - }) - w.watch(ctx, desiredState) -} diff --git a/internal/module/gitops/agent/manifestops/worker_1_watch.go b/internal/module/gitops/agent/manifestops/worker_1_watch.go deleted file mode 100644 index 76ac13c5..00000000 --- a/internal/module/gitops/agent/manifestops/worker_1_watch.go +++ /dev/null @@ -1,30 +0,0 @@ -package manifestops - -import ( - "context" - - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/gitops/rpc" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/pkg/agentcfg" -) - -func (w *worker) watch(ctx context.Context, desiredState chan<- rpc.ObjectsToSynchronizeData) { - req := &rpc.ObjectsToSynchronizeRequest{ - ProjectId: *w.project.Id, - Ref: rpc.NewRpcRef(w.project.Ref), - Paths: configPathsToRpcPaths(w.project.Paths), - } - w.objWatcher.Watch(ctx, req, func(ctx context.Context, data rpc.ObjectsToSynchronizeData) { - select { - case <-ctx.Done(): - case desiredState <- data: - } - }) -} - -func configPathsToRpcPaths(paths []*agentcfg.PathCF) []*rpc.PathCF { - p := make([]*rpc.PathCF, 0, len(paths)) - for _, path := range paths { - p = append(p, &rpc.PathCF{Path: &rpc.PathCF_Glob{Glob: path.Glob}}) - } - return p -} diff --git a/internal/module/gitops/agent/manifestops/worker_2_decode.go b/internal/module/gitops/agent/manifestops/worker_2_decode.go deleted file mode 100644 index 9cb5f5c6..00000000 --- a/internal/module/gitops/agent/manifestops/worker_2_decode.go +++ /dev/null @@ -1,96 +0,0 @@ -package manifestops - -import ( - "context" - "fmt" - - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/gitops/rpc" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/logz" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "sigs.k8s.io/cli-utils/pkg/common" - "sigs.k8s.io/cli-utils/pkg/inventory" -) - -func (w *worker) decode(desiredState <-chan rpc.ObjectsToSynchronizeData, jobs chan<- applyJob) { - var jobCancel context.CancelFunc - defer func() { - if jobCancel != nil { - jobCancel() - } - }() - - d := syncDecoder{ - restClientGetter: w.restClientGetter, - defaultNamespace: w.project.DefaultNamespace, - } - - p := retryPipeline[rpc.ObjectsToSynchronizeData, applyJob]{ - inputCh: desiredState, - outputCh: jobs, - retryBackoff: w.decodeRetryPolicy, - process: func(input rpc.ObjectsToSynchronizeData) (applyJob, processResult) { - objs, err := d.Decode(input.Sources) - if err != nil { - w.log.Error("Failed to decode manifest objects", logz.Error(err), logz.CommitId(input.CommitId)) - return applyJob{}, backoff - } - invObj, objs, err := w.splitObjects(input.ProjectId, objs) - if err != nil { - w.log.Error("Failed to locate inventory object in manifest objects", logz.Error(err), logz.CommitId(input.CommitId)) - return applyJob{}, done - } - if jobCancel != nil { - jobCancel() // Cancel running/pending job ASAP - } - newJob := applyJob{ - commitId: input.CommitId, - invInfo: inventory.WrapInventoryInfoObj(invObj), - objects: objs, - } - newJob.ctx, jobCancel = context.WithCancel(context.Background()) // nolint: govet - return newJob, success - }, - } - p.run() -} - -func (w *worker) splitObjects(projectId int64, objs []*unstructured.Unstructured) (*unstructured.Unstructured, []*unstructured.Unstructured, error) { - invs := make([]*unstructured.Unstructured, 0, 1) - resources := make([]*unstructured.Unstructured, 0, len(objs)) - for _, obj := range objs { - if inventory.IsInventoryObject(obj) { - invs = append(invs, obj) - } else { - resources = append(resources, obj) - } - } - switch len(invs) { - case 0: - return w.defaultInventoryObjTemplate(projectId), resources, nil - case 1: - return invs[0], resources, nil - default: - return nil, nil, fmt.Errorf("expecting zero or one inventory object, found %d", len(invs)) - } -} - -func (w *worker) defaultInventoryObjTemplate(projectId int64) *unstructured.Unstructured { - id := inventoryId(w.agentId, projectId) - return &unstructured.Unstructured{ - Object: map[string]interface{}{ - "apiVersion": "v1", - "kind": "ConfigMap", - "metadata": map[string]interface{}{ - "name": "inventory-" + id, - "namespace": w.project.DefaultNamespace, - "labels": map[string]interface{}{ - common.InventoryLabel: id, - }, - }, - }, - } -} - -func inventoryId(agentId, projectId int64) string { - return fmt.Sprintf("%d-%d", agentId, projectId) -} diff --git a/internal/module/gitops/agent/manifestops/worker_3_apply.go b/internal/module/gitops/agent/manifestops/worker_3_apply.go deleted file mode 100644 index 5e5e968d..00000000 --- a/internal/module/gitops/agent/manifestops/worker_3_apply.go +++ /dev/null @@ -1,55 +0,0 @@ -package manifestops - -import ( - "bytes" - "context" - "os" - - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/errz" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/logz" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/retry" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/cli-runtime/pkg/genericclioptions" - "sigs.k8s.io/cli-utils/pkg/common" - "sigs.k8s.io/cli-utils/pkg/inventory" - "sigs.k8s.io/cli-utils/pkg/printers" -) - -type applyJob struct { - ctx context.Context - commitId string - invInfo inventory.Info - objects []*unstructured.Unstructured -} - -func (w *worker) apply(jobs <-chan applyJob) { - for job := range jobs { - l := w.log.With(logz.CommitId(job.commitId)) - _ = retry.PollWithBackoff(job.ctx, w.applierPollConfig, func(ctx context.Context) (error, retry.AttemptResult) { - l.Info("Synchronizing objects") - err := w.applyJob(ctx, job) - if err != nil { - if errz.ContextDone(err) { - l.Info("Synchronization was canceled", logz.Error(err)) - } else { - l.Warn("Synchronization failed", logz.Error(err)) - } - return nil, retry.Backoff - } - l.Info("Objects synchronized") - return nil, retry.Continue - }) - } -} - -func (w *worker) applyJob(ctx context.Context, job applyJob) error { - events := w.applier.Run(ctx, job.invInfo, job.objects, w.applyOptions) - // The printer will print updates from the channel. It will block - // until the channel is closed. - printer := printers.GetPrinter(printers.JSONPrinter, genericclioptions.IOStreams{ - In: &bytes.Buffer{}, // nothing to read - Out: os.Stderr, - ErrOut: os.Stderr, - }) - return printer.Print(events, common.DryRunNone, true) -} diff --git a/internal/module/gitops/agent/manifestops/worker_factory.go b/internal/module/gitops/agent/manifestops/worker_factory.go deleted file mode 100644 index daf18254..00000000 --- a/internal/module/gitops/agent/manifestops/worker_factory.go +++ /dev/null @@ -1,158 +0,0 @@ -package manifestops - -import ( - "context" - - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/gitops/rpc" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/modagent" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/logz" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/retry" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/pkg/agentcfg" - "go.uber.org/zap" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/cli-runtime/pkg/resource" - "sigs.k8s.io/cli-utils/pkg/apply" - "sigs.k8s.io/cli-utils/pkg/apply/event" - "sigs.k8s.io/cli-utils/pkg/common" - "sigs.k8s.io/cli-utils/pkg/inventory" - "sigs.k8s.io/cli-utils/pkg/kstatus/watcher" - "sigs.k8s.io/cli-utils/pkg/object" - "sigs.k8s.io/cli-utils/pkg/object/validation" -) - -const ( - dryRunStrategyNone = "none" - dryRunStrategyClient = "client" - dryRunStrategyServer = "server" - - prunePropagationPolicyOrphan = "orphan" - prunePropagationPolicyBackground = "background" - prunePropagationPolicyForeground = "foreground" - - inventoryPolicyMustMatch = "must_match" - inventoryPolicyAdoptIfNoInventory = "adopt_if_no_inventory" - inventoryPolicyAdoptAll = "adopt_all" -) - -var ( - dryRunStrategyMapping = map[string]common.DryRunStrategy{ - dryRunStrategyNone: common.DryRunNone, - dryRunStrategyClient: common.DryRunClient, - dryRunStrategyServer: common.DryRunServer, - } - prunePropagationPolicyMapping = map[string]metav1.DeletionPropagation{ - prunePropagationPolicyOrphan: metav1.DeletePropagationOrphan, - prunePropagationPolicyBackground: metav1.DeletePropagationBackground, - prunePropagationPolicyForeground: metav1.DeletePropagationForeground, - } - inventoryPolicyMapping = map[string]inventory.Policy{ - inventoryPolicyMustMatch: inventory.PolicyMustMatch, - inventoryPolicyAdoptIfNoInventory: inventory.PolicyAdoptIfNoInventory, - inventoryPolicyAdoptAll: inventory.PolicyAdoptAll, - } -) - -type Applier interface { - Run(ctx context.Context, invInfo inventory.Info, objects object.UnstructuredSet, options apply.ApplierOptions) <-chan event.Event -} - -type workerFactory struct { - log *zap.Logger - applier Applier - restClientGetter resource.RESTClientGetter - gitopsClient rpc.GitopsClient - watchPollConfig retry.PollConfigFactory - applierPollConfig retry.PollConfigFactory - decodeRetryPolicy retry.BackoffManagerFactory -} - -func (f *workerFactory) New(agentId int64, source modagent.WorkSource[*agentcfg.ManifestProjectCF]) modagent.Worker { - project := source.Configuration() - l := f.log.With(logz.WorkerId(source.ID())) - return &worker{ - log: l, - agentId: agentId, - project: project, - applier: f.applier, - restClientGetter: f.restClientGetter, - applierPollConfig: f.applierPollConfig(), - applyOptions: apply.ApplierOptions{ - ServerSideOptions: common.ServerSideOptions{ - // It's supported since Kubernetes 1.16, so there should be no reason not to use it. - // https://kubernetes.io/docs/reference/using-api/server-side-apply/ - ServerSideApply: true, - // GitOps repository is the source of truth and that's what we are applying, so overwrite any conflicts. - // https://kubernetes.io/docs/reference/using-api/server-side-apply/#conflicts - ForceConflicts: true, - // https://kubernetes.io/docs/reference/using-api/server-side-apply/#field-management - FieldManager: modagent.FieldManager, - }, - ReconcileTimeout: project.ReconcileTimeout.AsDuration(), - EmitStatusEvents: true, - NoPrune: !project.GetPrune(), - DryRunStrategy: f.mapDryRunStrategy(project.DryRunStrategy), - PrunePropagationPolicy: f.mapPrunePropagationPolicy(project.PrunePropagationPolicy), - PruneTimeout: project.PruneTimeout.AsDuration(), - InventoryPolicy: f.mapInventoryPolicy(project.InventoryPolicy), - ValidationPolicy: validation.ExitEarly, - WatcherRESTScopeStrategy: watcher.RESTScopeNamespace, - }, - decodeRetryPolicy: f.decodeRetryPolicy(), - objWatcher: &rpc.ObjectsToSynchronizeWatcher{ - Log: l, - GitopsClient: f.gitopsClient, - PollConfig: f.watchPollConfig, - }, - } -} - -func (f *workerFactory) SourcesFromConfiguration(cfg *agentcfg.AgentConfiguration) []modagent.WorkSource[*agentcfg.ManifestProjectCF] { - res := make([]modagent.WorkSource[*agentcfg.ManifestProjectCF], 0, len(cfg.Gitops.ManifestProjects)) - for _, project := range cfg.Gitops.ManifestProjects { - res = append(res, (*manifestSource)(project)) - } - return res -} - -func (f *workerFactory) mapDryRunStrategy(strategy string) common.DryRunStrategy { - ret, ok := dryRunStrategyMapping[strategy] - if !ok { - // This shouldn't happen because we've checked the value in DefaultAndValidateConfiguration(). - // Just being extra cautious. - f.log.Sugar().Errorf("Invalid dry-run strategy: %q, using client dry-run for safety - NO CHANGES WILL BE APPLIED!", strategy) - ret = common.DryRunClient - } - return ret -} - -func (f *workerFactory) mapPrunePropagationPolicy(policy string) metav1.DeletionPropagation { - ret, ok := prunePropagationPolicyMapping[policy] - if !ok { - // This shouldn't happen because we've checked the value in DefaultAndValidateConfiguration(). - // Just being extra cautious. - f.log.Sugar().Errorf("Invalid prune propagation policy: %q, defaulting to %s", policy, metav1.DeletePropagationForeground) - ret = metav1.DeletePropagationForeground - } - return ret -} - -func (f *workerFactory) mapInventoryPolicy(policy string) inventory.Policy { - ret, ok := inventoryPolicyMapping[policy] - if !ok { - // This shouldn't happen because we've checked the value in DefaultAndValidateConfiguration(). - // Just being extra cautious. - f.log.Sugar().Errorf("Invalid inventory policy: %q, defaulting to 'must match'", policy) - ret = inventory.PolicyMustMatch - } - return ret -} - -type manifestSource agentcfg.ManifestProjectCF - -func (s *manifestSource) ID() string { - return *s.Id -} - -func (s *manifestSource) Configuration() *agentcfg.ManifestProjectCF { - return (*agentcfg.ManifestProjectCF)(s) -} diff --git a/internal/module/gitops/agent/manifestops/worker_test.go b/internal/module/gitops/agent/manifestops/worker_test.go deleted file mode 100644 index 4312d335..00000000 --- a/internal/module/gitops/agent/manifestops/worker_test.go +++ /dev/null @@ -1,406 +0,0 @@ -package manifestops - -import ( - "context" - "errors" - "testing" - "time" - - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/stretchr/testify/assert" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/gitops/rpc" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/modagent" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/retry" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/kube_testing" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/matcher" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/mock_rpc" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/testhelpers" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/pkg/agentcfg" - "go.uber.org/mock/gomock" - "go.uber.org/zap/zaptest" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/util/wait" - cmdtesting "k8s.io/kubectl/pkg/cmd/testing" - "k8s.io/utils/clock" - "sigs.k8s.io/cli-utils/pkg/apply" - "sigs.k8s.io/cli-utils/pkg/apply/event" - "sigs.k8s.io/cli-utils/pkg/common" - "sigs.k8s.io/cli-utils/pkg/inventory" - "sigs.k8s.io/cli-utils/pkg/object" -) - -const ( - revision = "rev12341234" - defaultNamespace = "testing1" -) - -var ( - projectId = "bla123/bla-1" - - _ modagent.Factory = &Factory{} - _ modagent.Worker = &worker{} - _ modagent.WorkerFactory[*agentcfg.ManifestProjectCF] = &workerFactory{} - _ modagent.WorkSource[*agentcfg.ManifestProjectCF] = &manifestSource{} -) - -func TestRun_HappyPath_NoObjects(t *testing.T) { - w, applier, watcher := setupWorker(t) - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - req := &rpc.ObjectsToSynchronizeRequest{ - ProjectId: projectId, - Paths: configPathsToRpcPaths(w.project.Paths), - } - gomock.InOrder( - watcher.EXPECT(). - Watch(gomock.Any(), matcher.ProtoEq(t, req), gomock.Any()). - Do(func(ctx context.Context, req *rpc.ObjectsToSynchronizeRequest, callback rpc.ObjectsToSynchronizeCallback) { - callback(ctx, rpc.ObjectsToSynchronizeData{ - CommitId: revision, - }) - <-ctx.Done() - }), - applier.EXPECT(). - Run(gomock.Any(), gomock.Any(), gomock.Len(0), gomock.Any()). - DoAndReturn(func(ctx context.Context, invInfo inventory.Info, objects object.UnstructuredSet, options apply.ApplierOptions) <-chan event.Event { - cancel() // all good, stop run() - c := make(chan event.Event) - close(c) - return c - }), - ) - w.Run(ctx) -} - -func TestRun_HappyPath_NoInventoryTemplate(t *testing.T) { - w, applier, watcher := setupWorker(t) - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - req := &rpc.ObjectsToSynchronizeRequest{ - ProjectId: projectId, - Paths: configPathsToRpcPaths(w.project.Paths), - } - objs := object.UnstructuredSet{ - kube_testing.ToUnstructured(t, testMap1()), - kube_testing.ToUnstructured(t, testNs1()), - kube_testing.ToUnstructured(t, testMap2()), - } - gomock.InOrder( - watcher.EXPECT(). - Watch(gomock.Any(), matcher.ProtoEq(t, req), gomock.Any()). - Do(func(ctx context.Context, req *rpc.ObjectsToSynchronizeRequest, callback rpc.ObjectsToSynchronizeCallback) { - callback(ctx, rpc.ObjectsToSynchronizeData{ - CommitId: revision, - Sources: []rpc.ObjectSource{ - { - Name: "obj1.yaml", - Data: kube_testing.ObjsToYAML(t, objs[0]), - }, - { - Name: "obj2.yaml", - Data: kube_testing.ObjsToYAML(t, objs[1], objs[2]), - }, - }, - }) - <-ctx.Done() - }), - applier.EXPECT(). - Run(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()). - DoAndReturn(func(ctx context.Context, invInfo inventory.Info, objects object.UnstructuredSet, options apply.ApplierOptions) <-chan event.Event { - assertK8sObjectsMatch(t, objs, objects) - assert.Equal(t, w.project.DefaultNamespace, invInfo.Namespace()) - cancel() // all good, stop Run() - c := make(chan event.Event) - close(c) - return c - }), - ) - w.Run(ctx) -} - -func TestRun_HappyPath_InventoryTemplate(t *testing.T) { - w, applier, watcher := setupWorker(t) - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - req := &rpc.ObjectsToSynchronizeRequest{ - ProjectId: projectId, - Paths: configPathsToRpcPaths(w.project.Paths), - } - inv := invObject("some_id", "some_ns") - objs := object.UnstructuredSet{kube_testing.ToUnstructured(t, testMap1())} - gomock.InOrder( - watcher.EXPECT(). - Watch(gomock.Any(), matcher.ProtoEq(t, req), gomock.Any()). - Do(func(ctx context.Context, req *rpc.ObjectsToSynchronizeRequest, callback rpc.ObjectsToSynchronizeCallback) { - callback(ctx, rpc.ObjectsToSynchronizeData{ - CommitId: revision, - Sources: []rpc.ObjectSource{ - { - Name: "obj1.yaml", - Data: kube_testing.ObjsToYAML(t, objs[0], inv), - }, - }, - }) - <-ctx.Done() - }), - applier.EXPECT(). - Run(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()). - DoAndReturn(func(ctx context.Context, invInfo inventory.Info, objects object.UnstructuredSet, options apply.ApplierOptions) <-chan event.Event { - assertK8sObjectsMatch(t, objs, objects) - assert.Equal(t, "some_ns", invInfo.Namespace()) - assert.Equal(t, "inventory-some_id", invInfo.Name()) - cancel() // all good, stop Run() - c := make(chan event.Event) - close(c) - return c - }), - ) - w.Run(ctx) -} - -func TestRun_SyncCancellation(t *testing.T) { - w, applier, watcher := setupWorker(t) - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - req := &rpc.ObjectsToSynchronizeRequest{ - ProjectId: projectId, - Paths: configPathsToRpcPaths(w.project.Paths), - } - objs := object.UnstructuredSet{ - kube_testing.ToUnstructured(t, testMap1()), - kube_testing.ToUnstructured(t, testNs1()), - kube_testing.ToUnstructured(t, testMap2()), - } - job1started := make(chan struct{}) - watcher.EXPECT(). - Watch(gomock.Any(), matcher.ProtoEq(t, req), gomock.Any()). - Do(func(ctx context.Context, req *rpc.ObjectsToSynchronizeRequest, callback rpc.ObjectsToSynchronizeCallback) { - callback(ctx, rpc.ObjectsToSynchronizeData{ - CommitId: revision, - Sources: []rpc.ObjectSource{ - { - Name: "obj1.yaml", - Data: kube_testing.ObjsToYAML(t, objs[0]), - }, - { - Name: "obj2.yaml", - Data: kube_testing.ObjsToYAML(t, objs[1], objs[2]), - }, - }, - }) - <-job1started - callback(ctx, rpc.ObjectsToSynchronizeData{ - CommitId: revision, - }) - <-ctx.Done() - }) - gomock.InOrder( - applier.EXPECT(). - Run(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()). - DoAndReturn(func(ctx context.Context, invInfo inventory.Info, objects object.UnstructuredSet, options apply.ApplierOptions) <-chan event.Event { - assertK8sObjectsMatch(t, objs, objects) - close(job1started) // signal that this job has been started - c := make(chan event.Event) - go func() { - <-ctx.Done() // block until the job is cancelled - close(c) - }() - return c - }), - applier.EXPECT(). - Run(gomock.Any(), gomock.Any(), gomock.Len(0), gomock.Any()). - DoAndReturn(func(ctx context.Context, invInfo inventory.Info, objects object.UnstructuredSet, options apply.ApplierOptions) <-chan event.Event { - cancel() // all good, stop Run() - c := make(chan event.Event) - close(c) - return c - }), - ) - w.Run(ctx) -} - -func TestRun_ApplyIsRetriedOnError(t *testing.T) { - w, applier, watcher := setupWorker(t) - w.applierPollConfig = retry.PollConfig{ - Backoff: retry.NewExponentialBackoffFactory(time.Millisecond, time.Minute, time.Minute, 2, 1)(), - Interval: w.applierPollConfig.Interval, - Sliding: w.applierPollConfig.Sliding, - } - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - req := &rpc.ObjectsToSynchronizeRequest{ - ProjectId: projectId, - Paths: configPathsToRpcPaths(w.project.Paths), - } - watcher.EXPECT(). - Watch(gomock.Any(), matcher.ProtoEq(t, req), gomock.Any()). - Do(func(ctx context.Context, req *rpc.ObjectsToSynchronizeRequest, callback rpc.ObjectsToSynchronizeCallback) { - callback(ctx, rpc.ObjectsToSynchronizeData{ - CommitId: revision, - }) - <-ctx.Done() - }) - gomock.InOrder( - applier.EXPECT(). - Run(gomock.Any(), gomock.Any(), gomock.Len(0), gomock.Any()). - DoAndReturn(func(ctx context.Context, invInfo inventory.Info, objects object.UnstructuredSet, options apply.ApplierOptions) <-chan event.Event { - c := make(chan event.Event, 1) - c <- event.Event{ - Type: event.ErrorType, - ErrorEvent: event.ErrorEvent{ - Err: errors.New("expected error"), - }, - } - close(c) - return c - }), - applier.EXPECT(). - Run(gomock.Any(), gomock.Any(), gomock.Len(0), gomock.Any()). - DoAndReturn(func(ctx context.Context, invInfo inventory.Info, objects object.UnstructuredSet, options apply.ApplierOptions) <-chan event.Event { - cancel() // all good, stop Run() - c := make(chan event.Event) - close(c) - return c - }), - ) - w.Run(ctx) -} - -func TestRun_PeriodicApply(t *testing.T) { - w, applier, watcher := setupWorker(t) - w.applierPollConfig.Interval = time.Millisecond - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - req := &rpc.ObjectsToSynchronizeRequest{ - ProjectId: projectId, - Paths: configPathsToRpcPaths(w.project.Paths), - } - watcher.EXPECT(). - Watch(gomock.Any(), matcher.ProtoEq(t, req), gomock.Any()). - Do(func(ctx context.Context, req *rpc.ObjectsToSynchronizeRequest, callback rpc.ObjectsToSynchronizeCallback) { - callback(ctx, rpc.ObjectsToSynchronizeData{ - CommitId: revision, - }) - <-ctx.Done() - }) - gomock.InOrder( - applier.EXPECT(). - Run(gomock.Any(), gomock.Any(), gomock.Len(0), gomock.Any()). - DoAndReturn(func(ctx context.Context, invInfo inventory.Info, objects object.UnstructuredSet, options apply.ApplierOptions) <-chan event.Event { - c := make(chan event.Event) - close(c) - return c - }), - applier.EXPECT(). - Run(gomock.Any(), gomock.Any(), gomock.Len(0), gomock.Any()). - DoAndReturn(func(ctx context.Context, invInfo inventory.Info, objects object.UnstructuredSet, options apply.ApplierOptions) <-chan event.Event { - cancel() // all good, stop Run() - c := make(chan event.Event) - close(c) - return c - }), - ) - w.Run(ctx) -} - -func assertK8sObjectsMatch(t *testing.T, expected, actual interface{}) { - assert.Empty(t, cmp.Diff(expected, actual, kube_testing.TransformToUnstructured(), cmpopts.EquateEmpty())) -} - -func setupWorker(t *testing.T) (*worker, *MockApplier, *mock_rpc.MockObjectsToSynchronizeWatcherInterface) { - ctrl := gomock.NewController(t) - applier := NewMockApplier(ctrl) - watcher := mock_rpc.NewMockObjectsToSynchronizeWatcherInterface(ctrl) - tf := cmdtesting.NewTestFactory() - t.Cleanup(tf.Cleanup) - w := &worker{ - log: zaptest.NewLogger(t), - project: &agentcfg.ManifestProjectCF{ - Id: &projectId, - DefaultNamespace: defaultNamespace, // as if user didn't specify configuration so it's the default value - Paths: []*agentcfg.PathCF{ - { - Glob: "*.yaml", - }, - }, - }, - applier: applier, - restClientGetter: tf, - applierPollConfig: testhelpers.NewPollConfig(time.Minute)(), - decodeRetryPolicy: wait.NewExponentialBackoffManager(time.Minute, time.Minute, time.Minute, 2, 1, clock.RealClock{}), // nolint:staticcheck - objWatcher: watcher, - } - return w, applier, watcher -} - -func testMap1() *corev1.ConfigMap { - return &corev1.ConfigMap{ - TypeMeta: metav1.TypeMeta{ - Kind: "ConfigMap", - APIVersion: "v1", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "map1", - Namespace: "test1", - Annotations: map[string]string{ - "k1": "v1", - }, - }, - Data: map[string]string{ - "key1": "value1", - }, - } -} - -func testMap2() *corev1.ConfigMap { - return &corev1.ConfigMap{ - TypeMeta: metav1.TypeMeta{ - Kind: "ConfigMap", - APIVersion: "v1", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "map2", - Namespace: "test2", - Annotations: map[string]string{ - "k2": "v2", - }, - }, - Data: map[string]string{ - "key2": "value2", - }, - } -} - -func testNs1() *corev1.Namespace { - return &corev1.Namespace{ - TypeMeta: metav1.TypeMeta{ - Kind: "Namespace", - APIVersion: "v1", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "ns1", - Annotations: map[string]string{ - "k3": "v3", - }, - }, - } -} - -func invObject(id, namespace string) *unstructured.Unstructured { - return &unstructured.Unstructured{ - Object: map[string]interface{}{ - "apiVersion": "v1", - "kind": "ConfigMap", - "metadata": map[string]interface{}{ - "name": "inventory-" + id, - "namespace": namespace, - "labels": map[string]interface{}{ - common.InventoryLabel: id, - }, - }, - }, - } -} diff --git a/internal/module/gitops/api.go b/internal/module/gitops/api.go deleted file mode 100644 index 49291472..00000000 --- a/internal/module/gitops/api.go +++ /dev/null @@ -1,7 +0,0 @@ -package gitops - -const ( - ModuleName = "gitops" - AgentManifestModuleName = "gitops-manifest" - AgentChartModuleName = "gitops-chart" -) diff --git a/internal/module/gitops/rpc/BUILD.bazel b/internal/module/gitops/rpc/BUILD.bazel deleted file mode 100644 index 3612f0c5..00000000 --- a/internal/module/gitops/rpc/BUILD.bazel +++ /dev/null @@ -1,59 +0,0 @@ -load("//build:build.bzl", "go_custom_test") -load("@io_bazel_rules_go//go:def.bzl", "go_library") -load("//build:proto.bzl", "go_grpc_generate") - -go_grpc_generate( - src = "rpc.proto", - deps = [ - "//internal/tool/grpctool/automata:proto", - "@com_github_envoyproxy_protoc_gen_validate//validate:validate_proto", - ], -) - -go_library( - name = "rpc", - srcs = [ - "obj_to_sync_watcher.go", - "rpc.pb.go", - "rpc.pb.validate.go", - "rpc_extra.go", - "rpc_grpc.pb.go", - ], - importpath = "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/gitops/rpc", - visibility = ["//:__subpackages__"], - deps = [ - "//internal/gitaly", - "//internal/tool/grpctool", - "//internal/tool/grpctool/automata", - "//internal/tool/logz", - "//internal/tool/retry", - "//pkg/agentcfg", - "@com_github_envoyproxy_protoc_gen_validate//validate", - "@org_golang_google_grpc//:grpc", - "@org_golang_google_grpc//codes", - "@org_golang_google_grpc//status", - "@org_golang_google_protobuf//reflect/protoreflect", - "@org_golang_google_protobuf//runtime/protoimpl", - "@org_golang_google_protobuf//types/known/anypb", - "@org_uber_go_zap//:zap", - ], -) - -go_custom_test( - name = "rpc_test", - srcs = [ - "obj_to_sync_watcher_test.go", - "rpc_extra_test.go", - ], - embed = [":rpc"], - deps = [ - "//internal/tool/retry", - "//internal/tool/testing/matcher", - "//internal/tool/testing/mock_rpc", - "//internal/tool/testing/testhelpers", - "//pkg/agentcfg", - "@com_github_stretchr_testify//assert", - "@org_uber_go_mock//gomock", - "@org_uber_go_zap//zaptest", - ], -) diff --git a/internal/module/gitops/rpc/obj_to_sync_watcher.go b/internal/module/gitops/rpc/obj_to_sync_watcher.go deleted file mode 100644 index 9cd0a8b1..00000000 --- a/internal/module/gitops/rpc/obj_to_sync_watcher.go +++ /dev/null @@ -1,125 +0,0 @@ -package rpc - -import ( - "context" - - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/grpctool" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/logz" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/retry" - "go.uber.org/zap" - "google.golang.org/grpc" - "google.golang.org/protobuf/reflect/protoreflect" -) - -const ( - headerFieldNumber protoreflect.FieldNumber = 1 - objectFieldNumber protoreflect.FieldNumber = 2 - trailerFieldNumber protoreflect.FieldNumber = 3 -) - -var ( - respVisitor = grpctool.NewLazyStreamVisitor(&ObjectsToSynchronizeResponse{}) -) - -type ObjectSource struct { - Name string - Data []byte -} - -type ObjectsToSynchronizeData struct { - CommitId string - ProjectId int64 - Sources []ObjectSource -} - -type ObjectsToSynchronizeCallback func(context.Context, ObjectsToSynchronizeData) - -// ObjectsToSynchronizeWatcherInterface abstracts ObjectsToSynchronizeWatcher. -type ObjectsToSynchronizeWatcherInterface interface { - Watch(context.Context, *ObjectsToSynchronizeRequest, ObjectsToSynchronizeCallback) -} - -type ObjectsToSynchronizeWatcher struct { - Log *zap.Logger - GitopsClient GitopsClient - PollConfig retry.PollConfigFactory -} - -func (o *ObjectsToSynchronizeWatcher) Watch(ctx context.Context, req *ObjectsToSynchronizeRequest, callback ObjectsToSynchronizeCallback) { - sv := respVisitor.Get() - lastProcessedCommitId := req.CommitId - _ = retry.PollWithBackoff(ctx, o.PollConfig(), func(ctx context.Context) (error, retry.AttemptResult) { - ctx, cancel := context.WithCancel(ctx) // nolint:govet - defer cancel() // ensure streaming call is canceled - // Send a new message each time rather than mutate req. - res, err := o.GitopsClient.GetObjectsToSynchronize(ctx, &ObjectsToSynchronizeRequest{ - ProjectId: req.ProjectId, - Ref: req.Ref, - CommitId: lastProcessedCommitId, - Paths: req.Paths, - }, grpc.WaitForReady(true)) - if err != nil { - if !grpctool.RequestCanceledOrTimedOut(err) { - o.Log.Error("GetObjectsToSynchronize failed", logz.Error(err)) - } - return nil, retry.Backoff - } - v := objectsToSynchronizeVisitor{} - err = sv.Visit(res, - grpctool.WithCallback(headerFieldNumber, v.OnHeader), - grpctool.WithCallback(objectFieldNumber, v.OnObject), - grpctool.WithCallback(trailerFieldNumber, v.OnTrailer), - ) - if err != nil { - if !grpctool.RequestCanceledOrTimedOut(err) { - o.Log.Error("GetObjectsToSynchronize.Recv failed", logz.Error(err)) - } - return nil, retry.Backoff - } - if !v.nonEmptyStream { - // Server closed the stream without sending us anything. - // It's fine, will just reopen the connection. - return nil, retry.ContinueImmediately - } - callback(ctx, v.objs) - lastProcessedCommitId = v.objs.CommitId - - if req.GetRef().GetCommit() != "" { - o.Log.Debug("GetObjectsToSynchronize configuration is for specific commit, no need to update, thus block watcher until cancelled") - <-ctx.Done() - return nil, retry.Done - } - return nil, retry.ContinueImmediately - }) -} - -type objectsToSynchronizeVisitor struct { - objs ObjectsToSynchronizeData - nonEmptyStream bool -} - -func (v *objectsToSynchronizeVisitor) OnHeader(header *ObjectsToSynchronizeResponse_Header) error { - v.objs.CommitId = header.CommitId - v.objs.ProjectId = header.ProjectId - return nil -} - -func (v *objectsToSynchronizeVisitor) OnObject(object *ObjectsToSynchronizeResponse_Object) error { - lastIdx := len(v.objs.Sources) - 1 - if lastIdx >= 0 && v.objs.Sources[lastIdx].Name == object.Source { - // Same source, append to the actual slice - v.objs.Sources[lastIdx].Data = append(v.objs.Sources[lastIdx].Data, object.Data...) - } else { - // A new source - v.objs.Sources = append(v.objs.Sources, ObjectSource{ - Name: object.Source, - Data: object.Data, - }) - } - return nil -} - -func (v *objectsToSynchronizeVisitor) OnTrailer(trailer *ObjectsToSynchronizeResponse_Trailer) error { - v.nonEmptyStream = true - return nil -} diff --git a/internal/module/gitops/rpc/obj_to_sync_watcher_test.go b/internal/module/gitops/rpc/obj_to_sync_watcher_test.go deleted file mode 100644 index 2a085f03..00000000 --- a/internal/module/gitops/rpc/obj_to_sync_watcher_test.go +++ /dev/null @@ -1,217 +0,0 @@ -package rpc_test - -import ( - "context" - "io" - "testing" - "time" - - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/gitops/rpc" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/retry" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/matcher" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/mock_rpc" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/testhelpers" - "go.uber.org/mock/gomock" - "go.uber.org/zap/zaptest" -) - -var ( - _ rpc.ObjectsToSynchronizeWatcherInterface = &rpc.ObjectsToSynchronizeWatcher{} -) - -const ( - projectId = "bla123/bla-1" - revision = "rev12341234" -) - -func TestObjectsToSynchronizeWatcherResumeConnection(t *testing.T) { - pathsCfg := []*rpc.PathCF{ - { - Path: &rpc.PathCF_Glob{ - Glob: "*.yaml", - }, - }, - } - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - ctrl := gomock.NewController(t) - client := mock_rpc.NewMockGitopsClient(ctrl) - stream1 := mock_rpc.NewMockGitops_GetObjectsToSynchronizeClient(ctrl) - stream2 := mock_rpc.NewMockGitops_GetObjectsToSynchronizeClient(ctrl) - req := &rpc.ObjectsToSynchronizeRequest{ - ProjectId: projectId, - Paths: pathsCfg, - } - gomock.InOrder( - client.EXPECT(). - GetObjectsToSynchronize(gomock.Any(), matcher.ProtoEq(t, req), gomock.Any()). - Return(stream1, nil), - stream1.EXPECT(). - RecvMsg(gomock.Any()). - Do(testhelpers.RecvMsg(&rpc.ObjectsToSynchronizeResponse{ - Message: &rpc.ObjectsToSynchronizeResponse_Header_{ - Header: &rpc.ObjectsToSynchronizeResponse_Header{ - CommitId: revision, - }, - }, - })), - stream1.EXPECT(). - RecvMsg(gomock.Any()). - Do(testhelpers.RecvMsg(&rpc.ObjectsToSynchronizeResponse{ - Message: &rpc.ObjectsToSynchronizeResponse_Trailer_{ - Trailer: &rpc.ObjectsToSynchronizeResponse_Trailer{}, - }, - })), - stream1.EXPECT(). - RecvMsg(gomock.Any()). - Return(io.EOF), - client.EXPECT(). - GetObjectsToSynchronize(gomock.Any(), matcher.ProtoEq(t, &rpc.ObjectsToSynchronizeRequest{ - ProjectId: projectId, - CommitId: revision, - Paths: pathsCfg, - }), gomock.Any()). - Return(stream2, nil), - stream2.EXPECT(). - RecvMsg(gomock.Any()). - DoAndReturn(func(msg interface{}) error { - cancel() - return io.EOF - }), - ) - w := rpc.ObjectsToSynchronizeWatcher{ - Log: zaptest.NewLogger(t), - GitopsClient: client, - PollConfig: retry.NewPollConfigFactory(0, retry.NewExponentialBackoffFactory(10*time.Millisecond, time.Minute, time.Minute, 2, 1)), - } - w.Watch(ctx, req, func(ctx context.Context, data rpc.ObjectsToSynchronizeData) { - // Don't care - }) -} - -func TestObjectsToSynchronizeWatcherInvalidStream(t *testing.T) { - tests := []struct { - name string - stream []*rpc.ObjectsToSynchronizeResponse - eof bool - }{ - { - name: "empty stream", // Not invalid, but should not call callback - eof: true, - }, - { - name: "missing header", - stream: []*rpc.ObjectsToSynchronizeResponse{ - { - Message: &rpc.ObjectsToSynchronizeResponse_Trailer_{ - Trailer: &rpc.ObjectsToSynchronizeResponse_Trailer{}, - }, - }, - }, - }, - { - name: "unexpected header", - stream: []*rpc.ObjectsToSynchronizeResponse{ - { - Message: &rpc.ObjectsToSynchronizeResponse_Header_{ - Header: &rpc.ObjectsToSynchronizeResponse_Header{ - CommitId: revision, - }, - }, - }, - { - Message: &rpc.ObjectsToSynchronizeResponse_Header_{ - Header: &rpc.ObjectsToSynchronizeResponse_Header{ - CommitId: revision, - }, - }, - }, - }, - }, - { - name: "missing trailer", - stream: []*rpc.ObjectsToSynchronizeResponse{ - { - Message: &rpc.ObjectsToSynchronizeResponse_Header_{ - Header: &rpc.ObjectsToSynchronizeResponse_Header{ - CommitId: revision, - }, - }, - }, - }, - eof: true, - }, - { - name: "trailer then header", - stream: []*rpc.ObjectsToSynchronizeResponse{ - { - Message: &rpc.ObjectsToSynchronizeResponse_Trailer_{ - Trailer: &rpc.ObjectsToSynchronizeResponse_Trailer{}, - }, - }, - }, - }, - } - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - ctrl := gomock.NewController(t) - client := mock_rpc.NewMockGitopsClient(ctrl) - stream1 := mock_rpc.NewMockGitops_GetObjectsToSynchronizeClient(ctrl) - req := &rpc.ObjectsToSynchronizeRequest{ - ProjectId: projectId, - Paths: []*rpc.PathCF{ - { - Path: &rpc.PathCF_Glob{ - Glob: "*.yaml", - }, - }, - }, - } - calls := []any{ - client.EXPECT(). - GetObjectsToSynchronize(gomock.Any(), matcher.ProtoEq(t, req), gomock.Any()). - Return(stream1, nil), - } - if tc.eof { - for _, streamItem := range tc.stream { - calls = append(calls, stream1.EXPECT(). - RecvMsg(gomock.Any()). - Do(testhelpers.RecvMsg(streamItem)), - ) - } - calls = append(calls, stream1.EXPECT(). - RecvMsg(gomock.Any()). - DoAndReturn(func(msg interface{}) error { - cancel() - return io.EOF - })) - } else { - for i := 0; i < len(tc.stream)-1; i++ { - streamItem := tc.stream[i] - calls = append(calls, stream1.EXPECT(). - RecvMsg(gomock.Any()). - Do(testhelpers.RecvMsg(streamItem)), - ) - } - calls = append(calls, stream1.EXPECT().RecvMsg(gomock.Any()).Do(func(msg any) error { - testhelpers.SetValue(msg, tc.stream[len(tc.stream)-1]) - cancel() - return nil - })) - } - calls = append(calls, stream1.EXPECT().Header().MaxTimes(1)) // exact number not important for this test - gomock.InOrder(calls...) - w := rpc.ObjectsToSynchronizeWatcher{ - Log: zaptest.NewLogger(t), - GitopsClient: client, - PollConfig: retry.NewPollConfigFactory(0, retry.NewExponentialBackoffFactory(10*time.Millisecond, time.Minute, time.Minute, 2, 1)), - } - w.Watch(ctx, req, func(ctx context.Context, data rpc.ObjectsToSynchronizeData) { - // Must not be called - t.FailNow() - }) - }) - } -} diff --git a/internal/module/gitops/rpc/rpc.pb.go b/internal/module/gitops/rpc/rpc.pb.go deleted file mode 100644 index d1a025df..00000000 --- a/internal/module/gitops/rpc/rpc.pb.go +++ /dev/null @@ -1,766 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc v3.21.7 -// source: internal/module/gitops/rpc/rpc.proto - -package rpc - -import ( - reflect "reflect" - sync "sync" - - _ "github.com/envoyproxy/protoc-gen-validate/validate" - _ "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/grpctool/automata" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -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 GitRefCF struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Ref: - // - // *GitRefCF_Tag - // *GitRefCF_Branch - // *GitRefCF_Commit - Ref isGitRefCF_Ref `protobuf_oneof:"ref"` -} - -func (x *GitRefCF) Reset() { - *x = GitRefCF{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_module_gitops_rpc_rpc_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GitRefCF) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GitRefCF) ProtoMessage() {} - -func (x *GitRefCF) ProtoReflect() protoreflect.Message { - mi := &file_internal_module_gitops_rpc_rpc_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 GitRefCF.ProtoReflect.Descriptor instead. -func (*GitRefCF) Descriptor() ([]byte, []int) { - return file_internal_module_gitops_rpc_rpc_proto_rawDescGZIP(), []int{0} -} - -func (m *GitRefCF) GetRef() isGitRefCF_Ref { - if m != nil { - return m.Ref - } - return nil -} - -func (x *GitRefCF) GetTag() string { - if x, ok := x.GetRef().(*GitRefCF_Tag); ok { - return x.Tag - } - return "" -} - -func (x *GitRefCF) GetBranch() string { - if x, ok := x.GetRef().(*GitRefCF_Branch); ok { - return x.Branch - } - return "" -} - -func (x *GitRefCF) GetCommit() string { - if x, ok := x.GetRef().(*GitRefCF_Commit); ok { - return x.Commit - } - return "" -} - -type isGitRefCF_Ref interface { - isGitRefCF_Ref() -} - -type GitRefCF_Tag struct { - Tag string `protobuf:"bytes,1,opt,name=tag,proto3,oneof"` -} - -type GitRefCF_Branch struct { - Branch string `protobuf:"bytes,2,opt,name=branch,proto3,oneof"` -} - -type GitRefCF_Commit struct { - Commit string `protobuf:"bytes,3,opt,name=commit,proto3,oneof"` -} - -func (*GitRefCF_Tag) isGitRefCF_Ref() {} - -func (*GitRefCF_Branch) isGitRefCF_Ref() {} - -func (*GitRefCF_Commit) isGitRefCF_Ref() {} - -type PathCF struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Path: - // - // *PathCF_Glob - // *PathCF_File - Path isPathCF_Path `protobuf_oneof:"path"` -} - -func (x *PathCF) Reset() { - *x = PathCF{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_module_gitops_rpc_rpc_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PathCF) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PathCF) ProtoMessage() {} - -func (x *PathCF) ProtoReflect() protoreflect.Message { - mi := &file_internal_module_gitops_rpc_rpc_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 PathCF.ProtoReflect.Descriptor instead. -func (*PathCF) Descriptor() ([]byte, []int) { - return file_internal_module_gitops_rpc_rpc_proto_rawDescGZIP(), []int{1} -} - -func (m *PathCF) GetPath() isPathCF_Path { - if m != nil { - return m.Path - } - return nil -} - -func (x *PathCF) GetGlob() string { - if x, ok := x.GetPath().(*PathCF_Glob); ok { - return x.Glob - } - return "" -} - -func (x *PathCF) GetFile() string { - if x, ok := x.GetPath().(*PathCF_File); ok { - return x.File - } - return "" -} - -type isPathCF_Path interface { - isPathCF_Path() -} - -type PathCF_Glob struct { - Glob string `protobuf:"bytes,1,opt,name=glob,proto3,oneof"` -} - -type PathCF_File struct { - File string `protobuf:"bytes,2,opt,name=file,proto3,oneof"` -} - -func (*PathCF_Glob) isPathCF_Path() {} - -func (*PathCF_File) isPathCF_Path() {} - -type ObjectsToSynchronizeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` - Ref *GitRefCF `protobuf:"bytes,4,opt,name=ref,proto3" json:"ref,omitempty"` - CommitId string `protobuf:"bytes,2,opt,name=commit_id,json=commitId,proto3" json:"commit_id,omitempty"` - Paths []*PathCF `protobuf:"bytes,3,rep,name=paths,proto3" json:"paths,omitempty"` -} - -func (x *ObjectsToSynchronizeRequest) Reset() { - *x = ObjectsToSynchronizeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_module_gitops_rpc_rpc_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ObjectsToSynchronizeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ObjectsToSynchronizeRequest) ProtoMessage() {} - -func (x *ObjectsToSynchronizeRequest) ProtoReflect() protoreflect.Message { - mi := &file_internal_module_gitops_rpc_rpc_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 ObjectsToSynchronizeRequest.ProtoReflect.Descriptor instead. -func (*ObjectsToSynchronizeRequest) Descriptor() ([]byte, []int) { - return file_internal_module_gitops_rpc_rpc_proto_rawDescGZIP(), []int{2} -} - -func (x *ObjectsToSynchronizeRequest) GetProjectId() string { - if x != nil { - return x.ProjectId - } - return "" -} - -func (x *ObjectsToSynchronizeRequest) GetRef() *GitRefCF { - if x != nil { - return x.Ref - } - return nil -} - -func (x *ObjectsToSynchronizeRequest) GetCommitId() string { - if x != nil { - return x.CommitId - } - return "" -} - -func (x *ObjectsToSynchronizeRequest) GetPaths() []*PathCF { - if x != nil { - return x.Paths - } - return nil -} - -type ObjectsToSynchronizeResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Message: - // - // *ObjectsToSynchronizeResponse_Header_ - // *ObjectsToSynchronizeResponse_Object_ - // *ObjectsToSynchronizeResponse_Trailer_ - Message isObjectsToSynchronizeResponse_Message `protobuf_oneof:"message"` -} - -func (x *ObjectsToSynchronizeResponse) Reset() { - *x = ObjectsToSynchronizeResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_module_gitops_rpc_rpc_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ObjectsToSynchronizeResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ObjectsToSynchronizeResponse) ProtoMessage() {} - -func (x *ObjectsToSynchronizeResponse) ProtoReflect() protoreflect.Message { - mi := &file_internal_module_gitops_rpc_rpc_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 ObjectsToSynchronizeResponse.ProtoReflect.Descriptor instead. -func (*ObjectsToSynchronizeResponse) Descriptor() ([]byte, []int) { - return file_internal_module_gitops_rpc_rpc_proto_rawDescGZIP(), []int{3} -} - -func (m *ObjectsToSynchronizeResponse) GetMessage() isObjectsToSynchronizeResponse_Message { - if m != nil { - return m.Message - } - return nil -} - -func (x *ObjectsToSynchronizeResponse) GetHeader() *ObjectsToSynchronizeResponse_Header { - if x, ok := x.GetMessage().(*ObjectsToSynchronizeResponse_Header_); ok { - return x.Header - } - return nil -} - -func (x *ObjectsToSynchronizeResponse) GetObject() *ObjectsToSynchronizeResponse_Object { - if x, ok := x.GetMessage().(*ObjectsToSynchronizeResponse_Object_); ok { - return x.Object - } - return nil -} - -func (x *ObjectsToSynchronizeResponse) GetTrailer() *ObjectsToSynchronizeResponse_Trailer { - if x, ok := x.GetMessage().(*ObjectsToSynchronizeResponse_Trailer_); ok { - return x.Trailer - } - return nil -} - -type isObjectsToSynchronizeResponse_Message interface { - isObjectsToSynchronizeResponse_Message() -} - -type ObjectsToSynchronizeResponse_Header_ struct { - Header *ObjectsToSynchronizeResponse_Header `protobuf:"bytes,1,opt,name=header,proto3,oneof"` -} - -type ObjectsToSynchronizeResponse_Object_ struct { - Object *ObjectsToSynchronizeResponse_Object `protobuf:"bytes,2,opt,name=object,proto3,oneof"` -} - -type ObjectsToSynchronizeResponse_Trailer_ struct { - Trailer *ObjectsToSynchronizeResponse_Trailer `protobuf:"bytes,3,opt,name=trailer,proto3,oneof"` -} - -func (*ObjectsToSynchronizeResponse_Header_) isObjectsToSynchronizeResponse_Message() {} - -func (*ObjectsToSynchronizeResponse_Object_) isObjectsToSynchronizeResponse_Message() {} - -func (*ObjectsToSynchronizeResponse_Trailer_) isObjectsToSynchronizeResponse_Message() {} - -type ObjectsToSynchronizeResponse_Header struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - CommitId string `protobuf:"bytes,1,opt,name=commit_id,json=commitId,proto3" json:"commit_id,omitempty"` - ProjectId int64 `protobuf:"varint,2,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` -} - -func (x *ObjectsToSynchronizeResponse_Header) Reset() { - *x = ObjectsToSynchronizeResponse_Header{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_module_gitops_rpc_rpc_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ObjectsToSynchronizeResponse_Header) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ObjectsToSynchronizeResponse_Header) ProtoMessage() {} - -func (x *ObjectsToSynchronizeResponse_Header) ProtoReflect() protoreflect.Message { - mi := &file_internal_module_gitops_rpc_rpc_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 ObjectsToSynchronizeResponse_Header.ProtoReflect.Descriptor instead. -func (*ObjectsToSynchronizeResponse_Header) Descriptor() ([]byte, []int) { - return file_internal_module_gitops_rpc_rpc_proto_rawDescGZIP(), []int{3, 0} -} - -func (x *ObjectsToSynchronizeResponse_Header) GetCommitId() string { - if x != nil { - return x.CommitId - } - return "" -} - -func (x *ObjectsToSynchronizeResponse_Header) GetProjectId() int64 { - if x != nil { - return x.ProjectId - } - return 0 -} - -type ObjectsToSynchronizeResponse_Object struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Source string `protobuf:"bytes,1,opt,name=source,proto3" json:"source,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` -} - -func (x *ObjectsToSynchronizeResponse_Object) Reset() { - *x = ObjectsToSynchronizeResponse_Object{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_module_gitops_rpc_rpc_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ObjectsToSynchronizeResponse_Object) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ObjectsToSynchronizeResponse_Object) ProtoMessage() {} - -func (x *ObjectsToSynchronizeResponse_Object) ProtoReflect() protoreflect.Message { - mi := &file_internal_module_gitops_rpc_rpc_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 ObjectsToSynchronizeResponse_Object.ProtoReflect.Descriptor instead. -func (*ObjectsToSynchronizeResponse_Object) Descriptor() ([]byte, []int) { - return file_internal_module_gitops_rpc_rpc_proto_rawDescGZIP(), []int{3, 1} -} - -func (x *ObjectsToSynchronizeResponse_Object) GetSource() string { - if x != nil { - return x.Source - } - return "" -} - -func (x *ObjectsToSynchronizeResponse_Object) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -type ObjectsToSynchronizeResponse_Trailer struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *ObjectsToSynchronizeResponse_Trailer) Reset() { - *x = ObjectsToSynchronizeResponse_Trailer{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_module_gitops_rpc_rpc_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ObjectsToSynchronizeResponse_Trailer) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ObjectsToSynchronizeResponse_Trailer) ProtoMessage() {} - -func (x *ObjectsToSynchronizeResponse_Trailer) ProtoReflect() protoreflect.Message { - mi := &file_internal_module_gitops_rpc_rpc_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 ObjectsToSynchronizeResponse_Trailer.ProtoReflect.Descriptor instead. -func (*ObjectsToSynchronizeResponse_Trailer) Descriptor() ([]byte, []int) { - return file_internal_module_gitops_rpc_rpc_proto_rawDescGZIP(), []int{3, 2} -} - -var File_internal_module_gitops_rpc_rpc_proto protoreflect.FileDescriptor - -var file_internal_module_gitops_rpc_rpc_proto_rawDesc = []byte{ - 0x0a, 0x24, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x2f, 0x67, 0x69, 0x74, 0x6f, 0x70, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x72, 0x70, 0x63, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x17, 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2e, 0x61, - 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x67, 0x69, 0x74, 0x6f, 0x70, 0x73, 0x2e, 0x72, 0x70, 0x63, 0x1a, - 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x6f, 0x6f, 0x6c, 0x2f, 0x67, - 0x72, 0x70, 0x63, 0x74, 0x6f, 0x6f, 0x6c, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x61, - 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x79, 0x0a, 0x08, 0x47, 0x69, 0x74, 0x52, - 0x65, 0x66, 0x43, 0x46, 0x12, 0x1b, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x48, 0x00, 0x52, 0x03, 0x74, 0x61, - 0x67, 0x12, 0x21, 0x0a, 0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x48, 0x00, 0x52, 0x06, 0x62, 0x72, - 0x61, 0x6e, 0x63, 0x68, 0x12, 0x21, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x48, 0x00, 0x52, - 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x42, 0x0a, 0x0a, 0x03, 0x72, 0x65, 0x66, 0x12, 0x03, - 0xf8, 0x42, 0x01, 0x22, 0x53, 0x0a, 0x06, 0x50, 0x61, 0x74, 0x68, 0x43, 0x46, 0x12, 0x1d, 0x0a, - 0x04, 0x67, 0x6c, 0x6f, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, - 0x72, 0x02, 0x20, 0x01, 0x48, 0x00, 0x52, 0x04, 0x67, 0x6c, 0x6f, 0x62, 0x12, 0x1d, 0x0a, 0x04, - 0x66, 0x69, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, - 0x02, 0x20, 0x01, 0x48, 0x00, 0x52, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x42, 0x0b, 0x0a, 0x04, 0x70, - 0x61, 0x74, 0x68, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0xd8, 0x01, 0x0a, 0x1b, 0x4f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x73, 0x54, 0x6f, 0x53, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x69, 0x7a, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, - 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, - 0x12, 0x33, 0x0a, 0x03, 0x72, 0x65, 0x66, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, - 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x67, 0x69, 0x74, - 0x6f, 0x70, 0x73, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x69, 0x74, 0x52, 0x65, 0x66, 0x43, 0x46, - 0x52, 0x03, 0x72, 0x65, 0x66, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x49, 0x64, 0x12, 0x3f, 0x0a, 0x05, 0x70, 0x61, 0x74, 0x68, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, - 0x2e, 0x67, 0x69, 0x74, 0x6f, 0x70, 0x73, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x50, 0x61, 0x74, 0x68, - 0x43, 0x46, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x08, 0x01, 0x52, 0x05, 0x70, 0x61, - 0x74, 0x68, 0x73, 0x22, 0x9e, 0x04, 0x0a, 0x1c, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x54, - 0x6f, 0x53, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x68, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2e, 0x61, 0x67, - 0x65, 0x6e, 0x74, 0x2e, 0x67, 0x69, 0x74, 0x6f, 0x70, 0x73, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x54, 0x6f, 0x53, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, - 0x69, 0x7a, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x48, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x42, 0x10, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x80, 0xf6, 0x2c, 0x02, - 0x80, 0xf6, 0x2c, 0x03, 0x48, 0x00, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x68, - 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3c, - 0x2e, 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x67, 0x69, - 0x74, 0x6f, 0x70, 0x73, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, - 0x54, 0x6f, 0x53, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x42, 0x10, 0xfa, 0x42, - 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x80, 0xf6, 0x2c, 0x02, 0x80, 0xf6, 0x2c, 0x03, 0x48, 0x00, - 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x70, 0x0a, 0x07, 0x74, 0x72, 0x61, 0x69, - 0x6c, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x67, 0x69, 0x74, 0x6c, - 0x61, 0x62, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x67, 0x69, 0x74, 0x6f, 0x70, 0x73, 0x2e, - 0x72, 0x70, 0x63, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x54, 0x6f, 0x53, 0x79, 0x6e, - 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x2e, 0x54, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x42, 0x15, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, - 0x10, 0x01, 0x80, 0xf6, 0x2c, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x48, - 0x00, 0x52, 0x07, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x1a, 0x4d, 0x0a, 0x06, 0x48, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, - 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, - 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x1a, 0x3d, 0x0a, 0x06, 0x4f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x12, 0x1f, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x20, 0x01, 0x52, 0x06, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x09, 0x0a, 0x07, 0x54, 0x72, 0x61, 0x69, - 0x6c, 0x65, 0x72, 0x42, 0x1f, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x14, - 0xf8, 0x42, 0x01, 0x88, 0xf6, 0x2c, 0x01, 0x88, 0xf6, 0x2c, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0x01, 0x32, 0x95, 0x01, 0x0a, 0x06, 0x47, 0x69, 0x74, 0x6f, 0x70, 0x73, 0x12, - 0x8a, 0x01, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x54, 0x6f, - 0x53, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x69, 0x7a, 0x65, 0x12, 0x34, 0x2e, 0x67, 0x69, - 0x74, 0x6c, 0x61, 0x62, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x67, 0x69, 0x74, 0x6f, 0x70, - 0x73, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x54, 0x6f, 0x53, - 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x35, 0x2e, 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, - 0x2e, 0x67, 0x69, 0x74, 0x6f, 0x70, 0x73, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x73, 0x54, 0x6f, 0x53, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x69, 0x7a, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x42, 0x57, 0x5a, 0x55, - 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x69, 0x74, 0x6c, 0x61, - 0x62, 0x2d, 0x6f, 0x72, 0x67, 0x2f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2d, 0x69, 0x6e, - 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, - 0x2d, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x36, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x6e, 0x61, 0x6c, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x67, 0x69, 0x74, 0x6f, 0x70, - 0x73, 0x2f, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_internal_module_gitops_rpc_rpc_proto_rawDescOnce sync.Once - file_internal_module_gitops_rpc_rpc_proto_rawDescData = file_internal_module_gitops_rpc_rpc_proto_rawDesc -) - -func file_internal_module_gitops_rpc_rpc_proto_rawDescGZIP() []byte { - file_internal_module_gitops_rpc_rpc_proto_rawDescOnce.Do(func() { - file_internal_module_gitops_rpc_rpc_proto_rawDescData = protoimpl.X.CompressGZIP(file_internal_module_gitops_rpc_rpc_proto_rawDescData) - }) - return file_internal_module_gitops_rpc_rpc_proto_rawDescData -} - -var file_internal_module_gitops_rpc_rpc_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_internal_module_gitops_rpc_rpc_proto_goTypes = []interface{}{ - (*GitRefCF)(nil), // 0: gitlab.agent.gitops.rpc.GitRefCF - (*PathCF)(nil), // 1: gitlab.agent.gitops.rpc.PathCF - (*ObjectsToSynchronizeRequest)(nil), // 2: gitlab.agent.gitops.rpc.ObjectsToSynchronizeRequest - (*ObjectsToSynchronizeResponse)(nil), // 3: gitlab.agent.gitops.rpc.ObjectsToSynchronizeResponse - (*ObjectsToSynchronizeResponse_Header)(nil), // 4: gitlab.agent.gitops.rpc.ObjectsToSynchronizeResponse.Header - (*ObjectsToSynchronizeResponse_Object)(nil), // 5: gitlab.agent.gitops.rpc.ObjectsToSynchronizeResponse.Object - (*ObjectsToSynchronizeResponse_Trailer)(nil), // 6: gitlab.agent.gitops.rpc.ObjectsToSynchronizeResponse.Trailer -} -var file_internal_module_gitops_rpc_rpc_proto_depIdxs = []int32{ - 0, // 0: gitlab.agent.gitops.rpc.ObjectsToSynchronizeRequest.ref:type_name -> gitlab.agent.gitops.rpc.GitRefCF - 1, // 1: gitlab.agent.gitops.rpc.ObjectsToSynchronizeRequest.paths:type_name -> gitlab.agent.gitops.rpc.PathCF - 4, // 2: gitlab.agent.gitops.rpc.ObjectsToSynchronizeResponse.header:type_name -> gitlab.agent.gitops.rpc.ObjectsToSynchronizeResponse.Header - 5, // 3: gitlab.agent.gitops.rpc.ObjectsToSynchronizeResponse.object:type_name -> gitlab.agent.gitops.rpc.ObjectsToSynchronizeResponse.Object - 6, // 4: gitlab.agent.gitops.rpc.ObjectsToSynchronizeResponse.trailer:type_name -> gitlab.agent.gitops.rpc.ObjectsToSynchronizeResponse.Trailer - 2, // 5: gitlab.agent.gitops.rpc.Gitops.GetObjectsToSynchronize:input_type -> gitlab.agent.gitops.rpc.ObjectsToSynchronizeRequest - 3, // 6: gitlab.agent.gitops.rpc.Gitops.GetObjectsToSynchronize:output_type -> gitlab.agent.gitops.rpc.ObjectsToSynchronizeResponse - 6, // [6:7] is the sub-list for method output_type - 5, // [5:6] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name -} - -func init() { file_internal_module_gitops_rpc_rpc_proto_init() } -func file_internal_module_gitops_rpc_rpc_proto_init() { - if File_internal_module_gitops_rpc_rpc_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_internal_module_gitops_rpc_rpc_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GitRefCF); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_module_gitops_rpc_rpc_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PathCF); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_module_gitops_rpc_rpc_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ObjectsToSynchronizeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_module_gitops_rpc_rpc_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ObjectsToSynchronizeResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_module_gitops_rpc_rpc_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ObjectsToSynchronizeResponse_Header); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_module_gitops_rpc_rpc_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ObjectsToSynchronizeResponse_Object); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_module_gitops_rpc_rpc_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ObjectsToSynchronizeResponse_Trailer); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_internal_module_gitops_rpc_rpc_proto_msgTypes[0].OneofWrappers = []interface{}{ - (*GitRefCF_Tag)(nil), - (*GitRefCF_Branch)(nil), - (*GitRefCF_Commit)(nil), - } - file_internal_module_gitops_rpc_rpc_proto_msgTypes[1].OneofWrappers = []interface{}{ - (*PathCF_Glob)(nil), - (*PathCF_File)(nil), - } - file_internal_module_gitops_rpc_rpc_proto_msgTypes[3].OneofWrappers = []interface{}{ - (*ObjectsToSynchronizeResponse_Header_)(nil), - (*ObjectsToSynchronizeResponse_Object_)(nil), - (*ObjectsToSynchronizeResponse_Trailer_)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_internal_module_gitops_rpc_rpc_proto_rawDesc, - NumEnums: 0, - NumMessages: 7, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_internal_module_gitops_rpc_rpc_proto_goTypes, - DependencyIndexes: file_internal_module_gitops_rpc_rpc_proto_depIdxs, - MessageInfos: file_internal_module_gitops_rpc_rpc_proto_msgTypes, - }.Build() - File_internal_module_gitops_rpc_rpc_proto = out.File - file_internal_module_gitops_rpc_rpc_proto_rawDesc = nil - file_internal_module_gitops_rpc_rpc_proto_goTypes = nil - file_internal_module_gitops_rpc_rpc_proto_depIdxs = nil -} diff --git a/internal/module/gitops/rpc/rpc.pb.validate.go b/internal/module/gitops/rpc/rpc.pb.validate.go deleted file mode 100644 index 7fd43cb2..00000000 --- a/internal/module/gitops/rpc/rpc.pb.validate.go +++ /dev/null @@ -1,1194 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: internal/module/gitops/rpc/rpc.proto - -package rpc - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on GitRefCF with the rules defined in the -// proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *GitRefCF) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GitRefCF with the rules defined in -// the proto definition for this message. If any rules are violated, the -// result is a list of violation errors wrapped in GitRefCFMultiError, or nil -// if none found. -func (m *GitRefCF) ValidateAll() error { - return m.validate(true) -} - -func (m *GitRefCF) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - oneofRefPresent := false - switch v := m.Ref.(type) { - case *GitRefCF_Tag: - if v == nil { - err := GitRefCFValidationError{ - field: "Ref", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - oneofRefPresent = true - - if len(m.GetTag()) < 1 { - err := GitRefCFValidationError{ - field: "Tag", - reason: "value length must be at least 1 bytes", - } - if !all { - return err - } - errors = append(errors, err) - } - - case *GitRefCF_Branch: - if v == nil { - err := GitRefCFValidationError{ - field: "Ref", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - oneofRefPresent = true - - if len(m.GetBranch()) < 1 { - err := GitRefCFValidationError{ - field: "Branch", - reason: "value length must be at least 1 bytes", - } - if !all { - return err - } - errors = append(errors, err) - } - - case *GitRefCF_Commit: - if v == nil { - err := GitRefCFValidationError{ - field: "Ref", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - oneofRefPresent = true - - if len(m.GetCommit()) < 1 { - err := GitRefCFValidationError{ - field: "Commit", - reason: "value length must be at least 1 bytes", - } - if !all { - return err - } - errors = append(errors, err) - } - - default: - _ = v // ensures v is used - } - if !oneofRefPresent { - err := GitRefCFValidationError{ - field: "Ref", - reason: "value is required", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return GitRefCFMultiError(errors) - } - - return nil -} - -// GitRefCFMultiError is an error wrapping multiple validation errors returned -// by GitRefCF.ValidateAll() if the designated constraints aren't met. -type GitRefCFMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GitRefCFMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m GitRefCFMultiError) AllErrors() []error { return m } - -// GitRefCFValidationError is the validation error returned by -// GitRefCF.Validate if the designated constraints aren't met. -type GitRefCFValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GitRefCFValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GitRefCFValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GitRefCFValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GitRefCFValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GitRefCFValidationError) ErrorName() string { return "GitRefCFValidationError" } - -// Error satisfies the builtin error interface -func (e GitRefCFValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sGitRefCF.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GitRefCFValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GitRefCFValidationError{} - -// Validate checks the field values on PathCF with the rules defined in the -// proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *PathCF) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on PathCF with the rules defined in the -// proto definition for this message. If any rules are violated, the result is -// a list of violation errors wrapped in PathCFMultiError, or nil if none found. -func (m *PathCF) ValidateAll() error { - return m.validate(true) -} - -func (m *PathCF) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - oneofPathPresent := false - switch v := m.Path.(type) { - case *PathCF_Glob: - if v == nil { - err := PathCFValidationError{ - field: "Path", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - oneofPathPresent = true - - if len(m.GetGlob()) < 1 { - err := PathCFValidationError{ - field: "Glob", - reason: "value length must be at least 1 bytes", - } - if !all { - return err - } - errors = append(errors, err) - } - - case *PathCF_File: - if v == nil { - err := PathCFValidationError{ - field: "Path", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - oneofPathPresent = true - - if len(m.GetFile()) < 1 { - err := PathCFValidationError{ - field: "File", - reason: "value length must be at least 1 bytes", - } - if !all { - return err - } - errors = append(errors, err) - } - - default: - _ = v // ensures v is used - } - if !oneofPathPresent { - err := PathCFValidationError{ - field: "Path", - reason: "value is required", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return PathCFMultiError(errors) - } - - return nil -} - -// PathCFMultiError is an error wrapping multiple validation errors returned by -// PathCF.ValidateAll() if the designated constraints aren't met. -type PathCFMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m PathCFMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m PathCFMultiError) AllErrors() []error { return m } - -// PathCFValidationError is the validation error returned by PathCF.Validate if -// the designated constraints aren't met. -type PathCFValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e PathCFValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e PathCFValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e PathCFValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e PathCFValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e PathCFValidationError) ErrorName() string { return "PathCFValidationError" } - -// Error satisfies the builtin error interface -func (e PathCFValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sPathCF.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = PathCFValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = PathCFValidationError{} - -// Validate checks the field values on ObjectsToSynchronizeRequest with the -// rules defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *ObjectsToSynchronizeRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ObjectsToSynchronizeRequest with the -// rules defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ObjectsToSynchronizeRequestMultiError, or nil if none found. -func (m *ObjectsToSynchronizeRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ObjectsToSynchronizeRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(m.GetProjectId()) < 1 { - err := ObjectsToSynchronizeRequestValidationError{ - field: "ProjectId", - reason: "value length must be at least 1 bytes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetRef()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ObjectsToSynchronizeRequestValidationError{ - field: "Ref", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ObjectsToSynchronizeRequestValidationError{ - field: "Ref", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetRef()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ObjectsToSynchronizeRequestValidationError{ - field: "Ref", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for CommitId - - if len(m.GetPaths()) < 1 { - err := ObjectsToSynchronizeRequestValidationError{ - field: "Paths", - reason: "value must contain at least 1 item(s)", - } - if !all { - return err - } - errors = append(errors, err) - } - - for idx, item := range m.GetPaths() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ObjectsToSynchronizeRequestValidationError{ - field: fmt.Sprintf("Paths[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ObjectsToSynchronizeRequestValidationError{ - field: fmt.Sprintf("Paths[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ObjectsToSynchronizeRequestValidationError{ - field: fmt.Sprintf("Paths[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return ObjectsToSynchronizeRequestMultiError(errors) - } - - return nil -} - -// ObjectsToSynchronizeRequestMultiError is an error wrapping multiple -// validation errors returned by ObjectsToSynchronizeRequest.ValidateAll() if -// the designated constraints aren't met. -type ObjectsToSynchronizeRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ObjectsToSynchronizeRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ObjectsToSynchronizeRequestMultiError) AllErrors() []error { return m } - -// ObjectsToSynchronizeRequestValidationError is the validation error returned -// by ObjectsToSynchronizeRequest.Validate if the designated constraints -// aren't met. -type ObjectsToSynchronizeRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ObjectsToSynchronizeRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ObjectsToSynchronizeRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ObjectsToSynchronizeRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ObjectsToSynchronizeRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ObjectsToSynchronizeRequestValidationError) ErrorName() string { - return "ObjectsToSynchronizeRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ObjectsToSynchronizeRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sObjectsToSynchronizeRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ObjectsToSynchronizeRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ObjectsToSynchronizeRequestValidationError{} - -// Validate checks the field values on ObjectsToSynchronizeResponse with the -// rules defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *ObjectsToSynchronizeResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ObjectsToSynchronizeResponse with the -// rules defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ObjectsToSynchronizeResponseMultiError, or nil if none found. -func (m *ObjectsToSynchronizeResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ObjectsToSynchronizeResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - oneofMessagePresent := false - switch v := m.Message.(type) { - case *ObjectsToSynchronizeResponse_Header_: - if v == nil { - err := ObjectsToSynchronizeResponseValidationError{ - field: "Message", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - oneofMessagePresent = true - - if m.GetHeader() == nil { - err := ObjectsToSynchronizeResponseValidationError{ - field: "Header", - reason: "value is required", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetHeader()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ObjectsToSynchronizeResponseValidationError{ - field: "Header", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ObjectsToSynchronizeResponseValidationError{ - field: "Header", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetHeader()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ObjectsToSynchronizeResponseValidationError{ - field: "Header", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ObjectsToSynchronizeResponse_Object_: - if v == nil { - err := ObjectsToSynchronizeResponseValidationError{ - field: "Message", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - oneofMessagePresent = true - - if m.GetObject() == nil { - err := ObjectsToSynchronizeResponseValidationError{ - field: "Object", - reason: "value is required", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetObject()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ObjectsToSynchronizeResponseValidationError{ - field: "Object", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ObjectsToSynchronizeResponseValidationError{ - field: "Object", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetObject()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ObjectsToSynchronizeResponseValidationError{ - field: "Object", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *ObjectsToSynchronizeResponse_Trailer_: - if v == nil { - err := ObjectsToSynchronizeResponseValidationError{ - field: "Message", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - oneofMessagePresent = true - - if m.GetTrailer() == nil { - err := ObjectsToSynchronizeResponseValidationError{ - field: "Trailer", - reason: "value is required", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetTrailer()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ObjectsToSynchronizeResponseValidationError{ - field: "Trailer", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ObjectsToSynchronizeResponseValidationError{ - field: "Trailer", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTrailer()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ObjectsToSynchronizeResponseValidationError{ - field: "Trailer", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used - } - if !oneofMessagePresent { - err := ObjectsToSynchronizeResponseValidationError{ - field: "Message", - reason: "value is required", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return ObjectsToSynchronizeResponseMultiError(errors) - } - - return nil -} - -// ObjectsToSynchronizeResponseMultiError is an error wrapping multiple -// validation errors returned by ObjectsToSynchronizeResponse.ValidateAll() if -// the designated constraints aren't met. -type ObjectsToSynchronizeResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ObjectsToSynchronizeResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ObjectsToSynchronizeResponseMultiError) AllErrors() []error { return m } - -// ObjectsToSynchronizeResponseValidationError is the validation error returned -// by ObjectsToSynchronizeResponse.Validate if the designated constraints -// aren't met. -type ObjectsToSynchronizeResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ObjectsToSynchronizeResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ObjectsToSynchronizeResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ObjectsToSynchronizeResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ObjectsToSynchronizeResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ObjectsToSynchronizeResponseValidationError) ErrorName() string { - return "ObjectsToSynchronizeResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ObjectsToSynchronizeResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sObjectsToSynchronizeResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ObjectsToSynchronizeResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ObjectsToSynchronizeResponseValidationError{} - -// Validate checks the field values on ObjectsToSynchronizeResponse_Header with -// the rules defined in the proto definition for this message. If any rules -// are violated, the first error encountered is returned, or nil if there are -// no violations. -func (m *ObjectsToSynchronizeResponse_Header) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ObjectsToSynchronizeResponse_Header -// with the rules defined in the proto definition for this message. If any -// rules are violated, the result is a list of violation errors wrapped in -// ObjectsToSynchronizeResponse_HeaderMultiError, or nil if none found. -func (m *ObjectsToSynchronizeResponse_Header) ValidateAll() error { - return m.validate(true) -} - -func (m *ObjectsToSynchronizeResponse_Header) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(m.GetCommitId()) < 1 { - err := ObjectsToSynchronizeResponse_HeaderValidationError{ - field: "CommitId", - reason: "value length must be at least 1 bytes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for ProjectId - - if len(errors) > 0 { - return ObjectsToSynchronizeResponse_HeaderMultiError(errors) - } - - return nil -} - -// ObjectsToSynchronizeResponse_HeaderMultiError is an error wrapping multiple -// validation errors returned by -// ObjectsToSynchronizeResponse_Header.ValidateAll() if the designated -// constraints aren't met. -type ObjectsToSynchronizeResponse_HeaderMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ObjectsToSynchronizeResponse_HeaderMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ObjectsToSynchronizeResponse_HeaderMultiError) AllErrors() []error { return m } - -// ObjectsToSynchronizeResponse_HeaderValidationError is the validation error -// returned by ObjectsToSynchronizeResponse_Header.Validate if the designated -// constraints aren't met. -type ObjectsToSynchronizeResponse_HeaderValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ObjectsToSynchronizeResponse_HeaderValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ObjectsToSynchronizeResponse_HeaderValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ObjectsToSynchronizeResponse_HeaderValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ObjectsToSynchronizeResponse_HeaderValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ObjectsToSynchronizeResponse_HeaderValidationError) ErrorName() string { - return "ObjectsToSynchronizeResponse_HeaderValidationError" -} - -// Error satisfies the builtin error interface -func (e ObjectsToSynchronizeResponse_HeaderValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sObjectsToSynchronizeResponse_Header.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ObjectsToSynchronizeResponse_HeaderValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ObjectsToSynchronizeResponse_HeaderValidationError{} - -// Validate checks the field values on ObjectsToSynchronizeResponse_Object with -// the rules defined in the proto definition for this message. If any rules -// are violated, the first error encountered is returned, or nil if there are -// no violations. -func (m *ObjectsToSynchronizeResponse_Object) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ObjectsToSynchronizeResponse_Object -// with the rules defined in the proto definition for this message. If any -// rules are violated, the result is a list of violation errors wrapped in -// ObjectsToSynchronizeResponse_ObjectMultiError, or nil if none found. -func (m *ObjectsToSynchronizeResponse_Object) ValidateAll() error { - return m.validate(true) -} - -func (m *ObjectsToSynchronizeResponse_Object) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(m.GetSource()) < 1 { - err := ObjectsToSynchronizeResponse_ObjectValidationError{ - field: "Source", - reason: "value length must be at least 1 bytes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Data - - if len(errors) > 0 { - return ObjectsToSynchronizeResponse_ObjectMultiError(errors) - } - - return nil -} - -// ObjectsToSynchronizeResponse_ObjectMultiError is an error wrapping multiple -// validation errors returned by -// ObjectsToSynchronizeResponse_Object.ValidateAll() if the designated -// constraints aren't met. -type ObjectsToSynchronizeResponse_ObjectMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ObjectsToSynchronizeResponse_ObjectMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ObjectsToSynchronizeResponse_ObjectMultiError) AllErrors() []error { return m } - -// ObjectsToSynchronizeResponse_ObjectValidationError is the validation error -// returned by ObjectsToSynchronizeResponse_Object.Validate if the designated -// constraints aren't met. -type ObjectsToSynchronizeResponse_ObjectValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ObjectsToSynchronizeResponse_ObjectValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ObjectsToSynchronizeResponse_ObjectValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ObjectsToSynchronizeResponse_ObjectValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ObjectsToSynchronizeResponse_ObjectValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ObjectsToSynchronizeResponse_ObjectValidationError) ErrorName() string { - return "ObjectsToSynchronizeResponse_ObjectValidationError" -} - -// Error satisfies the builtin error interface -func (e ObjectsToSynchronizeResponse_ObjectValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sObjectsToSynchronizeResponse_Object.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ObjectsToSynchronizeResponse_ObjectValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ObjectsToSynchronizeResponse_ObjectValidationError{} - -// Validate checks the field values on ObjectsToSynchronizeResponse_Trailer -// with the rules defined in the proto definition for this message. If any -// rules are violated, the first error encountered is returned, or nil if -// there are no violations. -func (m *ObjectsToSynchronizeResponse_Trailer) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ObjectsToSynchronizeResponse_Trailer -// with the rules defined in the proto definition for this message. If any -// rules are violated, the result is a list of violation errors wrapped in -// ObjectsToSynchronizeResponse_TrailerMultiError, or nil if none found. -func (m *ObjectsToSynchronizeResponse_Trailer) ValidateAll() error { - return m.validate(true) -} - -func (m *ObjectsToSynchronizeResponse_Trailer) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return ObjectsToSynchronizeResponse_TrailerMultiError(errors) - } - - return nil -} - -// ObjectsToSynchronizeResponse_TrailerMultiError is an error wrapping multiple -// validation errors returned by -// ObjectsToSynchronizeResponse_Trailer.ValidateAll() if the designated -// constraints aren't met. -type ObjectsToSynchronizeResponse_TrailerMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ObjectsToSynchronizeResponse_TrailerMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ObjectsToSynchronizeResponse_TrailerMultiError) AllErrors() []error { return m } - -// ObjectsToSynchronizeResponse_TrailerValidationError is the validation error -// returned by ObjectsToSynchronizeResponse_Trailer.Validate if the designated -// constraints aren't met. -type ObjectsToSynchronizeResponse_TrailerValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ObjectsToSynchronizeResponse_TrailerValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ObjectsToSynchronizeResponse_TrailerValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ObjectsToSynchronizeResponse_TrailerValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ObjectsToSynchronizeResponse_TrailerValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ObjectsToSynchronizeResponse_TrailerValidationError) ErrorName() string { - return "ObjectsToSynchronizeResponse_TrailerValidationError" -} - -// Error satisfies the builtin error interface -func (e ObjectsToSynchronizeResponse_TrailerValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sObjectsToSynchronizeResponse_Trailer.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ObjectsToSynchronizeResponse_TrailerValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ObjectsToSynchronizeResponse_TrailerValidationError{} diff --git a/internal/module/gitops/rpc/rpc.proto b/internal/module/gitops/rpc/rpc.proto deleted file mode 100644 index ab28037f..00000000 --- a/internal/module/gitops/rpc/rpc.proto +++ /dev/null @@ -1,110 +0,0 @@ -syntax = "proto3"; - -// If you make any changes make sure you run: make regenerate-proto - -package gitlab.agent.gitops.rpc; - -option go_package = "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/gitops/rpc"; - -import "internal/tool/grpctool/automata/automata.proto"; -//import "github.com/envoyproxy/protoc-gen-validate/blob/master/validate/validate.proto"; -import "validate/validate.proto"; - -// GitRef in the repository to fetch manifests from. -message GitRefCF { - oneof ref { - option (validate.required) = true; - - // A Git tag name, without `refs/tags/` - string tag = 1 [json_name = "tag", (validate.rules).string.min_bytes = 1]; - // A Git branch name, without `refs/heads/` - string branch = 2 [json_name = "branch", (validate.rules).string.min_bytes = 1]; - // A Git commit SHA - string commit = 3 [json_name = "commit", (validate.rules).string.min_bytes = 1]; - } -} - -message PathCF { - oneof path { - option (validate.required) = true; - - // Glob to use to scan for files in the repository. - // Directories with names starting with a dot are ignored. - // See https://github.com/bmatcuk/doublestar#about and - // https://pkg.go.dev/github.com/bmatcuk/doublestar/v2#Match for - // globbing rules. - string glob = 1 [json_name = "glob", (validate.rules).string.min_bytes = 1]; - // A single file to fetch. - string file = 2 [json_name = "file", (validate.rules).string.min_bytes = 1]; - } -} - -message ObjectsToSynchronizeRequest { - // Project to fetch Kubernetes object manifests from. - // e.g. gitlab-org/cluster-integration/gitlab-agent - string project_id = 1 [(validate.rules).string.min_bytes = 1]; - // Ref within the project to fetch Kubernetes object manifest from. - GitRefCF ref = 4; - // Last processed commit id. Optional. - // Server will only send objects if the last commit on the branch is - // a different one. If a connection breaks, this allows to resume - // the stream without sending the same data again. - string commit_id = 2; - // A list of paths inside of the project to scan - // for .yaml/.yml/.json manifest files. - repeated PathCF paths = 3 [(validate.rules).repeated.min_items = 1]; -} - -message ObjectsToSynchronizeResponse { - // First message of the stream. - message Header { - // Commit id of the manifest repository. - // Can be used to resume connection from where it dropped. - string commit_id = 1 [(validate.rules).string.min_bytes = 1]; - // Numeric project id of the manifest repository. - int64 project_id = 2; - } - // Subsequent messages of the stream. - message Object { - // Source of the YAML e.g. file name. - // Several subsequent messages may contain the same source string. - // That means data should be accumulated to form the whole blob of data. - string source = 1 [(validate.rules).string.min_bytes = 1]; - - // YAML object manifest. - // Might be partial data, see comment for source. - bytes data = 2; - } - // Last message of the stream. - message Trailer { - } - oneof message { - - option (grpctool.automata.first_allowed_field) = 1; - option (grpctool.automata.first_allowed_field) = -1; // EOF means there is nothing to do - option (validate.required) = true; - - Header header = 1 [ - (grpctool.automata.next_allowed_field) = 2, - (grpctool.automata.next_allowed_field) = 3, - (validate.rules).message.required = true - ]; - Object object = 2 [ - (grpctool.automata.next_allowed_field) = 2, - (grpctool.automata.next_allowed_field) = 3, - (validate.rules).message.required = true - ]; - Trailer trailer = 3 [ - (grpctool.automata.next_allowed_field) = -1, - (validate.rules).message.required = true - ]; - } -} - -service Gitops { - // Fetch Kubernetes objects to synchronize with the cluster. - // Server closes the stream when it's done transmitting the full batch of - // objects. New request should be made after that to get the next batch. - rpc GetObjectsToSynchronize (ObjectsToSynchronizeRequest) returns (stream ObjectsToSynchronizeResponse) { - } -} diff --git a/internal/module/gitops/rpc/rpc_extra.go b/internal/module/gitops/rpc/rpc_extra.go deleted file mode 100644 index 9ef5587b..00000000 --- a/internal/module/gitops/rpc/rpc_extra.go +++ /dev/null @@ -1,42 +0,0 @@ -package rpc - -import ( - "fmt" - - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/pkg/agentcfg" -) - -func NewRpcRef(configRef *agentcfg.GitRefCF) *GitRefCF { - switch ref := configRef.GetRef().(type) { - case *agentcfg.GitRefCF_Tag: - return &GitRefCF{Ref: &GitRefCF_Tag{Tag: ref.Tag}} - case *agentcfg.GitRefCF_Branch: - return &GitRefCF{Ref: &GitRefCF_Branch{Branch: ref.Branch}} - case *agentcfg.GitRefCF_Commit: - return &GitRefCF{Ref: &GitRefCF_Commit{Commit: ref.Commit}} - case nil: - return nil - default: - // Nah, this doesn't happen - UNLESS you forgot to add a `case` when changing the `agentcfg.GitRefCF` proto message ;) - panic(fmt.Sprintf("unexpected ref to resolve: %T", ref)) - } -} - -// GetResolvedRef resolved the `Ref` into a full unambiguous Git reference. -func (x *GitRefCF) GetResolvedRef() string { - switch ref := x.GetRef().(type) { - case *GitRefCF_Tag: - return "refs/tags/" + ref.Tag - case *GitRefCF_Branch: - return "refs/heads/" + ref.Branch - case *GitRefCF_Commit: - return ref.Commit - case nil: - // as a default and for backward-compatibility reasons we assume that if no ref is specified the default project branch is used. - return gitaly.DefaultBranch - default: - // Nah, this doesn't happen - UNLESS you forgot to add a `case` when changing the `agentcfg.GitRefCF` proto message ;) - panic(fmt.Sprintf("unexpected ref to resolve: %T", ref)) - } -} diff --git a/internal/module/gitops/rpc/rpc_extra_test.go b/internal/module/gitops/rpc/rpc_extra_test.go deleted file mode 100644 index 6a38500f..00000000 --- a/internal/module/gitops/rpc/rpc_extra_test.go +++ /dev/null @@ -1,106 +0,0 @@ -package rpc - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/pkg/agentcfg" -) - -func TestRpc_NewRpcRef(t *testing.T) { - tcs := []struct { - name string - ref *agentcfg.GitRefCF - expectedRef *GitRefCF - }{ - { - name: "no ref should default to HEAD", - ref: nil, - expectedRef: nil, - }, - { - name: "empty ref should default to HEAD", - ref: &agentcfg.GitRefCF{}, - expectedRef: nil, - }, - { - name: "resolve arbitrary branch", - ref: &agentcfg.GitRefCF{ - Ref: &agentcfg.GitRefCF_Branch{Branch: "any-branch-name"}, - }, - expectedRef: &GitRefCF{ - Ref: &GitRefCF_Branch{Branch: "any-branch-name"}, - }, - }, - { - name: "resolve arbitrary tag", - ref: &agentcfg.GitRefCF{ - Ref: &agentcfg.GitRefCF_Tag{Tag: "any-tag-name"}, - }, - expectedRef: &GitRefCF{ - Ref: &GitRefCF_Tag{Tag: "any-tag-name"}, - }, - }, - { - name: "resolve arbitrary commit", - ref: &agentcfg.GitRefCF{ - Ref: &agentcfg.GitRefCF_Commit{Commit: "any-commit-sha"}, - }, - expectedRef: &GitRefCF{ - Ref: &GitRefCF_Commit{Commit: "any-commit-sha"}, - }, - }, - } - for _, tc := range tcs { - t.Run(tc.name, func(t *testing.T) { - actualRef := NewRpcRef(tc.ref) - assert.Equal(t, tc.expectedRef, actualRef) - }) - } -} - -func TestRpc_ResolveRef(t *testing.T) { - tcs := []struct { - name string - cf *GitRefCF - expectedResolvedRef string - }{ - { - name: "no ref should default to HEAD", - cf: nil, - expectedResolvedRef: "HEAD", - }, - { - name: "empty ref should default to HEAD", - cf: &GitRefCF{}, - expectedResolvedRef: "HEAD", - }, - { - name: "resolve arbitrary branch", - cf: &GitRefCF{ - Ref: &GitRefCF_Branch{Branch: "any-branch-name"}, - }, - expectedResolvedRef: "refs/heads/any-branch-name", - }, - { - name: "resolve arbitrary tag", - cf: &GitRefCF{ - Ref: &GitRefCF_Tag{Tag: "any-tag-name"}, - }, - expectedResolvedRef: "refs/tags/any-tag-name", - }, - { - name: "resolve arbitrary commit", - cf: &GitRefCF{ - Ref: &GitRefCF_Commit{Commit: "any-commit-sha"}, - }, - expectedResolvedRef: "any-commit-sha", - }, - } - for _, tc := range tcs { - t.Run(tc.name, func(t *testing.T) { - actualResolvedRef := tc.cf.GetResolvedRef() - assert.Equal(t, tc.expectedResolvedRef, actualResolvedRef) - }) - } -} diff --git a/internal/module/gitops/rpc/rpc_grpc.pb.go b/internal/module/gitops/rpc/rpc_grpc.pb.go deleted file mode 100644 index bfd818f6..00000000 --- a/internal/module/gitops/rpc/rpc_grpc.pb.go +++ /dev/null @@ -1,137 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v3.21.7 -// source: internal/module/gitops/rpc/rpc.proto - -package rpc - -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 - -const ( - Gitops_GetObjectsToSynchronize_FullMethodName = "/gitlab.agent.gitops.rpc.Gitops/GetObjectsToSynchronize" -) - -// GitopsClient is the client API for Gitops 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 GitopsClient interface { - GetObjectsToSynchronize(ctx context.Context, in *ObjectsToSynchronizeRequest, opts ...grpc.CallOption) (Gitops_GetObjectsToSynchronizeClient, error) -} - -type gitopsClient struct { - cc grpc.ClientConnInterface -} - -func NewGitopsClient(cc grpc.ClientConnInterface) GitopsClient { - return &gitopsClient{cc} -} - -func (c *gitopsClient) GetObjectsToSynchronize(ctx context.Context, in *ObjectsToSynchronizeRequest, opts ...grpc.CallOption) (Gitops_GetObjectsToSynchronizeClient, error) { - stream, err := c.cc.NewStream(ctx, &Gitops_ServiceDesc.Streams[0], Gitops_GetObjectsToSynchronize_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &gitopsGetObjectsToSynchronizeClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Gitops_GetObjectsToSynchronizeClient interface { - Recv() (*ObjectsToSynchronizeResponse, error) - grpc.ClientStream -} - -type gitopsGetObjectsToSynchronizeClient struct { - grpc.ClientStream -} - -func (x *gitopsGetObjectsToSynchronizeClient) Recv() (*ObjectsToSynchronizeResponse, error) { - m := new(ObjectsToSynchronizeResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// GitopsServer is the server API for Gitops service. -// All implementations must embed UnimplementedGitopsServer -// for forward compatibility -type GitopsServer interface { - GetObjectsToSynchronize(*ObjectsToSynchronizeRequest, Gitops_GetObjectsToSynchronizeServer) error - mustEmbedUnimplementedGitopsServer() -} - -// UnimplementedGitopsServer must be embedded to have forward compatible implementations. -type UnimplementedGitopsServer struct { -} - -func (UnimplementedGitopsServer) GetObjectsToSynchronize(*ObjectsToSynchronizeRequest, Gitops_GetObjectsToSynchronizeServer) error { - return status.Errorf(codes.Unimplemented, "method GetObjectsToSynchronize not implemented") -} -func (UnimplementedGitopsServer) mustEmbedUnimplementedGitopsServer() {} - -// UnsafeGitopsServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to GitopsServer will -// result in compilation errors. -type UnsafeGitopsServer interface { - mustEmbedUnimplementedGitopsServer() -} - -func RegisterGitopsServer(s grpc.ServiceRegistrar, srv GitopsServer) { - s.RegisterService(&Gitops_ServiceDesc, srv) -} - -func _Gitops_GetObjectsToSynchronize_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(ObjectsToSynchronizeRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(GitopsServer).GetObjectsToSynchronize(m, &gitopsGetObjectsToSynchronizeServer{stream}) -} - -type Gitops_GetObjectsToSynchronizeServer interface { - Send(*ObjectsToSynchronizeResponse) error - grpc.ServerStream -} - -type gitopsGetObjectsToSynchronizeServer struct { - grpc.ServerStream -} - -func (x *gitopsGetObjectsToSynchronizeServer) Send(m *ObjectsToSynchronizeResponse) error { - return x.ServerStream.SendMsg(m) -} - -// Gitops_ServiceDesc is the grpc.ServiceDesc for Gitops service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Gitops_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "gitlab.agent.gitops.rpc.Gitops", - HandlerType: (*GitopsServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "GetObjectsToSynchronize", - Handler: _Gitops_GetObjectsToSynchronize_Handler, - ServerStreams: true, - }, - }, - Metadata: "internal/module/gitops/rpc/rpc.proto", -} diff --git a/internal/module/gitops/server/BUILD.bazel b/internal/module/gitops/server/BUILD.bazel deleted file mode 100644 index 6f0dfd63..00000000 --- a/internal/module/gitops/server/BUILD.bazel +++ /dev/null @@ -1,82 +0,0 @@ -load("//build:build.bzl", "go_custom_test") -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "server", - srcs = [ - "defaulting.go", - "factory.go", - "module.go", - "project_info_client.go", - "server.go", - "visitor.go", - ], - importpath = "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/gitops/server", - visibility = ["//:__subpackages__"], - deps = [ - "//internal/api", - "//internal/gitaly", - "//internal/gitaly/vendored/gitalypb", - "//internal/gitlab", - "//internal/gitlab/api", - "//internal/module/gitops", - "//internal/module/gitops/rpc", - "//internal/module/modserver", - "//internal/module/modshared", - "//internal/module/usage_metrics", - "//internal/tool/cache", - "//internal/tool/errz", - "//internal/tool/grpctool", - "//internal/tool/logz", - "//internal/tool/prototool", - "//internal/tool/redistool", - "//internal/tool/retry", - "//pkg/event", - "//pkg/kascfg", - "@io_k8s_apimachinery//pkg/util/wait", - "@org_golang_google_grpc//codes", - "@org_golang_google_grpc//status", - "@org_uber_go_zap//:zap", - ], -) - -go_custom_test( - name = "server_test", - srcs = [ - "module_test.go", - "server_test.go", - "visitor_test.go", - ], - embed = [":server"], - deps = [ - "//internal/api", - "//internal/gitaly", - "//internal/gitaly/vendored/gitalypb", - "//internal/gitlab/api", - "//internal/module/gitops/rpc", - "//internal/module/modserver", - "//internal/tool/testing/kube_testing", - "//internal/tool/testing/matcher", - "//internal/tool/testing/mock_gitlab", - "//internal/tool/testing/mock_internalgitaly", - "//internal/tool/testing/mock_modserver", - "//internal/tool/testing/mock_rpc", - "//internal/tool/testing/mock_usage_metrics", - "//internal/tool/testing/testhelpers", - "//pkg/entity", - "//pkg/kascfg", - "@com_github_prometheus_client_golang//prometheus", - "@com_github_redis_rueidis//mock", - "@com_github_stretchr_testify//assert", - "@com_github_stretchr_testify//require", - "@io_k8s_api//core/v1:core", - "@io_k8s_apimachinery//pkg/apis/meta/v1:meta", - "@io_k8s_apimachinery//pkg/runtime", - "@io_opentelemetry_go_otel_trace//:trace", - "@org_golang_google_grpc//codes", - "@org_golang_google_grpc//status", - "@org_golang_google_protobuf//types/known/durationpb", - "@org_uber_go_mock//gomock", - "@org_uber_go_zap//zaptest", - ], -) diff --git a/internal/module/gitops/server/defaulting.go b/internal/module/gitops/server/defaulting.go deleted file mode 100644 index 328fe0ee..00000000 --- a/internal/module/gitops/server/defaulting.go +++ /dev/null @@ -1,33 +0,0 @@ -package server - -import ( - "time" - - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/prototool" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/pkg/kascfg" -) - -const ( - defaultGitopsPollPeriod = 5 * time.Minute - defaultGitopsProjectInfoCacheTTL = 5 * time.Minute - defaultGitopsProjectInfoCacheErrorTTL = 1 * time.Minute - defaultGitopsMaxManifestFileSize = 5 * 1024 * 1024 - defaultGitopsMaxTotalManifestFileSize = 20 * 1024 * 1024 - defaultGitopsMaxNumberOfPaths = 100 - defaultGitopsMaxNumberOfFiles = 1000 -) - -func ApplyDefaults(config *kascfg.ConfigurationFile) { - prototool.NotNil(&config.Agent) - prototool.NotNil(&config.Agent.Listen) - prototool.NotNil(&config.Agent.Gitops) - - gitops := config.Agent.Gitops - prototool.Duration(&gitops.PollPeriod, defaultGitopsPollPeriod) - prototool.Duration(&gitops.ProjectInfoCacheTtl, defaultGitopsProjectInfoCacheTTL) - prototool.Duration(&gitops.ProjectInfoCacheErrorTtl, defaultGitopsProjectInfoCacheErrorTTL) - prototool.Uint32(&gitops.MaxManifestFileSize, defaultGitopsMaxManifestFileSize) - prototool.Uint32(&gitops.MaxTotalManifestFileSize, defaultGitopsMaxTotalManifestFileSize) - prototool.Uint32(&gitops.MaxNumberOfPaths, defaultGitopsMaxNumberOfPaths) - prototool.Uint32(&gitops.MaxNumberOfFiles, defaultGitopsMaxNumberOfFiles) -} diff --git a/internal/module/gitops/server/factory.go b/internal/module/gitops/server/factory.go deleted file mode 100644 index 9a0b8eaf..00000000 --- a/internal/module/gitops/server/factory.go +++ /dev/null @@ -1,87 +0,0 @@ -package server - -import ( - "strings" - "time" - - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/api" - gapi "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitlab/api" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/gitops" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/gitops/rpc" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/modserver" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/modshared" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/cache" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/prototool" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/redistool" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/retry" -) - -const ( - getObjectsToSynchronizeInitBackoff = 10 * time.Second - getObjectsToSynchronizeMaxBackoff = 5 * time.Minute - getObjectsToSynchronizeResetDuration = 10 * time.Minute - getObjectsToSynchronizeBackoffFactor = 2.0 - getObjectsToSynchronizeJitter = 1.0 - - gitopsSyncCountKnownMetric = "gitops_sync" -) - -type Factory struct { -} - -func (f *Factory) New(config *modserver.Config) (modserver.Module, error) { - s := newServerFromConfig(config) - rpc.RegisterGitopsServer(config.AgentServer, s) - return &module{}, nil -} - -func (f *Factory) Name() string { - return gitops.ModuleName -} - -func (f *Factory) StartStopPhase() modshared.ModuleStartStopPhase { - return modshared.ModuleStartBeforeServers -} - -func newServerFromConfig(config *modserver.Config) *server { - gitopsCfg := config.Config.Agent.Gitops - return &server{ - serverApi: config.Api, - gitalyPool: config.Gitaly, - projectInfoClient: &projectInfoClient{ - GitLabClient: config.GitLabClient, - ProjectInfoCache: cache.NewWithError[projectInfoCacheKey, *api.ProjectInfo]( - gitopsCfg.ProjectInfoCacheTtl.AsDuration(), - gitopsCfg.ProjectInfoCacheErrorTtl.AsDuration(), - &redistool.ErrCacher[projectInfoCacheKey]{ - Log: config.Log, - ErrRep: modshared.ApiToErrReporter(config.Api), - Client: config.RedisClient, - ErrMarshaler: prototool.ProtoErrMarshaler{}, - KeyToRedisKey: func(cacheKey projectInfoCacheKey) string { - var result strings.Builder - result.WriteString(config.Config.Redis.KeyPrefix) - result.WriteString(":project_info_errs:") - result.Write(api.AgentToken2key(cacheKey.agentToken)) - result.WriteByte(':') - result.WriteString(cacheKey.projectId) - return result.String() - }, - }, - config.TraceProvider.Tracer(gitops.ModuleName), - gapi.IsCacheableError, - ), - }, - getObjectsPollConfig: retry.NewPollConfigFactory(gitopsCfg.PollPeriod.AsDuration(), retry.NewExponentialBackoffFactory( - getObjectsToSynchronizeInitBackoff, - getObjectsToSynchronizeMaxBackoff, - getObjectsToSynchronizeResetDuration, - getObjectsToSynchronizeBackoffFactor, - getObjectsToSynchronizeJitter, - )), - maxManifestFileSize: int64(gitopsCfg.MaxManifestFileSize), - maxTotalManifestFileSize: int64(gitopsCfg.MaxTotalManifestFileSize), - maxNumberOfPaths: gitopsCfg.MaxNumberOfPaths, - maxNumberOfFiles: gitopsCfg.MaxNumberOfFiles, - } -} diff --git a/internal/module/gitops/server/module.go b/internal/module/gitops/server/module.go deleted file mode 100644 index 5a547a2b..00000000 --- a/internal/module/gitops/server/module.go +++ /dev/null @@ -1,18 +0,0 @@ -package server - -import ( - "context" - - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/gitops" -) - -type module struct { -} - -func (m *module) Run(ctx context.Context) error { - return nil -} - -func (m *module) Name() string { - return gitops.ModuleName -} diff --git a/internal/module/gitops/server/module_test.go b/internal/module/gitops/server/module_test.go deleted file mode 100644 index 9a1df999..00000000 --- a/internal/module/gitops/server/module_test.go +++ /dev/null @@ -1,11 +0,0 @@ -package server - -import ( - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/modserver" -) - -var ( - _ modserver.Module = &module{} - _ modserver.Factory = &Factory{} - _ modserver.ApplyDefaults = ApplyDefaults -) diff --git a/internal/module/gitops/server/project_info_client.go b/internal/module/gitops/server/project_info_client.go deleted file mode 100644 index 4a6beb38..00000000 --- a/internal/module/gitops/server/project_info_client.go +++ /dev/null @@ -1,27 +0,0 @@ -package server - -import ( - "context" - - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/api" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitlab" - gapi "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitlab/api" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/cache" -) - -type projectInfoClient struct { - GitLabClient gitlab.ClientInterface - ProjectInfoCache *cache.CacheWithErr[projectInfoCacheKey, *api.ProjectInfo] -} - -func (c *projectInfoClient) GetProjectInfo(ctx context.Context, agentToken api.AgentToken, projectId string) (*api.ProjectInfo, error) { - key := projectInfoCacheKey{agentToken: agentToken, projectId: projectId} - return c.ProjectInfoCache.GetItem(ctx, key, func() (*api.ProjectInfo, error) { - return gapi.GetProjectInfo(ctx, c.GitLabClient, agentToken, projectId, gitlab.WithoutRetries()) - }) -} - -type projectInfoCacheKey struct { - agentToken api.AgentToken - projectId string -} diff --git a/internal/module/gitops/server/server.go b/internal/module/gitops/server/server.go deleted file mode 100644 index dc6aa9ab..00000000 --- a/internal/module/gitops/server/server.go +++ /dev/null @@ -1,325 +0,0 @@ -package server - -import ( - "context" - "errors" - "fmt" - "regexp" - "strings" - - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/api" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitlab" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/gitops/rpc" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/modserver" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/errz" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/grpctool" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/logz" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/retry" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/pkg/event" - "go.uber.org/zap" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - "k8s.io/apimachinery/pkg/util/wait" -) - -const ( - gitOpsManifestMaxChunkSize = 128 * 1024 -) - -var ( - // globPrefix captures glob prefix that does not contain any special characters, recognized by doublestar.Match. - // See https://github.com/bmatcuk/doublestar#about and - // https://pkg.go.dev/github.com/bmatcuk/doublestar/v2#Match for globbing rules. - globPrefix = regexp.MustCompile(`^([^\\*?[\]{}]+)/(.*)$`) -) - -type server struct { - rpc.UnimplementedGitopsServer - serverApi modserver.Api - gitalyPool gitaly.PoolInterface - projectInfoClient *projectInfoClient - getObjectsPollConfig retry.PollConfigFactory - maxManifestFileSize int64 - maxTotalManifestFileSize int64 - maxNumberOfPaths uint32 - maxNumberOfFiles uint32 -} - -func (s *server) GetObjectsToSynchronize(req *rpc.ObjectsToSynchronizeRequest, server rpc.Gitops_GetObjectsToSynchronizeServer) error { - err := s.validateGetObjectsToSynchronizeRequest(req) - if err != nil { - return err // no wrap - } - var agentInfo *api.AgentInfo - ctx := server.Context() - rpcApi := modserver.AgentRpcApiFromContext(server.Context()) - agentToken := rpcApi.AgentToken() - log := rpcApi.Log().With(logz.ProjectId(req.ProjectId)) - pollCfg := s.getObjectsPollConfig() - - // is true if the current synchronization is for a commit - synchronizingCommit := req.GetRef().GetCommit() != "" - if !synchronizingCommit { - var wg wait.Group - defer wg.Wait() - - // we not only want to stop the poke subscription when the stream context is stopped, - // but also when the `PollWithBackoff` call below finishes. - pollingDoneCtx, cancel := context.WithCancel(ctx) - defer cancel() - - wg.Start(func() { - s.serverApi.OnGitPushEvent(pollingDoneCtx, func(ctx context.Context, e *event.GitPushEvent) { - // NOTE: yes, the req.ProjectId is NOT a project id, but a full project path ... - if e.Project.FullPath == req.ProjectId { - pollCfg.Poke() - } - }) - }) - } - - return rpcApi.PollWithBackoff(pollCfg, func() (error, retry.AttemptResult) { - if agentInfo == nil { // executed only once (if successful) - agentInfo, err = rpcApi.AgentInfo(ctx, log) - if err != nil { - if status.Code(err) == codes.Unavailable { - return nil, retry.Backoff - } - return err, retry.Done // no wrap - } - log = log.With(logz.AgentId(agentInfo.Id)) - } - // This call is made on each poll because: - // - it checks that the agent's token is still valid - // - repository location in Gitaly might have changed - projectInfo, err := s.getProjectInfo(ctx, log, rpcApi, agentInfo.Id, agentToken, req.ProjectId) - if err != nil { - if status.Code(err) == codes.Unavailable { - return nil, retry.Backoff - } - return err, retry.Done // no wrap - } - - var commitToSynchronize string - // Declare a new logger to not append the same field in every poll. - log := log // nolint:govet - if synchronizingCommit { - // no need to poll, because we already have an immutable commit sha - commitToSynchronize = req.GetRef().GetCommit() - log = log.With(logz.CommitId(commitToSynchronize)) - } else { - // Resolve the ref provided by the agent to a full ref which can be used to unambiguously find a Git ref. - fullRefName := req.GetRef().GetResolvedRef() - info, err := s.poll(ctx, projectInfo, req.CommitId, fullRefName) // nolint:govet - if err != nil { - switch gitaly.ErrorCodeFromError(err) { // nolint:exhaustive - case gitaly.NotFound: // ref not found - return status.Errorf(codes.NotFound, "GitOps: repository poll failed: %v", err), retry.Done - default: - rpcApi.HandleProcessingError(log, agentInfo.Id, "GitOps: repository poll failed", err) - return nil, retry.Backoff - } - } - commitToSynchronize = info.CommitId - log = log.With(logz.CommitId(commitToSynchronize), logz.GitRef(fullRefName)) - - if info.EmptyRepository { - log.Debug("GitOps: empty repository") - return nil, retry.Continue - } - } - - // If the commit to synchronize is the same as the previously synchronized commit, we don't need to do anything - if commitToSynchronize == req.CommitId { - log.Debug("GitOps: no updates") - - if !synchronizingCommit { // the actual ref may change, and we need to poll the given ref. - return nil, retry.Continue - } else { // we are synchronizing a commit and don't need to poll again, because it doesn't change. - log.Debug("blocking GetObjectsToSynchronize because the request wants to synchronize a commit which already has been synced") - <-ctx.Done() - return nil, retry.Done - } - } - - log.Info("GitOps: new commit") - err = s.sendObjectsToSynchronizeHeader(server, commitToSynchronize, projectInfo.ProjectId) - if err != nil { - return rpcApi.HandleIoError(log, "GitOps: failed to send header for objects to synchronize", err), retry.Done - } - filesVisited, filesSent, err := s.sendObjectsToSynchronizeBody(log, rpcApi, req, server, agentInfo.Id, projectInfo, commitToSynchronize) // nolint: contextcheck - if err != nil { - return err, retry.Done // no wrap - } - err = s.sendObjectsToSynchronizeTrailer(server) - if err != nil { - return rpcApi.HandleIoError(log, "GitOps: failed to send trailer for objects to synchronize", err), retry.Done - } - log.Info("GitOps: fetched files", logz.NumberOfFilesVisited(filesVisited), logz.NumberOfFilesSent(filesSent)) - return nil, retry.Done - }) -} - -func (s *server) poll(ctx context.Context, projectInfo *api.ProjectInfo, commitId string, fullRefName string) (*gitaly.PollInfo, error) { - p, err := s.gitalyPool.Poller(ctx, projectInfo.GitalyInfo) - if err != nil { - return nil, err - } - return p.Poll(ctx, projectInfo.Repository, commitId, fullRefName) -} - -func (s *server) validateGetObjectsToSynchronizeRequest(req *rpc.ObjectsToSynchronizeRequest) error { - numberOfPaths := uint32(len(req.Paths)) - if numberOfPaths > s.maxNumberOfPaths { - // TODO validate config in GetConfiguration too and send it somewhere the user can see it https://gitlab.com/gitlab-org/gitlab/-/issues/277323 - // This check must be here, but there too. - return status.Errorf(codes.InvalidArgument, "maximum number of GitOps paths per manifest project is %d, but %d was requested", s.maxNumberOfPaths, numberOfPaths) - } - return nil -} - -func (s *server) sendObjectsToSynchronizeHeader(server rpc.Gitops_GetObjectsToSynchronizeServer, commitId string, projectId int64) error { - return server.Send(&rpc.ObjectsToSynchronizeResponse{ - Message: &rpc.ObjectsToSynchronizeResponse_Header_{ - Header: &rpc.ObjectsToSynchronizeResponse_Header{ - CommitId: commitId, - ProjectId: projectId, - }, - }, - }) -} - -func (s *server) sendObjectsToSynchronizeBody( - log *zap.Logger, - rpcApi modserver.RpcApi, - req *rpc.ObjectsToSynchronizeRequest, - server rpc.Gitops_GetObjectsToSynchronizeServer, - agentId int64, - projectInfo *api.ProjectInfo, - commitId string, -) (uint32 /* files visited */, uint32 /* files sent */, error) { - ctx := server.Context() - pf, err := s.gitalyPool.PathFetcher(ctx, projectInfo.GitalyInfo) - if err != nil { - rpcApi.HandleProcessingError(log, agentId, "GitOps: PathFetcher", err) - return 0, 0, status.Error(codes.Unavailable, "GitOps: PathFetcher") - } - v := &objectsToSynchronizeVisitor{ - server: server, - fileSizeLimit: s.maxManifestFileSize, - } - var delegate gitaly.FetchVisitor = v - delegate = gitaly.NewChunkingFetchVisitor(delegate, gitOpsManifestMaxChunkSize) - delegate = gitaly.NewTotalSizeLimitingFetchVisitor(delegate, s.maxTotalManifestFileSize) - vDupDetector := gitaly.NewDuplicateFileDetectingVisitor(delegate, gitaly.DupError) - vHiddenDir := gitaly.NewHiddenDirFilteringFetchVisitor(vDupDetector) - vGlob := gitaly.NewGlobFilteringFetchVisitor(vHiddenDir, "") - vCounting := gitaly.NewEntryCountLimitingFetchVisitor(vGlob, s.maxNumberOfFiles) - handleErr := func(err error) (uint32 /* files visited */, uint32 /* files sent */, error) { - switch { - case v.sendFailed: - return vCounting.FilesVisited, vCounting.FilesSent, rpcApi.HandleIoError(log, "GitOps: failed to send objects to synchronize", err) - case isUserError(err): - err = errz.NewUserErrorWithCause(err, "manifest file") - rpcApi.HandleProcessingError(log, agentId, "GitOps: failed to get objects to synchronize", err) - // return the error to the client because it's a user error - return vCounting.FilesVisited, vCounting.FilesSent, status.Errorf(codes.FailedPrecondition, "GitOps: failed to get objects to synchronize: %v", err) - case grpctool.RequestCanceled(err): - return vCounting.FilesVisited, vCounting.FilesSent, status.Error(codes.Canceled, "GitOps: failed to get objects to synchronize") - case grpctool.RequestTimedOut(err): - return vCounting.FilesVisited, vCounting.FilesSent, status.Error(codes.DeadlineExceeded, "GitOps: failed to get objects to synchronize") - default: - rpcApi.HandleProcessingError(log, agentId, "GitOps: failed to get objects to synchronize", err) - return vCounting.FilesVisited, vCounting.FilesSent, status.Error(codes.Unavailable, "GitOps: failed to get objects to synchronize") - } - } - commitIdBytes := []byte(commitId) - var files []string - // 1. Handle globs - for _, p := range req.Paths { - switch path := p.Path.(type) { - case *rpc.PathCF_Glob: - globNoSlash := strings.TrimPrefix(path.Glob, "/") // original glob without the leading slash - repoPath, recursive := globToGitaly(globNoSlash) - vGlob.Glob = globNoSlash // set new glob for each path - err = pf.Visit(ctx, projectInfo.Repository, commitIdBytes, repoPath, recursive, vCounting) - case *rpc.PathCF_File: - files = append(files, path.File) - default: - err = fmt.Errorf("unknown path type: %T", p.Path) // should never happen - } - if err != nil { - return handleErr(err) - } - } - // 2. Handle files. Must be last because duplicates are skipped here as they've been sent already. - vDupDetector.DupBehavior = gitaly.DupSkip // if a file was fetched as part of globbing, don't error, just skip it. - vCounting.FetchVisitor = vHiddenDir // vCounting delegates directly to vHiddenDir, skipping vGlob. We don't need it anymore. - for _, file := range files { - err = pf.VisitSingleFile(ctx, projectInfo.Repository, commitIdBytes, []byte(file), vCounting) - if err != nil { - return handleErr(err) - } - } - return vCounting.FilesVisited, vCounting.FilesSent, nil -} - -func (s *server) sendObjectsToSynchronizeTrailer(server rpc.Gitops_GetObjectsToSynchronizeServer) error { - return server.Send(&rpc.ObjectsToSynchronizeResponse{ - Message: &rpc.ObjectsToSynchronizeResponse_Trailer_{ - Trailer: &rpc.ObjectsToSynchronizeResponse_Trailer{}, - }, - }) -} - -// getProjectInfo returns an error with code Unavailable if there was a retriable error. -func (s *server) getProjectInfo(ctx context.Context, log *zap.Logger, rpcApi modserver.RpcApi, agentId int64, - agentToken api.AgentToken, projectId string) (*api.ProjectInfo, error) { - projectInfo, err := s.projectInfoClient.GetProjectInfo(ctx, agentToken, projectId) - switch { - case err == nil: - return projectInfo, nil - case errors.Is(err, context.Canceled): - err = status.Error(codes.Canceled, err.Error()) - case errors.Is(err, context.DeadlineExceeded): - err = status.Error(codes.DeadlineExceeded, err.Error()) - case gitlab.IsForbidden(err): - err = status.Error(codes.PermissionDenied, "forbidden") - case gitlab.IsUnauthorized(err): - err = status.Error(codes.Unauthenticated, "unauthenticated") - case gitlab.IsNotFound(err): - err = status.Error(codes.NotFound, "project not found") - default: - rpcApi.HandleProcessingError(log, agentId, "GetProjectInfo()", err) - err = status.Error(codes.Unavailable, "unavailable") - } - return nil, err -} - -func isUserError(err error) bool { - switch err.(type) { // nolint:errorlint - case *gitaly.GlobMatchFailedError, *gitaly.MaxNumberOfFilesError, *gitaly.DuplicatePathFoundError: - return true - } - switch gitaly.ErrorCodeFromError(err) { // nolint:exhaustive - case gitaly.NotFound, gitaly.FileTooBig, gitaly.UnexpectedTreeEntryType, gitaly.InvalidArgument: - return true - } - return false -} - -// globToGitaly accepts a glob without a leading slash! -func globToGitaly(glob string) ([]byte /* repoPath */, bool /* recursive */) { - var repoPath []byte - matches := globPrefix.FindStringSubmatch(glob) - if matches == nil { - repoPath = []byte{'.'} - } else { - repoPath = []byte(matches[1]) - glob = matches[2] - } - recursive := strings.ContainsAny(glob, "[/") || // cannot determine if recursive or not because character class may contain ranges, etc - strings.Contains(glob, "**") // contains directory match - return repoPath, recursive -} diff --git a/internal/module/gitops/server/server_test.go b/internal/module/gitops/server/server_test.go deleted file mode 100644 index 26d3b981..00000000 --- a/internal/module/gitops/server/server_test.go +++ /dev/null @@ -1,728 +0,0 @@ -package server - -import ( - "context" - "errors" - "fmt" - "net/http" - "strconv" - "testing" - - "github.com/prometheus/client_golang/prometheus" - rmock "github.com/redis/rueidis/mock" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/api" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/gitalypb" - gapi "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitlab/api" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/gitops/rpc" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/modserver" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/kube_testing" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/matcher" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/mock_gitlab" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/mock_internalgitaly" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/mock_modserver" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/mock_rpc" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/mock_usage_metrics" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/testhelpers" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/pkg/entity" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/pkg/kascfg" - "go.opentelemetry.io/otel/trace" - "go.uber.org/mock/gomock" - "go.uber.org/zap/zaptest" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/types/known/durationpb" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" -) - -const ( - defaultGitOpsManifestPathGlob = "**/*.{yaml,yml,json}" - - projectId = "some/project" - revision = "507ebc6de9bcac25628aa7afd52802a91a0685d8" - manifestRevision = "7afd52802a91a0685d8507ebc6de9bcac25628aa" -) - -var ( - _ rpc.GitopsServer = (*server)(nil) -) - -func TestGlobToGitaly(t *testing.T) { - tests := []struct { - name string - glob string - expectedRepoPath []byte - expectedRecursive bool - }{ - { - name: "full file name", - glob: "simple-path/manifest.yaml", - expectedRepoPath: []byte("simple-path"), - expectedRecursive: false, - }, - { - name: "empty", - glob: "", - expectedRepoPath: []byte{'.'}, - expectedRecursive: false, - }, - { - name: "simple file1", - glob: "*.yaml", - expectedRepoPath: []byte{'.'}, - expectedRecursive: false, - }, - { - name: "files in directory1", - glob: "bla/*.yaml", - expectedRepoPath: []byte("bla"), - expectedRecursive: false, - }, - { - name: "recursive files in directory1", - glob: "bla/**/*.yaml", - expectedRepoPath: []byte("bla"), - expectedRecursive: true, - }, - { - name: "all files1", - glob: "**/*.yaml", - expectedRepoPath: []byte{'.'}, - expectedRecursive: true, - }, - { - name: "group1", - glob: "[a-z]*/*.yaml", - expectedRepoPath: []byte{'.'}, - expectedRecursive: true, - }, - { - name: "group2", - glob: "?bla/*.yaml", - expectedRepoPath: []byte{'.'}, - expectedRecursive: true, - }, - { - name: "group3", - glob: "bla/?aaa/*.yaml", - expectedRepoPath: []byte("bla"), - expectedRecursive: true, - }, - } - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - gotRepoPath, gotRecursive := globToGitaly(tc.glob) - assert.Equal(t, tc.expectedRepoPath, gotRepoPath) - assert.Equal(t, tc.expectedRecursive, gotRecursive) - }) - } -} - -func TestGetObjectsToSynchronize_GetProjectInfo_Errors(t *testing.T) { - tests := map[int]codes.Code{ - http.StatusForbidden: codes.PermissionDenied, - http.StatusUnauthorized: codes.Unauthenticated, - http.StatusNotFound: codes.NotFound, - } - for httpStatus, grpcCode := range tests { - t.Run(strconv.Itoa(httpStatus), func(t *testing.T) { - ctx, s, ctrl, _, _ := setupServerWithAgentInfo(t, func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(httpStatus) - }) - server := mock_rpc.NewMockGitops_GetObjectsToSynchronizeServer(ctrl) - server.EXPECT(). - Context(). - Return(ctx). - MinTimes(1) - err := s.GetObjectsToSynchronize(&rpc.ObjectsToSynchronizeRequest{ProjectId: projectId}, server) - require.Error(t, err) - assert.Equal(t, grpcCode, status.Code(err)) - }) - } -} - -func TestGetObjectsToSynchronize_GetProjectInfo_InternalServerError(t *testing.T) { - ctx, s, ctrl, mockRpcApi, _ := setupServerWithAgentInfo(t, func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusInternalServerError) - }) - mockRpcApi.EXPECT(). - HandleProcessingError(gomock.Any(), testhelpers.AgentId, "GetProjectInfo()", matcher.ErrorEq("HTTP status code: 500 for path /api/v4/internal/kubernetes/project_info")) - server := mock_rpc.NewMockGitops_GetObjectsToSynchronizeServer(ctrl) - server.EXPECT(). - Context(). - Return(ctx). - MinTimes(1) - err := s.GetObjectsToSynchronize(&rpc.ObjectsToSynchronizeRequest{ProjectId: projectId}, server) - require.NoError(t, err) // no error here, it keeps trying for any other errors -} - -func TestGetObjectsToSynchronize_GetAgentInfo_Error(t *testing.T) { - ctx, s, ctrl, mockRpcApi, _ := setupServerBare(t, 1, func(w http.ResponseWriter, r *http.Request) { - t.Fail() - }) - mockRpcApi.EXPECT(). - AgentInfo(gomock.Any(), gomock.Any()). - Return(nil, status.Error(codes.PermissionDenied, "expected err")) // code doesn't matter, we test that we return on error - server := mock_rpc.NewMockGitops_GetObjectsToSynchronizeServer(ctrl) - server.EXPECT(). - Context(). - Return(ctx). - MinTimes(1) - err := s.GetObjectsToSynchronize(&rpc.ObjectsToSynchronizeRequest{ProjectId: projectId}, server) - require.Error(t, err) - assert.Equal(t, codes.PermissionDenied, status.Code(err)) -} - -func TestGetObjectsToSynchronize_GetAgentInfo_RetriableError(t *testing.T) { - wasCalled := false - ctx, s, ctrl, mockRpcApi, _ := setupServerBare(t, 2, func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusForbidden) - wasCalled = true - }) - agentInfo := testhelpers.AgentInfoObj() - gomock.InOrder( - mockRpcApi.EXPECT(). - AgentInfo(gomock.Any(), gomock.Any()). - Return(nil, status.Error(codes.Unavailable, "unavailable")), - mockRpcApi.EXPECT(). - AgentInfo(gomock.Any(), gomock.Any()). - Return(agentInfo, nil), - ) - server := mock_rpc.NewMockGitops_GetObjectsToSynchronizeServer(ctrl) - server.EXPECT(). - Context(). - Return(ctx). - MinTimes(1) - err := s.GetObjectsToSynchronize(&rpc.ObjectsToSynchronizeRequest{ProjectId: projectId}, server) - require.Error(t, err) - assert.Equal(t, codes.PermissionDenied, status.Code(err)) - assert.True(t, wasCalled) -} - -func TestGetObjectsToSynchronize_HappyPath(t *testing.T) { - server, s, ctrl, gitalyPool, _ := setupServer(t) - s.syncCount.(*mock_usage_metrics.MockCounter).EXPECT().Inc() - - objs := objectsYAML(t) - projInfo := projectInfo() - gomock.InOrder( - server.EXPECT(). - Send(matcher.ProtoEq(t, &rpc.ObjectsToSynchronizeResponse{ - Message: &rpc.ObjectsToSynchronizeResponse_Header_{ - Header: &rpc.ObjectsToSynchronizeResponse_Header{ - CommitId: revision, - ProjectId: projInfo.ProjectId, - }, - }, - })), - server.EXPECT(). - Send(matcher.ProtoEq(t, &rpc.ObjectsToSynchronizeResponse{ - Message: &rpc.ObjectsToSynchronizeResponse_Object_{ - Object: &rpc.ObjectsToSynchronizeResponse_Object{ - Source: "manifest.yaml", - Data: objs[:1], - }, - }, - })), - server.EXPECT(). - Send(matcher.ProtoEq(t, &rpc.ObjectsToSynchronizeResponse{ - Message: &rpc.ObjectsToSynchronizeResponse_Object_{ - Object: &rpc.ObjectsToSynchronizeResponse_Object{ - Source: "manifest.yaml", - Data: objs[1:], - }, - }, - })), - server.EXPECT(). - Send(matcher.ProtoEq(t, &rpc.ObjectsToSynchronizeResponse{ - Message: &rpc.ObjectsToSynchronizeResponse_Trailer_{ - Trailer: &rpc.ObjectsToSynchronizeResponse_Trailer{}, - }, - })), - ) - p := mock_internalgitaly.NewMockPollerInterface(ctrl) - pf := mock_internalgitaly.NewMockPathFetcherInterface(ctrl) - gomock.InOrder( - gitalyPool.EXPECT(). - Poller(gomock.Any(), matcher.ProtoEq(nil, projInfo.GitalyInfo)). - Return(p, nil), - p.EXPECT(). - Poll(gomock.Any(), matcher.ProtoEq(nil, projInfo.Repository), "", "HEAD"). - Return(&gitaly.PollInfo{ - CommitId: revision, - UpdateAvailable: true, - }, nil), - gitalyPool.EXPECT(). - PathFetcher(gomock.Any(), matcher.ProtoEq(nil, projInfo.GitalyInfo)). - Return(pf, nil), - pf.EXPECT(). - Visit(gomock.Any(), matcher.ProtoEq(nil, projInfo.Repository), []byte(revision), []byte("."), true, gomock.Any()). - Do(func(ctx context.Context, repo *gitalypb.Repository, revision, repoPath []byte, recursive bool, visitor gitaly.FetchVisitor) error { - download, maxSize, err := visitor.Entry(&gitalypb.TreeEntry{ - Path: []byte("manifest.yaml"), - Type: gitalypb.TreeEntry_BLOB, - CommitOid: manifestRevision, - }) - require.NoError(t, err) - assert.EqualValues(t, defaultGitopsMaxManifestFileSize, maxSize) - assert.True(t, download) - - done, err := visitor.StreamChunk([]byte("manifest.yaml"), objs[:1]) - require.NoError(t, err) - assert.False(t, done) - done, err = visitor.StreamChunk([]byte("manifest.yaml"), objs[1:]) - require.NoError(t, err) - assert.False(t, done) - return nil - }), - ) - err := s.GetObjectsToSynchronize(&rpc.ObjectsToSynchronizeRequest{ - ProjectId: projectId, - Paths: []*rpc.PathCF{ - { - Path: &rpc.PathCF_Glob{ - Glob: defaultGitOpsManifestPathGlob, - }, - }, - }, - }, server) - require.NoError(t, err) -} - -func TestGetObjectsToSynchronize_EmptyRepository(t *testing.T) { - server, s, ctrl, gitalyPool, _ := setupServer(t) - projInfo := projectInfo() - p := mock_internalgitaly.NewMockPollerInterface(ctrl) - gomock.InOrder( - gitalyPool.EXPECT(). - Poller(gomock.Any(), matcher.ProtoEq(nil, projInfo.GitalyInfo)). - Return(p, nil), - p.EXPECT(). - Poll(gomock.Any(), matcher.ProtoEq(nil, projInfo.Repository), revision, "HEAD"). - DoAndReturn(func(ctx context.Context, repo *gitalypb.Repository, lastProcessedCommitId, refName string) (*gitaly.PollInfo, error) { - return &gitaly.PollInfo{ - EmptyRepository: true, - }, nil - }), - ) - err := s.GetObjectsToSynchronize(&rpc.ObjectsToSynchronizeRequest{ - ProjectId: projectId, - CommitId: revision, - }, server) - require.NoError(t, err) -} - -func TestGetObjectsToSynchronize_SpecificCommit(t *testing.T) { - server, s, ctrl, gitalyPool, _ := setupServer(t) - s.syncCount.(*mock_usage_metrics.MockCounter).EXPECT().Inc() - - objs := objectsYAML(t) - projInfo := projectInfo() - gomock.InOrder( - server.EXPECT(). - Send(matcher.ProtoEq(t, &rpc.ObjectsToSynchronizeResponse{ - Message: &rpc.ObjectsToSynchronizeResponse_Header_{ - Header: &rpc.ObjectsToSynchronizeResponse_Header{ - CommitId: manifestRevision, - ProjectId: projInfo.ProjectId, - }, - }, - })), - server.EXPECT(). - Send(matcher.ProtoEq(t, &rpc.ObjectsToSynchronizeResponse{ - Message: &rpc.ObjectsToSynchronizeResponse_Object_{ - Object: &rpc.ObjectsToSynchronizeResponse_Object{ - Source: "manifest.yaml", - Data: objs[:1], - }, - }, - })), - server.EXPECT(). - Send(matcher.ProtoEq(t, &rpc.ObjectsToSynchronizeResponse{ - Message: &rpc.ObjectsToSynchronizeResponse_Object_{ - Object: &rpc.ObjectsToSynchronizeResponse_Object{ - Source: "manifest.yaml", - Data: objs[1:], - }, - }, - })), - server.EXPECT(). - Send(matcher.ProtoEq(t, &rpc.ObjectsToSynchronizeResponse{ - Message: &rpc.ObjectsToSynchronizeResponse_Trailer_{ - Trailer: &rpc.ObjectsToSynchronizeResponse_Trailer{}, - }, - })), - ) - p := mock_internalgitaly.NewMockPollerInterface(ctrl) - pf := mock_internalgitaly.NewMockPathFetcherInterface(ctrl) - p.EXPECT().Poll(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Times(0) - gomock.InOrder( - gitalyPool.EXPECT(). - PathFetcher(gomock.Any(), matcher.ProtoEq(nil, projInfo.GitalyInfo)). - Return(pf, nil), - pf.EXPECT(). - Visit(gomock.Any(), matcher.ProtoEq(nil, projInfo.Repository), []byte(manifestRevision), []byte("."), true, gomock.Any()). - Do(func(ctx context.Context, repo *gitalypb.Repository, revision, repoPath []byte, recursive bool, visitor gitaly.FetchVisitor) error { - download, maxSize, err := visitor.Entry(&gitalypb.TreeEntry{ - Path: []byte("manifest.yaml"), - Type: gitalypb.TreeEntry_BLOB, - CommitOid: manifestRevision, - }) - require.NoError(t, err) - assert.EqualValues(t, defaultGitopsMaxManifestFileSize, maxSize) - assert.True(t, download) - - done, err := visitor.StreamChunk([]byte("manifest.yaml"), objs[:1]) - require.NoError(t, err) - assert.False(t, done) - done, err = visitor.StreamChunk([]byte("manifest.yaml"), objs[1:]) - require.NoError(t, err) - assert.False(t, done) - return nil - }), - ) - err := s.GetObjectsToSynchronize(&rpc.ObjectsToSynchronizeRequest{ - ProjectId: projectId, - CommitId: revision, - Ref: &rpc.GitRefCF{ - Ref: &rpc.GitRefCF_Commit{Commit: manifestRevision}, - }, - Paths: []*rpc.PathCF{ - { - Path: &rpc.PathCF_Glob{ - Glob: defaultGitOpsManifestPathGlob, - }, - }, - }, - }, server) - require.NoError(t, err) -} - -func TestGetObjectsToSynchronize_HappyPath_Glob(t *testing.T) { - server, s, ctrl, gitalyPool, _ := setupServer(t) - s.syncCount.(*mock_usage_metrics.MockCounter).EXPECT().Inc() - - objs := objectsYAML(t) - projInfo := projectInfo() - gomock.InOrder( - server.EXPECT(). - Send(matcher.ProtoEq(t, &rpc.ObjectsToSynchronizeResponse{ - Message: &rpc.ObjectsToSynchronizeResponse_Header_{ - Header: &rpc.ObjectsToSynchronizeResponse_Header{ - CommitId: revision, - ProjectId: projInfo.ProjectId, - }, - }, - })), - server.EXPECT(). - Send(matcher.ProtoEq(t, &rpc.ObjectsToSynchronizeResponse{ - Message: &rpc.ObjectsToSynchronizeResponse_Object_{ - Object: &rpc.ObjectsToSynchronizeResponse_Object{ - Source: "path/manifest.yaml", - Data: objs, - }, - }, - })), - server.EXPECT(). - Send(matcher.ProtoEq(t, &rpc.ObjectsToSynchronizeResponse{ - Message: &rpc.ObjectsToSynchronizeResponse_Trailer_{ - Trailer: &rpc.ObjectsToSynchronizeResponse_Trailer{}, - }, - })), - ) - p := mock_internalgitaly.NewMockPollerInterface(ctrl) - pf := mock_internalgitaly.NewMockPathFetcherInterface(ctrl) - gomock.InOrder( - gitalyPool.EXPECT(). - Poller(gomock.Any(), matcher.ProtoEq(nil, projInfo.GitalyInfo)). - Return(p, nil), - p.EXPECT(). - Poll(gomock.Any(), matcher.ProtoEq(nil, projInfo.Repository), "", "HEAD"). - Return(&gitaly.PollInfo{ - CommitId: revision, - UpdateAvailable: true, - }, nil), - gitalyPool.EXPECT(). - PathFetcher(gomock.Any(), matcher.ProtoEq(nil, projInfo.GitalyInfo)). - Return(pf, nil), - pf.EXPECT(). - Visit(gomock.Any(), matcher.ProtoEq(nil, projInfo.Repository), []byte(revision), []byte("path"), false, gomock.Any()). - Do(func(ctx context.Context, repo *gitalypb.Repository, revision, repoPath []byte, recursive bool, visitor gitaly.FetchVisitor) error { - download, maxSize, err := visitor.Entry(&gitalypb.TreeEntry{ - Path: []byte("path/manifest.yaml"), - Type: gitalypb.TreeEntry_BLOB, - CommitOid: manifestRevision, - }) - require.NoError(t, err) - assert.EqualValues(t, defaultGitopsMaxManifestFileSize, maxSize) - assert.True(t, download) - - done, err := visitor.StreamChunk([]byte("path/manifest.yaml"), objs) - require.NoError(t, err) - assert.False(t, done) - return nil - }), - ) - err := s.GetObjectsToSynchronize(&rpc.ObjectsToSynchronizeRequest{ - ProjectId: projectId, - Paths: []*rpc.PathCF{ - { - Path: &rpc.PathCF_Glob{ - Glob: "/path/*.yaml", - }, - }, - }, - }, server) - require.NoError(t, err) -} - -func TestGetObjectsToSynchronize_ResumeConnection(t *testing.T) { - server, s, ctrl, gitalyPool, _ := setupServer(t) - projInfo := projectInfo() - p := mock_internalgitaly.NewMockPollerInterface(ctrl) - gomock.InOrder( - gitalyPool.EXPECT(). - Poller(gomock.Any(), matcher.ProtoEq(nil, projInfo.GitalyInfo)). - Return(p, nil), - p.EXPECT(). - Poll(gomock.Any(), matcher.ProtoEq(nil, projInfo.Repository), revision, "HEAD"). - DoAndReturn(func(ctx context.Context, repo *gitalypb.Repository, lastProcessedCommitId, refName string) (*gitaly.PollInfo, error) { - return &gitaly.PollInfo{ - CommitId: revision, - UpdateAvailable: false, - }, nil - }), - ) - err := s.GetObjectsToSynchronize(&rpc.ObjectsToSynchronizeRequest{ - ProjectId: projectId, - CommitId: revision, - }, server) - require.NoError(t, err) -} - -func TestGetObjectsToSynchronize_UserErrors(t *testing.T) { - pathFetcherErrs := []struct { - errMsg string - err error - }{ - { - errMsg: "manifest file: NotFound: Bla: file/directory/ref not found: some/file", - err: gitaly.NewNotFoundError("Bla", "some/file"), - }, - { - errMsg: "manifest file: FileTooBig: Bla: file is too big: some/file", - err: gitaly.NewFileTooBigError(nil, "Bla", "some/file"), - }, - { - errMsg: "manifest file: UnexpectedTreeEntryType: Bla: file is not a usual file: some/file", - err: gitaly.NewUnexpectedTreeEntryTypeError("Bla", "some/file"), - }, - { - errMsg: "manifest file: path visited more than once: bla", - err: &gitaly.DuplicatePathFoundError{Path: "bla"}, - }, - { - errMsg: "manifest file: glob *.yaml match failed: bad glob", - err: &gitaly.GlobMatchFailedError{Cause: errors.New("bad glob"), Glob: "*.yaml"}, - }, - { - errMsg: "manifest file: maximum number of files limit reached: 10", - err: &gitaly.MaxNumberOfFilesError{MaxNumberOfFiles: 10}, - }, - } - for _, tc := range pathFetcherErrs { - t.Run(tc.errMsg, func(t *testing.T) { - server, s, ctrl, gitalyPool, mockRpcApi := setupServer(t) - - projInfo := projectInfo() - server.EXPECT(). - Send(matcher.ProtoEq(t, &rpc.ObjectsToSynchronizeResponse{ - Message: &rpc.ObjectsToSynchronizeResponse_Header_{ - Header: &rpc.ObjectsToSynchronizeResponse_Header{ - CommitId: revision, - ProjectId: projInfo.ProjectId, - }, - }, - })) - mockRpcApi.EXPECT(). - HandleProcessingError(gomock.Any(), testhelpers.AgentId, "GitOps: failed to get objects to synchronize", - matcher.ErrorEq(tc.errMsg)) - p := mock_internalgitaly.NewMockPollerInterface(ctrl) - pf := mock_internalgitaly.NewMockPathFetcherInterface(ctrl) - gomock.InOrder( - gitalyPool.EXPECT(). - Poller(gomock.Any(), matcher.ProtoEq(nil, projInfo.GitalyInfo)). - Return(p, nil), - p.EXPECT(). - Poll(gomock.Any(), matcher.ProtoEq(nil, projInfo.Repository), "", "HEAD"). - Return(&gitaly.PollInfo{ - CommitId: revision, - UpdateAvailable: true, - }, nil), - gitalyPool.EXPECT(). - PathFetcher(gomock.Any(), matcher.ProtoEq(nil, projInfo.GitalyInfo)). - Return(pf, nil), - pf.EXPECT(). - Visit(gomock.Any(), matcher.ProtoEq(nil, projInfo.Repository), []byte(revision), []byte("."), true, gomock.Any()). - Return(tc.err), - ) - err := s.GetObjectsToSynchronize(&rpc.ObjectsToSynchronizeRequest{ - ProjectId: projectId, - Paths: []*rpc.PathCF{ - { - Path: &rpc.PathCF_Glob{ - Glob: defaultGitOpsManifestPathGlob, - }, - }, - }, - }, server) - assert.EqualError(t, err, fmt.Sprintf("rpc error: code = FailedPrecondition desc = GitOps: failed to get objects to synchronize: %s", tc.errMsg)) - }) - } -} - -func TestGetObjectsToSynchronize_RefNotFound(t *testing.T) { - server, s, ctrl, gitalyPool, _ := setupServer(t) - projInfo := projectInfo() - p := mock_internalgitaly.NewMockPollerInterface(ctrl) - gomock.InOrder( - gitalyPool.EXPECT(). - Poller(gomock.Any(), matcher.ProtoEq(nil, projInfo.GitalyInfo)). - Return(p, nil), - p.EXPECT(). - Poll(gomock.Any(), matcher.ProtoEq(nil, projInfo.Repository), "", "HEAD"). - Return(nil, gitaly.NewNotFoundError("Bla", "some/ref")), - ) - err := s.GetObjectsToSynchronize(&rpc.ObjectsToSynchronizeRequest{ - ProjectId: projectId, - Paths: []*rpc.PathCF{ - { - Path: &rpc.PathCF_Glob{ - Glob: defaultGitOpsManifestPathGlob, - }, - }, - }, - }, server) - require.EqualError(t, err, "rpc error: code = NotFound desc = GitOps: repository poll failed: NotFound: Bla: file/directory/ref not found: some/ref") -} - -func projectInfoRest() *gapi.GetProjectInfoResponse { - return &gapi.GetProjectInfoResponse{ - ProjectId: 234, - GitalyInfo: &entity.GitalyInfo{ - Address: "127.0.0.1:321321", - Token: "cba", - Features: map[string]string{ - "bla": "false", - }, - }, - GitalyRepository: &entity.GitalyRepository{ - StorageName: "234", - RelativePath: "123", - GitObjectDirectory: "sfasdf", - GitAlternateObjectDirectories: []string{"a", "b"}, - GlRepository: "254634", - GlProjectPath: "64662", - }, - DefaultBranch: "main", - } -} - -func projectInfo() *api.ProjectInfo { - rest := projectInfoRest() - return &api.ProjectInfo{ - ProjectId: rest.ProjectId, - GitalyInfo: rest.GitalyInfo, - Repository: rest.GitalyRepository.ToGitalyRepository(), - DefaultBranch: rest.DefaultBranch, - } -} - -func setupServer(t *testing.T) (*mock_rpc.MockGitops_GetObjectsToSynchronizeServer, *server, *gomock.Controller, *mock_internalgitaly.MockPoolInterface, *mock_modserver.MockAgentRpcApi) { - var traceId trace.TraceID - ctx, s, ctrl, mockRpcApi, gitalyPool := setupServerWithAgentInfo(t, func(w http.ResponseWriter, r *http.Request) { - testhelpers.AssertGetJsonRequestIsCorrect(t, r, traceId) - assert.Equal(t, projectId, r.URL.Query().Get(gapi.ProjectIdQueryParam)) - testhelpers.RespondWithJSON(t, w, projectInfoRest()) - }) - ctx, traceId = testhelpers.InjectSpanContext(t, ctx) - - server := mock_rpc.NewMockGitops_GetObjectsToSynchronizeServer(ctrl) - server.EXPECT(). - Context(). - Return(ctx). - MinTimes(1) - - return server, s, ctrl, gitalyPool, mockRpcApi -} - -func setupServerWithAgentInfo(t *testing.T, handler func(http.ResponseWriter, *http.Request)) (context.Context, *server, *gomock.Controller, *mock_modserver.MockAgentRpcApi, *mock_internalgitaly.MockPoolInterface) { - ctx, s, ctrl, mockRpcApi, gitalyPool := setupServerBare(t, 1, handler) - agentInfo := testhelpers.AgentInfoObj() - mockRpcApi.EXPECT(). - AgentInfo(gomock.Any(), gomock.Any()). - Return(agentInfo, nil) - return ctx, s, ctrl, mockRpcApi, gitalyPool -} - -func setupServerBare(t *testing.T, pollTimes int, handler func(http.ResponseWriter, *http.Request)) (context.Context, *server, *gomock.Controller, *mock_modserver.MockAgentRpcApi, *mock_internalgitaly.MockPoolInterface) { - ctrl := gomock.NewController(t) - client := rmock.NewClient(ctrl) - gitalyPool := mock_internalgitaly.NewMockPoolInterface(ctrl) - mockRpcApi := mock_modserver.NewMockAgentRpcApiWithMockPoller(ctrl, pollTimes) - mockApi := mock_modserver.NewMockApi(ctrl) - ctx := mock_modserver.IncomingAgentCtx(t, mockRpcApi) - usageTracker := mock_usage_metrics.NewMockUsageTrackerInterface(ctrl) - usageTracker.EXPECT(). - RegisterCounter(gitopsSyncCountKnownMetric). - Return(mock_usage_metrics.NewMockCounter(ctrl)) - mockApi.EXPECT().OnGitPushEvent(gomock.Any(), gomock.Any()).AnyTimes() - - config := &kascfg.ConfigurationFile{} - ApplyDefaults(config) - config.Agent.Gitops.ProjectInfoCacheTtl = durationpb.New(0) - config.Agent.Gitops.ProjectInfoCacheErrorTtl = durationpb.New(0) - s := newServerFromConfig(&modserver.Config{ - Log: zaptest.NewLogger(t), - Api: mockApi, - Config: config, - GitLabClient: mock_gitlab.SetupClient(t, gapi.ProjectInfoApiPath, handler), - Registerer: prometheus.NewPedanticRegistry(), - UsageTracker: usageTracker, - Gitaly: gitalyPool, - TraceProvider: trace.NewNoopTracerProvider(), - RedisClient: client, - }) - return ctx, s, ctrl, mockRpcApi, gitalyPool -} - -func objectsYAML(t *testing.T) []byte { - objects := []runtime.Object{ - &corev1.ConfigMap{ - TypeMeta: metav1.TypeMeta{ - Kind: "ConfigMap", - APIVersion: "v1", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "map1", - }, - Data: map[string]string{ - "key": "value", - }, - }, - &corev1.Namespace{ - TypeMeta: metav1.TypeMeta{ - Kind: "Namespace", - APIVersion: "v1", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "ns1", - }, - }, - } - return kube_testing.ObjsToYAML(t, objects...) -} diff --git a/internal/module/gitops/server/visitor.go b/internal/module/gitops/server/visitor.go deleted file mode 100644 index 51fddacc..00000000 --- a/internal/module/gitops/server/visitor.go +++ /dev/null @@ -1,34 +0,0 @@ -package server - -import ( - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/gitalypb" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/gitops/rpc" -) - -type objectsToSynchronizeVisitor struct { - server rpc.Gitops_GetObjectsToSynchronizeServer - fileSizeLimit int64 - sendFailed bool -} - -func (v *objectsToSynchronizeVisitor) Entry(entry *gitalypb.TreeEntry) (bool /* download? */, int64 /* max size */, error) { - return true, v.fileSizeLimit, nil -} - -func (v *objectsToSynchronizeVisitor) StreamChunk(path []byte, data []byte) (bool /* done? */, error) { - err := v.server.Send(&rpc.ObjectsToSynchronizeResponse{ - Message: &rpc.ObjectsToSynchronizeResponse_Object_{ - Object: &rpc.ObjectsToSynchronizeResponse_Object{ - Source: string(path), - Data: data, - }, - }, - }) - if err != nil { - v.sendFailed = true - } - return false, err -} - -func (v *objectsToSynchronizeVisitor) EntryDone(entry *gitalypb.TreeEntry, err error) { -} diff --git a/internal/module/gitops/server/visitor_test.go b/internal/module/gitops/server/visitor_test.go deleted file mode 100644 index 8598ca16..00000000 --- a/internal/module/gitops/server/visitor_test.go +++ /dev/null @@ -1,69 +0,0 @@ -package server - -import ( - "errors" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/gitalypb" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/gitops/rpc" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/matcher" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/mock_rpc" - "go.uber.org/mock/gomock" -) - -var ( - _ gitaly.FetchVisitor = &objectsToSynchronizeVisitor{} -) - -func TestObjectsToSynchronizeVisitor(t *testing.T) { - p := "asdasd" - data := []byte{1, 2, 3} - ctrl := gomock.NewController(t) - server := mock_rpc.NewMockGitops_GetObjectsToSynchronizeServer(ctrl) - server.EXPECT(). - Send(matcher.ProtoEq(t, &rpc.ObjectsToSynchronizeResponse{ - Message: &rpc.ObjectsToSynchronizeResponse_Object_{ - Object: &rpc.ObjectsToSynchronizeResponse_Object{ - Source: p, - Data: data, - }, - }, - })) - - v := objectsToSynchronizeVisitor{ - server: server, - fileSizeLimit: 100, - } - download, maxSize, err := v.Entry(&gitalypb.TreeEntry{ - Path: []byte(p), - }) - require.NoError(t, err) - assert.EqualValues(t, 100, maxSize) - assert.True(t, download) - - done, err := v.StreamChunk([]byte(p), data) - require.NoError(t, err) - assert.False(t, done) - assert.False(t, v.sendFailed) -} - -func TestObjectsToSynchronizeVisitor_Error(t *testing.T) { - p := "asdasd" - data := []byte{1, 2, 3} - ctrl := gomock.NewController(t) - server := mock_rpc.NewMockGitops_GetObjectsToSynchronizeServer(ctrl) - server.EXPECT(). - Send(gomock.Any()). - Return(errors.New("expected error")) - - v := objectsToSynchronizeVisitor{ - server: server, - fileSizeLimit: 100, - } - _, err := v.StreamChunk([]byte(p), data) - require.EqualError(t, err, "expected error") - assert.True(t, v.sendFailed) -} diff --git a/internal/module/modserver/api.go b/internal/module/modserver/api.go index a4c12064..4d83f4b2 100644 --- a/internal/module/modserver/api.go +++ b/internal/module/modserver/api.go @@ -5,7 +5,6 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/redis/rueidis" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly" "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitlab" "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/modshared" "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/observability" @@ -64,7 +63,6 @@ type Config struct { // Agent Id must be specified in the request metadata in RoutingAgentIdMetadataKey field. // Make sure factory returns modshared.ModuleStartAfterServers if module uses this connection. AgentConn grpc.ClientConnInterface - Gitaly gitaly.PoolInterface TraceProvider trace.TracerProvider TracePropagator propagation.TextMapPropagator MeterProvider metric.MeterProvider diff --git a/pkg/entity/entity_extra.go b/pkg/entity/entity_extra.go deleted file mode 100644 index 5b65f67a..00000000 --- a/pkg/entity/entity_extra.go +++ /dev/null @@ -1,16 +0,0 @@ -package entity - -import ( - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/gitalypb" -) - -func (r *GitalyRepository) ToGitalyRepository() *gitalypb.Repository { - return &gitalypb.Repository{ - StorageName: r.StorageName, - RelativePath: r.RelativePath, - GitObjectDirectory: r.GitObjectDirectory, - GitAlternateObjectDirectories: r.GitAlternateObjectDirectories, - GlRepository: r.GlRepository, - GlProjectPath: r.GlProjectPath, - } -} From 85f8032baa617a6243b3969a414a4ed5fc5912d9 Mon Sep 17 00:00:00 2001 From: Lukasz Zajaczkowski Date: Fri, 20 Oct 2023 09:52:21 +0200 Subject: [PATCH 2/2] cleanup --- cmd/agentk/agentkapp/app.go | 2 - cmd/kas/kasapp/configured_app.go | 122 +------------------------------ cmd/kas/kasapp/defaulting.go | 5 -- 3 files changed, 2 insertions(+), 127 deletions(-) diff --git a/cmd/agentk/agentkapp/app.go b/cmd/agentk/agentkapp/app.go index ec1d118d..c770e9a1 100644 --- a/cmd/agentk/agentkapp/app.go +++ b/cmd/agentk/agentkapp/app.go @@ -23,7 +23,6 @@ import ( agent_registrar_agent "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/agent_registrar/agent" flux_agent "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/flux/agent" gitlab_access_rpc "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/gitlab_access/rpc" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/gitops/agent/manifestops" google_profiler_agent "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/google_profiler/agent" kubernetes_api_agent "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/kubernetes_api/agent" "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/modagent" @@ -270,7 +269,6 @@ func (a *App) constructModules(internalServer *grpc.Server, kasConn, internalSer KeyFile: a.ObservabilityKeyFile, }, &google_profiler_agent.Factory{}, - &manifestops.Factory{}, &starboard_vulnerability.Factory{}, &reverse_tunnel_agent.Factory{ InternalServerConn: internalServerConn, diff --git a/cmd/kas/kasapp/configured_app.go b/cmd/kas/kasapp/configured_app.go index ab702386..1df34c6d 100644 --- a/cmd/kas/kasapp/configured_app.go +++ b/cmd/kas/kasapp/configured_app.go @@ -19,7 +19,6 @@ import ( "github.com/prometheus/client_golang/prometheus/collectors" "github.com/redis/rueidis" "github.com/redis/rueidis/rueidisotel" - "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp" @@ -36,23 +35,19 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/credentials" _ "google.golang.org/grpc/encoding/gzip" // Install the gzip compressor - "google.golang.org/grpc/stats" + "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/cmd" "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/cmd/kas/kasapp/fake" "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/api" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitaly/vendored/client" "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitlab" gapi "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/gitlab/api" agent_configuration_server "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/agent_configuration/server" agent_registrar_server "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/agent_registrar/server" "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/agent_tracker" agent_tracker_server "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/agent_tracker/server" - configuration_project_server "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/configuration_project/server" flux_server "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/flux/server" gitlab_access_server "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/gitlab_access/server" - gitops_server "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/gitops/server" google_profiler_server "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/google_profiler/server" kubernetes_api_server "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/kubernetes_api/server" "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/modserver" @@ -62,8 +57,6 @@ import ( observability_server "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/observability/server" reverse_tunnel_server "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/reverse_tunnel/server" "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/reverse_tunnel/tunnel" - "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/usage_metrics" - usage_metrics_server "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/usage_metrics/server" "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/cache" "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/errz" "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/grpctool" @@ -76,22 +69,6 @@ import ( "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/retry" "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/tlstool" "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/pkg/kascfg" - "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" - "go.opentelemetry.io/otel/attribute" - "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp" - promexp "go.opentelemetry.io/otel/exporters/prometheus" - otelmetric "go.opentelemetry.io/otel/metric" - "go.opentelemetry.io/otel/propagation" - metricsdk "go.opentelemetry.io/otel/sdk/metric" - "go.opentelemetry.io/otel/sdk/resource" - tracesdk "go.opentelemetry.io/otel/sdk/trace" - semconv "go.opentelemetry.io/otel/semconv/v1.21.0" - "go.opentelemetry.io/otel/trace" - "go.uber.org/zap" - "golang.org/x/time/rate" - "google.golang.org/grpc" - "google.golang.org/grpc/credentials" - _ "google.golang.org/grpc/encoding/gzip" // Install the gzip compressor ) const ( @@ -251,16 +228,6 @@ func (a *ConfiguredApp) Run(ctx context.Context) (retErr error) { // Agent tracker agentTracker := a.constructAgentTracker(errRep, redisClient) - // Usage tracker - usageTracker := usage_metrics.NewUsageTracker() - - // Gitaly client - gitalyClientPool, err := a.constructGitalyPool(csh, dt, dm, tp, mp, p, streamClientProm, unaryClientProm) - if err != nil { - return err - } - defer errz.SafeClose(gitalyClientPool, &retErr) - // Module factories factories := []modserver.Factory{ &observability_server.Factory{ @@ -270,16 +237,11 @@ func (a *ConfiguredApp) Run(ctx context.Context) (retErr error) { &agent_configuration_server.Factory{ AgentRegisterer: agentTracker, }, - &configuration_project_server.Factory{}, ¬ifications_server.Factory{ PublishEvent: srvApi.publishEvent, SubscribeToEvents: srvApi.subscribeToEvents, }, &flux_server.Factory{}, - &gitops_server.Factory{}, - &usage_metrics_server.Factory{ - UsageTracker: usageTracker, - }, &gitlab_access_server.Factory{}, &agent_registrar_server.Factory{ AgentRegisterer: agentTracker, @@ -293,10 +255,6 @@ func (a *ConfiguredApp) Run(ctx context.Context) (retErr error) { &kubernetes_api_server.Factory{}, } - // Construct modules - poolWrapper := &gitaly.Pool{ - ClientPool: gitalyClientPool, - } var beforeServersModules, afterServersModules []modserver.Module for _, factory := range factories { // factory.New() must be called from the main goroutine because it may mutate a gRPC server (register an API) @@ -308,12 +266,10 @@ func (a *ConfiguredApp) Run(ctx context.Context) (retErr error) { Config: a.Configuration, GitLabClient: gitLabClient, Registerer: reg, - UsageTracker: usageTracker, AgentServer: agentSrv.server, ApiServer: apiSrv.server, RegisterAgentApi: kasToAgentRouter.RegisterAgentApi, AgentConn: internalSrv.inMemConn, - Gitaly: poolWrapper, TraceProvider: tp, TracePropagator: p, MeterProvider: mp, @@ -525,81 +481,7 @@ func (a *ConfiguredApp) constructGitLabClient(dt trace.Tracer, dm otelmetric.Met ), nil } -func (a *ConfiguredApp) constructGitalyPool(csh stats.Handler, dt trace.Tracer, dm otelmetric.Meter, - tp trace.TracerProvider, mp otelmetric.MeterProvider, - p propagation.TextMapPropagator, streamClientProm grpc.StreamClientInterceptor, unaryClientProm grpc.UnaryClientInterceptor) (*client.Pool, error) { - g := a.Configuration.Gitaly - var globalGitalyRpcLimiter grpctool.ClientLimiter - globalGitalyRpcLimiter = rate.NewLimiter( - rate.Limit(g.GlobalApiRateLimit.RefillRatePerSecond), - int(g.GlobalApiRateLimit.BucketSize), - ) - globalGitalyRpcLimiter, err := metric.NewWaitLimiterInstrumentation( - "gitaly_client_global", - g.GlobalApiRateLimit.RefillRatePerSecond, - "{refill/s}", - dt, - dm, - globalGitalyRpcLimiter, - ) - if err != nil { - return nil, err - } - return client.NewPoolWithOptions( - client.WithDialOptions( - grpc.WithUserAgent(kasServerName()), - grpc.WithStatsHandler(csh), - grpc.WithStatsHandler(otelgrpc.NewServerHandler( - otelgrpc.WithTracerProvider(tp), - otelgrpc.WithMeterProvider(mp), - otelgrpc.WithPropagators(p), - otelgrpc.WithMessageEvents(otelgrpc.ReceivedEvents, otelgrpc.SentEvents), - )), - grpc.WithSharedWriteBuffer(true), - // In https://gitlab.com/groups/gitlab-org/-/epics/8971, we added DNS discovery support to Praefect. This was - // done by making two changes: - // - Configure client-side round-robin load-balancing in client dial options. We added that as a default option - // inside gitaly client in gitaly client since v15.9.0 - // - Configure DNS resolving. Due to some technical limitations, we don't use gRPC's built-in DNS resolver. - // Instead, we implement our own DNS resolver. This resolver is exposed via the following configuration. - // Afterward, workhorse can detect and handle DNS discovery automatically. The user needs to setup and set - // Gitaly address to something like "dns:gitaly.service.dc1.consul" - client.WithGitalyDNSResolver(client.DefaultDNSResolverBuilderConfig()), - // Don't put interceptors here as order is important. Put them below. - ), - client.WithDialer(func(ctx context.Context, address string, dialOptions []grpc.DialOption) (*grpc.ClientConn, error) { - var perServerGitalyRpcLimiter grpctool.ClientLimiter - perServerGitalyRpcLimiter = rate.NewLimiter( - rate.Limit(g.PerServerApiRateLimit.RefillRatePerSecond), - int(g.PerServerApiRateLimit.BucketSize)) - perServerGitalyRpcLimiter, err := metric.NewWaitLimiterInstrumentation( - "gitaly_client_"+address, - g.GlobalApiRateLimit.RefillRatePerSecond, - "{refill/s}", - dt, - dm, - perServerGitalyRpcLimiter, - ) - if err != nil { - return nil, err - } - opts := []grpc.DialOption{ - grpc.WithChainStreamInterceptor( - streamClientProm, - grpctool.StreamClientLimitingInterceptor(globalGitalyRpcLimiter), - grpctool.StreamClientLimitingInterceptor(perServerGitalyRpcLimiter), - ), - grpc.WithChainUnaryInterceptor( - unaryClientProm, - grpctool.UnaryClientLimitingInterceptor(globalGitalyRpcLimiter), - grpctool.UnaryClientLimitingInterceptor(perServerGitalyRpcLimiter), - ), - } - opts = append(opts, dialOptions...) - return client.DialContext(ctx, address, opts) - }), - ), nil -} + func (a *ConfiguredApp) constructRedisClient(tp trace.TracerProvider, mp otelmetric.MeterProvider) (rueidis.Client, error) { cfg := a.Configuration.Redis diff --git a/cmd/kas/kasapp/defaulting.go b/cmd/kas/kasapp/defaulting.go index 5cfdbfb0..c23f6dee 100644 --- a/cmd/kas/kasapp/defaulting.go +++ b/cmd/kas/kasapp/defaulting.go @@ -54,11 +54,6 @@ var ( observability_server.ApplyDefaults, google_profiler_server.ApplyDefaults, agent_configuration_server.ApplyDefaults, -<<<<<<< HEAD - gitops_server.ApplyDefaults, -======= - usage_metrics_server.ApplyDefaults, ->>>>>>> ee890343 (cleanup gitops) kubernetes_api_server.ApplyDefaults, } )