Skip to content
Snippets Groups Projects
Commit 191511a0 authored by Jacob Vosmaer (GitLab)'s avatar Jacob Vosmaer (GitLab)
Browse files

Revert to previous info-refs protocol

parent 1d4fb881
No related branches found
No related tags found
1 merge request!7Revert info refs change
Loading
Loading
@@ -4,15 +4,6 @@ package gitaly;
 
import "shared.proto";
 
// The Git 'smart HTTP' protocol
service SmartHTTP {
// The response body for GET /info/refs?service=git-upload-pack
rpc InfoRefsUploadPack(InfoRefsUploadPackRequest) returns (stream InfoRefsUploadPackResponse) {}
// The response body for GET /info/refs?service=git-receive-pack
rpc InfoRefsReceivePack(InfoRefsReceivePackRequest) returns (stream InfoRefsReceivePackResponse) {}
}
service Notifications {
rpc PostReceive(PostReceiveRequest) returns (PostReceiveResponse) {}
}
Loading
Loading
@@ -30,14 +21,6 @@ service Diff {
rpc CommitDiff(CommitDiffRequest) returns (stream CommitDiffResponse) {};
}
 
message InfoRefsUploadPackRequest {
Repository repository = 1;
}
message InfoRefsReceivePackRequest {
Repository repository = 1;
}
service Commit {
rpc CommitIsAncestor(CommitIsAncestorRequest) returns (CommitIsAncestorResponse) {}
}
Loading
Loading
@@ -46,14 +29,6 @@ message CommitIsAncestorResponse {
bool value = 1;
}
 
message InfoRefsUploadPackResponse {
bytes data = 1;
}
message InfoRefsReceivePackResponse {
bytes data = 1;
}
message PostReceiveRequest {
Repository repository = 1;
}
Loading
Loading
This diff is collapsed.
Loading
Loading
@@ -2,31 +2,28 @@ package helper
 
import (
"io"
pb "gitlab.com/gitlab-org/gitaly-proto/go"
)
 
