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

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Chandler <wchandler@gitlab.com>2024-01-22 21:48:54 +0300
committerGitLab <noreply@gitlab.com>2024-01-22 21:48:54 +0300
commite9a4b66eee03f8ee8be751155b9ca5f5f801a17c (patch)
tree3dacce1c0a3542d6f6cc37708ce46d81c9cd979f /proto/go/gitalypb/cleanup_grpc.pb.go
parent393446e5fbde1f6ff140e2fd3a525c1abfbe5010 (diff)
parent992753dca25886085bc3c4815a0bd760e5dc4e0f (diff)
Merge branch 'wc/filter-repo' into 'master'
cleanup: Add RewriteHistory RPC See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6615 Merged-by: Will Chandler <wchandler@gitlab.com> Approved-by: karthik nayak <knayak@gitlab.com> Reviewed-by: Patrick Steinhardt <psteinhardt@gitlab.com> Reviewed-by: Will Chandler <wchandler@gitlab.com> Reviewed-by: karthik nayak <knayak@gitlab.com>
Diffstat (limited to 'proto/go/gitalypb/cleanup_grpc.pb.go')
-rw-r--r--proto/go/gitalypb/cleanup_grpc.pb.go98
1 files changed, 98 insertions, 0 deletions
diff --git a/proto/go/gitalypb/cleanup_grpc.pb.go b/proto/go/gitalypb/cleanup_grpc.pb.go
index 4d42e293e..a9b1d2c62 100644
--- a/proto/go/gitalypb/cleanup_grpc.pb.go
+++ b/proto/go/gitalypb/cleanup_grpc.pb.go
@@ -24,6 +24,21 @@ const _ = grpc.SupportPackageIsVersion7
type CleanupServiceClient interface {
// ApplyBfgObjectMapStream ...
ApplyBfgObjectMapStream(ctx context.Context, opts ...grpc.CallOption) (CleanupService_ApplyBfgObjectMapStreamClient, error)
+ // RewriteHistory redacts targeted strings and deletes requested blobs in a
+ // repository and updates all references to point to the rewritten commit
+ // history. This is useful for removing inadvertently pushed secrets from your
+ // repository and purging large blobs. This is a dangerous operation.
+ //
+ // The following known error conditions may happen:
+ //
+ // - `InvalidArgument` in the following situations:
+ // - The provided repository can't be validated.
+ // - The repository field is set on any request other than the initial one.
+ // - Any request, including the initial one, does not contain either blobs to
+ // remove or redaction patterns to redact.
+ // - A blob object ID is invalid.
+ // - A redaction pattern contains a newline character.
+ RewriteHistory(ctx context.Context, opts ...grpc.CallOption) (CleanupService_RewriteHistoryClient, error)
}
type cleanupServiceClient struct {
@@ -65,12 +80,61 @@ func (x *cleanupServiceApplyBfgObjectMapStreamClient) Recv() (*ApplyBfgObjectMap
return m, nil
}
+func (c *cleanupServiceClient) RewriteHistory(ctx context.Context, opts ...grpc.CallOption) (CleanupService_RewriteHistoryClient, error) {
+ stream, err := c.cc.NewStream(ctx, &CleanupService_ServiceDesc.Streams[1], "/gitaly.CleanupService/RewriteHistory", opts...)
+ if err != nil {
+ return nil, err
+ }
+ x := &cleanupServiceRewriteHistoryClient{stream}
+ return x, nil
+}
+
+type CleanupService_RewriteHistoryClient interface {
+ Send(*RewriteHistoryRequest) error
+ CloseAndRecv() (*RewriteHistoryResponse, error)
+ grpc.ClientStream
+}
+
+type cleanupServiceRewriteHistoryClient struct {
+ grpc.ClientStream
+}
+
+func (x *cleanupServiceRewriteHistoryClient) Send(m *RewriteHistoryRequest) error {
+ return x.ClientStream.SendMsg(m)
+}
+
+func (x *cleanupServiceRewriteHistoryClient) CloseAndRecv() (*RewriteHistoryResponse, error) {
+ if err := x.ClientStream.CloseSend(); err != nil {
+ return nil, err
+ }
+ m := new(RewriteHistoryResponse)
+ if err := x.ClientStream.RecvMsg(m); err != nil {
+ return nil, err
+ }
+ return m, nil
+}
+
// CleanupServiceServer is the server API for CleanupService service.
// All implementations must embed UnimplementedCleanupServiceServer
// for forward compatibility
type CleanupServiceServer interface {
// ApplyBfgObjectMapStream ...
ApplyBfgObjectMapStream(CleanupService_ApplyBfgObjectMapStreamServer) error
+ // RewriteHistory redacts targeted strings and deletes requested blobs in a
+ // repository and updates all references to point to the rewritten commit
+ // history. This is useful for removing inadvertently pushed secrets from your
+ // repository and purging large blobs. This is a dangerous operation.
+ //
+ // The following known error conditions may happen:
+ //
+ // - `InvalidArgument` in the following situations:
+ // - The provided repository can't be validated.
+ // - The repository field is set on any request other than the initial one.
+ // - Any request, including the initial one, does not contain either blobs to
+ // remove or redaction patterns to redact.
+ // - A blob object ID is invalid.
+ // - A redaction pattern contains a newline character.
+ RewriteHistory(CleanupService_RewriteHistoryServer) error
mustEmbedUnimplementedCleanupServiceServer()
}
@@ -81,6 +145,9 @@ type UnimplementedCleanupServiceServer struct {
func (UnimplementedCleanupServiceServer) ApplyBfgObjectMapStream(CleanupService_ApplyBfgObjectMapStreamServer) error {
return status.Errorf(codes.Unimplemented, "method ApplyBfgObjectMapStream not implemented")
}
+func (UnimplementedCleanupServiceServer) RewriteHistory(CleanupService_RewriteHistoryServer) error {
+ return status.Errorf(codes.Unimplemented, "method RewriteHistory not implemented")
+}
func (UnimplementedCleanupServiceServer) mustEmbedUnimplementedCleanupServiceServer() {}
// UnsafeCleanupServiceServer may be embedded to opt out of forward compatibility for this service.
@@ -120,6 +187,32 @@ func (x *cleanupServiceApplyBfgObjectMapStreamServer) Recv() (*ApplyBfgObjectMap
return m, nil
}
+func _CleanupService_RewriteHistory_Handler(srv interface{}, stream grpc.ServerStream) error {
+ return srv.(CleanupServiceServer).RewriteHistory(&cleanupServiceRewriteHistoryServer{stream})
+}
+
+type CleanupService_RewriteHistoryServer interface {
+ SendAndClose(*RewriteHistoryResponse) error
+ Recv() (*RewriteHistoryRequest, error)
+ grpc.ServerStream
+}
+
+type cleanupServiceRewriteHistoryServer struct {
+ grpc.ServerStream
+}
+
+func (x *cleanupServiceRewriteHistoryServer) SendAndClose(m *RewriteHistoryResponse) error {
+ return x.ServerStream.SendMsg(m)
+}
+
+func (x *cleanupServiceRewriteHistoryServer) Recv() (*RewriteHistoryRequest, error) {
+ m := new(RewriteHistoryRequest)
+ if err := x.ServerStream.RecvMsg(m); err != nil {
+ return nil, err
+ }
+ return m, nil
+}
+
// CleanupService_ServiceDesc is the grpc.ServiceDesc for CleanupService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
@@ -134,6 +227,11 @@ var CleanupService_ServiceDesc = grpc.ServiceDesc{
ServerStreams: true,
ClientStreams: true,
},
+ {
+ StreamName: "RewriteHistory",
+ Handler: _CleanupService_RewriteHistory_Handler,
+ ClientStreams: true,
+ },
},
Metadata: "cleanup.proto",
}