type DataGetter interface {
GetData() []byte
type InfoRefsClient interface {
Recv() (*pb.InfoRefsResponse, error)
}
 
func DataWithError(dg DataGetter, err error) ([]byte, error) {
return dg.GetData(), err
type InfoRefsClientWriterTo struct {
InfoRefsClient
}
 
// Example use:
//
// BytesReceiver(func() ([]byte, error) { DataWithError(c.Recv()) }).WriteTo(writer)
type BytesReceiver func() ([]byte, error)
func (br BytesReceiver) WriteTo(w io.Writer) (total int64, err error) {
func (clientReader *InfoRefsClientWriterTo) WriteTo(w io.Writer) (total int64, err error) {
for {
b, err := br()
response, err := clientReader.Recv()
if err == io.EOF {
return total, nil
} else if err != nil {
return total, err
}
 
n, err := w.Write(b)
n, err := w.Write(response.GetData())
total += int64(n)
if err != nil {
return total, err
Loading
Loading
// Code generated by protoc-gen-go.
// source: smarthttp.proto
// DO NOT EDIT!
package gitaly
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
type InfoRefsRequest struct {
Repository *Repository `protobuf:"bytes,1,opt,name=repository" json:"repository,omitempty"`
}
func (m *InfoRefsRequest) Reset() { *m = InfoRefsRequest{} }
func (m *InfoRefsRequest) String() string { return proto.CompactTextString(m) }
func (*InfoRefsRequest) ProtoMessage() {}
func (*InfoRefsRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} }
func (m *InfoRefsRequest) GetRepository() *Repository {
if m != nil {
return m.Repository
}
return nil
}
type InfoRefsResponse struct {
Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
}
func (m *InfoRefsResponse) Reset() { *m = InfoRefsResponse{} }
func (m *InfoRefsResponse) String() string { return proto.CompactTextString(m) }
func (*InfoRefsResponse) ProtoMessage() {}
func (*InfoRefsResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{1} }
func (m *InfoRefsResponse) GetData() []byte {
if m != nil {
return m.Data
}
return nil
}
func init() {
proto.RegisterType((*InfoRefsRequest)(nil), "gitaly.InfoRefsRequest")
proto.RegisterType((*InfoRefsResponse)(nil), "gitaly.InfoRefsResponse")
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// Client API for SmartHTTP service
type SmartHTTPClient interface {
// The response body for GET /info/refs?service=git-upload-pack
InfoRefsUploadPack(ctx context.Context, in *InfoRefsRequest, opts ...grpc.CallOption) (SmartHTTP_InfoRefsUploadPackClient, error)
// The response body for GET /info/refs?service=git-receive-pack
InfoRefsReceivePack(ctx context.Context, in *InfoRefsRequest, opts ...grpc.CallOption) (SmartHTTP_InfoRefsReceivePackClient, error)
}
type smartHTTPClient struct {
cc *grpc.ClientConn
}
func NewSmartHTTPClient(cc *grpc.ClientConn) SmartHTTPClient {
return &smartHTTPClient{cc}
}
func (c *smartHTTPClient) InfoRefsUploadPack(ctx context.Context, in *InfoRefsRequest, opts ...grpc.CallOption) (SmartHTTP_InfoRefsUploadPackClient, error) {
stream, err := grpc.NewClientStream(ctx, &_SmartHTTP_serviceDesc.Streams[0], c.cc, "/gitaly.SmartHTTP/InfoRefsUploadPack", opts...)
if err != nil {
return nil, err
}
x := &smartHTTPInfoRefsUploadPackClient{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 SmartHTTP_InfoRefsUploadPackClient interface {
Recv() (*InfoRefsResponse, error)
grpc.ClientStream
}
type smartHTTPInfoRefsUploadPackClient struct {
grpc.ClientStream
}
func (x *smartHTTPInfoRefsUploadPackClient) Recv() (*InfoRefsResponse, error) {
m := new(InfoRefsResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *smartHTTPClient) InfoRefsReceivePack(ctx context.Context, in *InfoRefsRequest, opts ...grpc.CallOption) (SmartHTTP_InfoRefsReceivePackClient, error) {
stream, err := grpc.NewClientStream(ctx, &_SmartHTTP_serviceDesc.Streams[1], c.cc, "/gitaly.SmartHTTP/InfoRefsReceivePack", opts...)
if err != nil {
return nil, err
}
x := &smartHTTPInfoRefsReceivePackClient{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 SmartHTTP_InfoRefsReceivePackClient interface {
Recv() (*InfoRefsResponse, error)
grpc.ClientStream
}
type smartHTTPInfoRefsReceivePackClient struct {
grpc.ClientStream
}
func (x *smartHTTPInfoRefsReceivePackClient) Recv() (*InfoRefsResponse, error) {
m := new(InfoRefsResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// Server API for SmartHTTP service
type SmartHTTPServer interface {
// The response body for GET /info/refs?service=git-upload-pack
InfoRefsUploadPack(*InfoRefsRequest, SmartHTTP_InfoRefsUploadPackServer) error
// The response body for GET /info/refs?service=git-receive-pack
InfoRefsReceivePack(*InfoRefsRequest, SmartHTTP_InfoRefsReceivePackServer) error
}
func RegisterSmartHTTPServer(s *grpc.Server, srv SmartHTTPServer) {
s.RegisterService(&_SmartHTTP_serviceDesc, srv)
}
func _SmartHTTP_InfoRefsUploadPack_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(InfoRefsRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(SmartHTTPServer).InfoRefsUploadPack(m, &smartHTTPInfoRefsUploadPackServer{stream})
}
type SmartHTTP_InfoRefsUploadPackServer interface {
Send(*InfoRefsResponse) error
grpc.ServerStream
}
type smartHTTPInfoRefsUploadPackServer struct {
grpc.ServerStream
}
func (x *smartHTTPInfoRefsUploadPackServer) Send(m *InfoRefsResponse) error {
return x.ServerStream.SendMsg(m)
}
func _SmartHTTP_InfoRefsReceivePack_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(InfoRefsRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(SmartHTTPServer).InfoRefsReceivePack(m, &smartHTTPInfoRefsReceivePackServer{stream})
}
type SmartHTTP_InfoRefsReceivePackServer interface {
Send(*InfoRefsResponse) error
grpc.ServerStream
}
type smartHTTPInfoRefsReceivePackServer struct {
grpc.ServerStream
}
func (x *smartHTTPInfoRefsReceivePackServer) Send(m *InfoRefsResponse) error {
return x.ServerStream.SendMsg(m)
}
var _SmartHTTP_serviceDesc = grpc.ServiceDesc{
ServiceName: "gitaly.SmartHTTP",
HandlerType: (*SmartHTTPServer)(nil),
Methods: []grpc.MethodDesc{},
Streams: []grpc.StreamDesc{
{
StreamName: "InfoRefsUploadPack",
Handler: _SmartHTTP_InfoRefsUploadPack_Handler,
ServerStreams: true,
},
{
StreamName: "InfoRefsReceivePack",
Handler: _SmartHTTP_InfoRefsReceivePack_Handler,
ServerStreams: true,
},
},
Metadata: "smarthttp.proto",
}
func init() { proto.RegisterFile("smarthttp.proto", fileDescriptor2) }
var fileDescriptor2 = []byte{
// 200 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0x2f, 0xce, 0x4d, 0x2c,
0x2a, 0xc9, 0x28, 0x29, 0x29, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x4b, 0xcf, 0x2c,
0x49, 0xcc, 0xa9, 0x94, 0xe2, 0x29, 0xce, 0x48, 0x2c, 0x4a, 0x4d, 0x81, 0x88, 0x2a, 0xb9, 0x72,
0xf1, 0x7b, 0xe6, 0xa5, 0xe5, 0x07, 0xa5, 0xa6, 0x15, 0x07, 0xa5, 0x16, 0x96, 0xa6, 0x16, 0x97,
0x08, 0x19, 0x71, 0x71, 0x15, 0xa5, 0x16, 0xe4, 0x17, 0x67, 0x96, 0xe4, 0x17, 0x55, 0x4a, 0x30,
0x2a, 0x30, 0x6a, 0x70, 0x1b, 0x09, 0xe9, 0x41, 0x74, 0xeb, 0x05, 0xc1, 0x65, 0x82, 0x90, 0x54,
0x29, 0xa9, 0x71, 0x09, 0x20, 0x8c, 0x29, 0x2e, 0xc8, 0xcf, 0x2b, 0x4e, 0x15, 0x12, 0xe2, 0x62,
0x49, 0x49, 0x2c, 0x49, 0x04, 0x9b, 0xc0, 0x13, 0x04, 0x66, 0x1b, 0x2d, 0x63, 0xe4, 0xe2, 0x0c,
0x06, 0x39, 0xcc, 0x23, 0x24, 0x24, 0x40, 0xc8, 0x9b, 0x4b, 0x08, 0xa6, 0x2b, 0xb4, 0x20, 0x27,
0x3f, 0x31, 0x25, 0x20, 0x31, 0x39, 0x5b, 0x48, 0x1c, 0x66, 0x17, 0x9a, 0xc3, 0xa4, 0x24, 0x30,
0x25, 0x20, 0x56, 0x29, 0x31, 0x18, 0x30, 0x0a, 0xf9, 0x70, 0x09, 0x23, 0xc4, 0x93, 0x53, 0x33,
0xcb, 0x52, 0x29, 0x30, 0x2d, 0x89, 0x0d, 0x1c, 0x3c, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff,
0xfd, 0x13, 0x70, 0x6d, 0x47, 0x01, 0x00, 0x00,
}
Loading
Loading
@@ -28,7 +28,7 @@ type SSHUploadPackRequest struct {
func (m *SSHUploadPackRequest) Reset() { *m = SSHUploadPackRequest{} }
func (m *SSHUploadPackRequest) String() string { return proto.CompactTextString(m) }
func (*SSHUploadPackRequest) ProtoMessage() {}
func (*SSHUploadPackRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} }
func (*SSHUploadPackRequest) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} }
 
func (m *SSHUploadPackRequest) GetRepository() *Repository {
if m != nil {
Loading
Loading
@@ -57,7 +57,7 @@ type SSHUploadPackResponse struct {
func (m *SSHUploadPackResponse) Reset() { *m = SSHUploadPackResponse{} }
func (m *SSHUploadPackResponse) String() string { return proto.CompactTextString(m) }
func (*SSHUploadPackResponse) ProtoMessage() {}
func (*SSHUploadPackResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{1} }
func (*SSHUploadPackResponse) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{1} }
 
func (m *SSHUploadPackResponse) GetStdout() []byte {
if m != nil {
Loading
Loading
@@ -92,7 +92,7 @@ type SSHReceivePackRequest struct {
func (m *SSHReceivePackRequest) Reset() { *m = SSHReceivePackRequest{} }
func (m *SSHReceivePackRequest) String() string { return proto.CompactTextString(m) }
func (*SSHReceivePackRequest) ProtoMessage() {}
func (*SSHReceivePackRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{2} }
func (*SSHReceivePackRequest) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{2} }
 
func (m *SSHReceivePackRequest) GetRepository() *Repository {
if m != nil {
Loading
Loading
@@ -128,7 +128,7 @@ type SSHReceivePackResponse struct {
func (m *SSHReceivePackResponse) Reset() { *m = SSHReceivePackResponse{} }
func (m *SSHReceivePackResponse) String() string { return proto.CompactTextString(m) }
func (*SSHReceivePackResponse) ProtoMessage() {}
func (*SSHReceivePackResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{3} }
func (*SSHReceivePackResponse) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{3} }
 
func (m *SSHReceivePackResponse) GetStdout() []byte {
if m != nil {
Loading
Loading
@@ -331,9 +331,9 @@ var _SSH_serviceDesc = grpc.ServiceDesc{
Metadata: "ssh.proto",
}
 
func init() { proto.RegisterFile("ssh.proto", fileDescriptor2) }
func init() { proto.RegisterFile("ssh.proto", fileDescriptor3) }
 
var fileDescriptor2 = []byte{
var fileDescriptor3 = []byte{
// 284 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xbc, 0x52, 0xcd, 0x4a, 0xc3, 0x40,
0x10, 0x76, 0xad, 0x0d, 0x74, 0x1a, 0x3d, 0xac, 0xb5, 0x84, 0xa0, 0x52, 0x72, 0xca, 0x29, 0x48,
Loading
Loading
Loading
Loading
@@ -5,21 +5,9 @@ require 'google/protobuf'
 
require 'shared_pb'
Google::Protobuf::DescriptorPool.generated_pool.build do
add_message "gitaly.InfoRefsUploadPackRequest" do
optional :repository, :message, 1, "gitaly.Repository"
end
add_message "gitaly.InfoRefsReceivePackRequest" do
optional :repository, :message, 1, "gitaly.Repository"
end
add_message "gitaly.CommitIsAncestorResponse" do
optional :value, :bool, 1
end
add_message "gitaly.InfoRefsUploadPackResponse" do
optional :data, :bytes, 1
end
add_message "gitaly.InfoRefsReceivePackResponse" do
optional :data, :bytes, 1
end
add_message "gitaly.PostReceiveRequest" do
optional :repository, :message, 1, "gitaly.Repository"
end
Loading
Loading
@@ -74,11 +62,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
end
 
module Gitaly
InfoRefsUploadPackRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.InfoRefsUploadPackRequest").msgclass
InfoRefsReceivePackRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.InfoRefsReceivePackRequest").msgclass
CommitIsAncestorResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.CommitIsAncestorResponse").msgclass
InfoRefsUploadPackResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.InfoRefsUploadPackResponse").msgclass
InfoRefsReceivePackResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.InfoRefsReceivePackResponse").msgclass
PostReceiveRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.PostReceiveRequest").msgclass
PostReceiveResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.PostReceiveResponse").msgclass
FindRefNameRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.FindRefNameRequest").msgclass
Loading
Loading
Loading
Loading
@@ -5,24 +5,6 @@ require 'grpc'
require 'gitaly_pb'
 
module Gitaly
module SmartHTTP
# The Git 'smart HTTP' protocol
class Service
include GRPC::GenericService
self.marshal_class_method = :encode
self.unmarshal_class_method = :decode
self.service_name = 'gitaly.SmartHTTP'
# The response body for GET /info/refs?service=git-upload-pack
rpc :InfoRefsUploadPack, InfoRefsUploadPackRequest, stream(InfoRefsUploadPackResponse)
# The response body for GET /info/refs?service=git-receive-pack
rpc :InfoRefsReceivePack, InfoRefsReceivePackRequest, stream(InfoRefsReceivePackResponse)
end
Stub = Service.rpc_stub_class
end
module Notifications
class Service
 
Loading
Loading
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: smarthttp.proto
require 'google/protobuf'
require 'shared_pb'
Google::Protobuf::DescriptorPool.generated_pool.build do
add_message "gitaly.InfoRefsRequest" do
optional :repository, :message, 1, "gitaly.Repository"
end
add_message "gitaly.InfoRefsResponse" do
optional :data, :bytes, 1
end
end
module Gitaly
InfoRefsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.InfoRefsRequest").msgclass
InfoRefsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.InfoRefsResponse").msgclass
end
# Generated by the protocol buffer compiler. DO NOT EDIT!
# Source: smarthttp.proto for package 'gitaly'
require 'grpc'
require 'smarthttp_pb'
module Gitaly
module SmartHTTP
class Service
include GRPC::GenericService
self.marshal_class_method = :encode
self.unmarshal_class_method = :decode
self.service_name = 'gitaly.SmartHTTP'
# The response body for GET /info/refs?service=git-upload-pack
rpc :InfoRefsUploadPack, InfoRefsRequest, stream(InfoRefsResponse)
# The response body for GET /info/refs?service=git-receive-pack
rpc :InfoRefsReceivePack, InfoRefsRequest, stream(InfoRefsResponse)
end
Stub = Service.rpc_stub_class
end
end
syntax = "proto3";
package gitaly;
import "shared.proto";
service SmartHTTP {
// The response body for GET /info/refs?service=git-upload-pack
rpc InfoRefsUploadPack(InfoRefsRequest) returns (stream InfoRefsResponse) {}
// The response body for GET /info/refs?service=git-receive-pack
rpc InfoRefsReceivePack(InfoRefsRequest) returns (stream InfoRefsResponse) {}
}
message InfoRefsRequest {
Repository repository = 1;
}
message InfoRefsResponse {
bytes data = 1;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment