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:
authorPavlo Strokov <pstrokov@gitlab.com>2020-03-09 19:00:47 +0300
committerJacob Vosmaer <jacob@gitlab.com>2020-03-09 19:00:47 +0300
commit31951c9fe36e49165cd6aa1542521923340ae44e (patch)
tree0d3671b46ed85c1cf0f6a14707293761997de566
parentd2fb4e7d7c1ffa35e264684bdf9fd80d1eb422b5 (diff)
Remove dependency on the outdated golang.org/x/net package
As golang.org/x/net is outdated and we don't need to use a context package from it anymore it is replaced with context from standard library. Makefile changed to use proper protoc compiler.
-rw-r--r--_support/Makefile.template2
-rw-r--r--changelogs/unreleased/ps-remove-old-context-package.yml5
-rw-r--r--go.mod1
-rw-r--r--internal/praefect/grpc-proxy/proxy/director.go3
-rw-r--r--internal/praefect/grpc-proxy/proxy/examples_test.go2
-rw-r--r--internal/praefect/grpc-proxy/proxy/handler.go2
-rw-r--r--internal/praefect/grpc-proxy/proxy/handler_test.go2
-rw-r--r--internal/praefect/grpc-proxy/proxy/helper_test.go2
-rw-r--r--internal/praefect/grpc-proxy/proxy/peeker_test.go10
-rw-r--r--internal/praefect/grpc-proxy/testdata/Makefile11
-rw-r--r--internal/praefect/grpc-proxy/testdata/test.pb.go214
-rw-r--r--internal/service/commit/count_diverging_commits_test.go2
12 files changed, 167 insertions, 89 deletions
diff --git a/_support/Makefile.template b/_support/Makefile.template
index e75179beb..1762c50f8 100644
--- a/_support/Makefile.template
+++ b/_support/Makefile.template
@@ -267,6 +267,8 @@ proto: {{ .ProtoC }} {{ .ProtoCGenGo }} {{ .ProtoCGenGitaly }} {{ .GrpcToolsRuby
rm -rf {{ .SourceDir }}/proto/go/gitalypb/*.pb.go
cd {{ .SourceDir }} && {{ .ProtoC }} --gitaly_out=proto_dir=./proto,gitalypb_dir=./proto/go/gitalypb:. --go_out=paths=source_relative,plugins=grpc:./proto/go/gitalypb -I./proto ./proto/*.proto
cd {{ .SourceDir }} && _support/generate-proto-ruby
+# this part is related to the generation of sources from testing proto files
+ cd {{ .SourceDir }} && {{ .ProtoC }} --plugin={{ .ProtoCGenGo }} --go_out=plugins=grpc:. internal/praefect/grpc-proxy/testdata/test.proto
{{ .ProtoC }}: {{ .BuildDir }}/protoc.zip
rm -rf {{ .BuildDir }}/protoc
diff --git a/changelogs/unreleased/ps-remove-old-context-package.yml b/changelogs/unreleased/ps-remove-old-context-package.yml
new file mode 100644
index 000000000..adedff075
--- /dev/null
+++ b/changelogs/unreleased/ps-remove-old-context-package.yml
@@ -0,0 +1,5 @@
+---
+title: Remove dependency on the outdated golang.org/x/net package
+merge_request: 1882
+author:
+type: other
diff --git a/go.mod b/go.mod
index f480cfdc2..b32dec7ab 100644
--- a/go.mod
+++ b/go.mod
@@ -19,7 +19,6 @@ require (
github.com/stretchr/testify v1.4.0
github.com/tinylib/msgp v1.1.0 // indirect
gitlab.com/gitlab-org/labkit v0.0.0-20190902063225-3253d7975ca7
- golang.org/x/net v0.0.0-20190620200207-3b0461eec859
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a
google.golang.org/genproto v0.0.0-20181202183823-bd91e49a0898 // indirect
diff --git a/internal/praefect/grpc-proxy/proxy/director.go b/internal/praefect/grpc-proxy/proxy/director.go
index 0efda2b91..50a0ee63f 100644
--- a/internal/praefect/grpc-proxy/proxy/director.go
+++ b/internal/praefect/grpc-proxy/proxy/director.go
@@ -4,8 +4,9 @@
package proxy
import (
+ "context"
+
"gitlab.com/gitlab-org/gitaly/internal/helper"
- "golang.org/x/net/context"
"google.golang.org/grpc"
)
diff --git a/internal/praefect/grpc-proxy/proxy/examples_test.go b/internal/praefect/grpc-proxy/proxy/examples_test.go
index ed0c57a20..c4697a68f 100644
--- a/internal/praefect/grpc-proxy/proxy/examples_test.go
+++ b/internal/praefect/grpc-proxy/proxy/examples_test.go
@@ -8,10 +8,10 @@
package proxy_test
import (
+ "context"
"strings"
"gitlab.com/gitlab-org/gitaly/internal/praefect/grpc-proxy/proxy"
- "golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/metadata"
diff --git a/internal/praefect/grpc-proxy/proxy/handler.go b/internal/praefect/grpc-proxy/proxy/handler.go
index a47baa7c3..ced9388b9 100644
--- a/internal/praefect/grpc-proxy/proxy/handler.go
+++ b/internal/praefect/grpc-proxy/proxy/handler.go
@@ -8,10 +8,10 @@
package proxy
import (
+ "context"
"io"
"gitlab.com/gitlab-org/gitaly/internal/middleware/sentryhandler"
- "golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
diff --git a/internal/praefect/grpc-proxy/proxy/handler_test.go b/internal/praefect/grpc-proxy/proxy/handler_test.go
index 676387a2d..d3b38e2df 100644
--- a/internal/praefect/grpc-proxy/proxy/handler_test.go
+++ b/internal/praefect/grpc-proxy/proxy/handler_test.go
@@ -8,6 +8,7 @@
package proxy_test
import (
+ "context"
"fmt"
"io"
"log"
@@ -30,7 +31,6 @@ import (
"gitlab.com/gitlab-org/gitaly/internal/middleware/sentryhandler"
"gitlab.com/gitlab-org/gitaly/internal/praefect/grpc-proxy/proxy"
pb "gitlab.com/gitlab-org/gitaly/internal/praefect/grpc-proxy/testdata"
- "golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
diff --git a/internal/praefect/grpc-proxy/proxy/helper_test.go b/internal/praefect/grpc-proxy/proxy/helper_test.go
index c56355638..af21a69bf 100644
--- a/internal/praefect/grpc-proxy/proxy/helper_test.go
+++ b/internal/praefect/grpc-proxy/proxy/helper_test.go
@@ -1,13 +1,13 @@
package proxy_test
import (
+ "context"
"net"
"testing"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitaly/internal/praefect/grpc-proxy/proxy"
testservice "gitlab.com/gitlab-org/gitaly/internal/praefect/grpc-proxy/testdata"
- "golang.org/x/net/context"
"google.golang.org/grpc"
)
diff --git a/internal/praefect/grpc-proxy/proxy/peeker_test.go b/internal/praefect/grpc-proxy/proxy/peeker_test.go
index 31422cf39..d6efb9fb7 100644
--- a/internal/praefect/grpc-proxy/proxy/peeker_test.go
+++ b/internal/praefect/grpc-proxy/proxy/peeker_test.go
@@ -1,6 +1,7 @@
package proxy_test
import (
+ "context"
"io"
"testing"
"time"
@@ -10,7 +11,6 @@ import (
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitaly/internal/praefect/grpc-proxy/proxy"
testservice "gitlab.com/gitlab-org/gitaly/internal/praefect/grpc-proxy/testdata"
- "golang.org/x/net/context"
)
// TestStreamPeeking demonstrates that a director function is able to peek
@@ -35,7 +35,7 @@ func TestStreamPeeking(t *testing.T) {
peekedRequest := new(testservice.PingRequest)
err = proto.Unmarshal(peekedMsg, peekedRequest)
require.NoError(t, err)
- require.Equal(t, pingReqSent, peekedRequest)
+ require.True(t, proto.Equal(pingReqSent, peekedRequest), "expected to be the same")
return proxy.NewStreamParameters(ctx, backendCC, nil, nil), nil
}
@@ -48,7 +48,7 @@ func TestStreamPeeking(t *testing.T) {
backendSrvr.pingStream = func(stream testservice.TestService_PingStreamServer) error {
pingReqReceived, err := stream.Recv()
assert.NoError(t, err)
- assert.Equal(t, pingReqSent, pingReqReceived)
+ assert.True(t, proto.Equal(pingReqSent, pingReqReceived), "expected to be the same")
return stream.Send(pingResp)
}
@@ -68,7 +68,7 @@ func TestStreamPeeking(t *testing.T) {
resp, err := proxyClientPingStream.Recv()
require.NoError(t, err)
- require.Equal(t, resp, pingResp)
+ require.True(t, proto.Equal(resp, pingResp), "expected to be the same")
_, err = proxyClientPingStream.Recv()
require.Error(t, io.EOF, err)
@@ -133,7 +133,7 @@ func TestStreamInjecting(t *testing.T) {
resp, err := proxyClientPingStream.Recv()
require.NoError(t, err)
- require.Equal(t, resp, pingResp)
+ require.True(t, proto.Equal(resp, pingResp), "expected to be the same")
_, err = proxyClientPingStream.Recv()
require.Error(t, io.EOF, err)
diff --git a/internal/praefect/grpc-proxy/testdata/Makefile b/internal/praefect/grpc-proxy/testdata/Makefile
deleted file mode 100644
index f2c95584b..000000000
--- a/internal/praefect/grpc-proxy/testdata/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-
-all: test_go
-
-test_go: test.proto
- PATH="${GOPATH}/bin:${PATH}" protoc \
- -I. \
- -I${GOPATH}/src \
- --go_out=plugins=grpc:. \
- test.proto
-
-
diff --git a/internal/praefect/grpc-proxy/testdata/test.pb.go b/internal/praefect/grpc-proxy/testdata/test.pb.go
index 1f1f48253..300182635 100644
--- a/internal/praefect/grpc-proxy/testdata/test.pb.go
+++ b/internal/praefect/grpc-proxy/testdata/test.pb.go
@@ -1,27 +1,16 @@
-// Code generated by protoc-gen-go.
-// source: test.proto
-// DO NOT EDIT!
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// source: internal/praefect/grpc-proxy/testdata/test.proto
-/*
-Package mwitkow_testproto is a generated protocol buffer package.
-
-It is generated from these files:
- test.proto
-
-It has these top-level messages:
- Empty
- PingRequest
- PingResponse
-*/
package mwitkow_testproto
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-
import (
- context "golang.org/x/net/context"
+ context "context"
+ fmt "fmt"
+ proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc"
+ codes "google.golang.org/grpc/codes"
+ status "google.golang.org/grpc/status"
+ math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
@@ -33,24 +22,70 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
+const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type Empty struct {
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *Empty) Reset() { *m = Empty{} }
+func (m *Empty) String() string { return proto.CompactTextString(m) }
+func (*Empty) ProtoMessage() {}
+func (*Empty) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e73bd1b780042c37, []int{0}
+}
+
+func (m *Empty) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_Empty.Unmarshal(m, b)
+}
+func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_Empty.Marshal(b, m, deterministic)
+}
+func (m *Empty) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_Empty.Merge(m, src)
+}
+func (m *Empty) XXX_Size() int {
+ return xxx_messageInfo_Empty.Size(m)
+}
+func (m *Empty) XXX_DiscardUnknown() {
+ xxx_messageInfo_Empty.DiscardUnknown(m)
}
-func (m *Empty) Reset() { *m = Empty{} }
-func (m *Empty) String() string { return proto.CompactTextString(m) }
-func (*Empty) ProtoMessage() {}
-func (*Empty) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
+var xxx_messageInfo_Empty proto.InternalMessageInfo
type PingRequest struct {
- Value string `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"`
+ Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *PingRequest) Reset() { *m = PingRequest{} }
+func (m *PingRequest) String() string { return proto.CompactTextString(m) }
+func (*PingRequest) ProtoMessage() {}
+func (*PingRequest) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e73bd1b780042c37, []int{1}
+}
+
+func (m *PingRequest) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_PingRequest.Unmarshal(m, b)
+}
+func (m *PingRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_PingRequest.Marshal(b, m, deterministic)
+}
+func (m *PingRequest) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_PingRequest.Merge(m, src)
+}
+func (m *PingRequest) XXX_Size() int {
+ return xxx_messageInfo_PingRequest.Size(m)
+}
+func (m *PingRequest) XXX_DiscardUnknown() {
+ xxx_messageInfo_PingRequest.DiscardUnknown(m)
}
-func (m *PingRequest) Reset() { *m = PingRequest{} }
-func (m *PingRequest) String() string { return proto.CompactTextString(m) }
-func (*PingRequest) ProtoMessage() {}
-func (*PingRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
+var xxx_messageInfo_PingRequest proto.InternalMessageInfo
func (m *PingRequest) GetValue() string {
if m != nil {
@@ -60,14 +95,37 @@ func (m *PingRequest) GetValue() string {
}
type PingResponse struct {
- Value string `protobuf:"bytes,1,opt,name=Value" json:"Value,omitempty"`
- Counter int32 `protobuf:"varint,2,opt,name=counter" json:"counter,omitempty"`
+ Value string `protobuf:"bytes,1,opt,name=Value,proto3" json:"Value,omitempty"`
+ Counter int32 `protobuf:"varint,2,opt,name=counter,proto3" json:"counter,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *PingResponse) Reset() { *m = PingResponse{} }
+func (m *PingResponse) String() string { return proto.CompactTextString(m) }
+func (*PingResponse) ProtoMessage() {}
+func (*PingResponse) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e73bd1b780042c37, []int{2}
+}
+
+func (m *PingResponse) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_PingResponse.Unmarshal(m, b)
+}
+func (m *PingResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_PingResponse.Marshal(b, m, deterministic)
+}
+func (m *PingResponse) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_PingResponse.Merge(m, src)
+}
+func (m *PingResponse) XXX_Size() int {
+ return xxx_messageInfo_PingResponse.Size(m)
+}
+func (m *PingResponse) XXX_DiscardUnknown() {
+ xxx_messageInfo_PingResponse.DiscardUnknown(m)
}
-func (m *PingResponse) Reset() { *m = PingResponse{} }
-func (m *PingResponse) String() string { return proto.CompactTextString(m) }
-func (*PingResponse) ProtoMessage() {}
-func (*PingResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
+var xxx_messageInfo_PingResponse proto.InternalMessageInfo
func (m *PingResponse) GetValue() string {
if m != nil {
@@ -89,6 +147,31 @@ func init() {
proto.RegisterType((*PingResponse)(nil), "mwitkow.testproto.PingResponse")
}
+func init() {
+ proto.RegisterFile("internal/praefect/grpc-proxy/testdata/test.proto", fileDescriptor_e73bd1b780042c37)
+}
+
+var fileDescriptor_e73bd1b780042c37 = []byte{
+ // 264 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x8f, 0x41, 0x4b, 0xc3, 0x40,
+ 0x10, 0x85, 0xbb, 0x6a, 0xac, 0x9d, 0x7a, 0x71, 0xf1, 0x10, 0x3c, 0x68, 0x89, 0x97, 0x5c, 0x4c,
+ 0x82, 0xde, 0xbd, 0x89, 0x0a, 0x82, 0x92, 0x88, 0xf7, 0x35, 0x8e, 0x65, 0xb1, 0xc9, 0xae, 0xb3,
+ 0x93, 0xd6, 0xfe, 0x0c, 0xff, 0xb1, 0xec, 0x56, 0xa1, 0xa0, 0xc5, 0x1e, 0x7a, 0xdb, 0x79, 0xef,
+ 0xe3, 0xf1, 0x2d, 0x14, 0xba, 0x65, 0xa4, 0x56, 0x4d, 0x72, 0x4b, 0x0a, 0x5f, 0xb1, 0xe6, 0x7c,
+ 0x4c, 0xb6, 0x3e, 0xb3, 0x64, 0x3e, 0xe6, 0x39, 0xa3, 0xe3, 0x17, 0xc5, 0x2a, 0x3c, 0x32, 0x4b,
+ 0x86, 0x8d, 0x3c, 0x68, 0x66, 0x9a, 0xdf, 0xcc, 0x2c, 0xf3, 0x59, 0x88, 0x92, 0x3e, 0x44, 0x57,
+ 0x8d, 0xe5, 0x79, 0x72, 0x0a, 0xc3, 0x07, 0xdd, 0x8e, 0x4b, 0x7c, 0xef, 0xd0, 0xb1, 0x3c, 0x84,
+ 0x68, 0xaa, 0x26, 0x1d, 0xc6, 0x62, 0x24, 0xd2, 0x41, 0xb9, 0x38, 0x92, 0x4b, 0xd8, 0x5f, 0x40,
+ 0xce, 0x9a, 0xd6, 0xa1, 0xa7, 0x9e, 0x96, 0xa9, 0x70, 0xc8, 0x18, 0xfa, 0xb5, 0xe9, 0xbc, 0x5c,
+ 0xbc, 0x35, 0x12, 0x69, 0x54, 0xfe, 0x9c, 0xe7, 0x9f, 0xdb, 0x30, 0x7c, 0x44, 0xc7, 0x15, 0xd2,
+ 0x54, 0xd7, 0x28, 0x6f, 0x60, 0xe0, 0xf7, 0x82, 0x81, 0x8c, 0xb3, 0x5f, 0x7a, 0x59, 0x68, 0x8e,
+ 0x4e, 0xfe, 0x68, 0x96, 0x3d, 0x92, 0x9e, 0xbc, 0x85, 0x1d, 0x9f, 0xc8, 0xe3, 0x95, 0x68, 0xf8,
+ 0xd7, 0x3a, 0x53, 0xd7, 0xdf, 0x52, 0x44, 0x86, 0xfe, 0xdd, 0x5b, 0x29, 0x9d, 0xf4, 0xe4, 0x3d,
+ 0xec, 0x79, 0xf4, 0x4e, 0x3b, 0xde, 0x80, 0x57, 0x21, 0x64, 0x05, 0xe0, 0xb3, 0x8a, 0x09, 0x55,
+ 0xb3, 0x81, 0xc9, 0x54, 0x14, 0xe2, 0x79, 0x37, 0x34, 0x17, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff,
+ 0x96, 0x70, 0xe3, 0xdf, 0x4f, 0x02, 0x00, 0x00,
+}
+
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
@@ -97,8 +180,9 @@ var _ grpc.ClientConn
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
-// Client API for TestService service
-
+// TestServiceClient is the client API for TestService service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type TestServiceClient interface {
PingEmpty(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*PingResponse, error)
Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error)
@@ -117,7 +201,7 @@ func NewTestServiceClient(cc *grpc.ClientConn) TestServiceClient {
func (c *testServiceClient) PingEmpty(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*PingResponse, error) {
out := new(PingResponse)
- err := grpc.Invoke(ctx, "/mwitkow.testproto.TestService/PingEmpty", in, out, c.cc, opts...)
+ err := c.cc.Invoke(ctx, "/mwitkow.testproto.TestService/PingEmpty", in, out, opts...)
if err != nil {
return nil, err
}
@@ -126,7 +210,7 @@ func (c *testServiceClient) PingEmpty(ctx context.Context, in *Empty, opts ...gr
func (c *testServiceClient) Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) {
out := new(PingResponse)
- err := grpc.Invoke(ctx, "/mwitkow.testproto.TestService/Ping", in, out, c.cc, opts...)
+ err := c.cc.Invoke(ctx, "/mwitkow.testproto.TestService/Ping", in, out, opts...)
if err != nil {
return nil, err
}
@@ -135,7 +219,7 @@ func (c *testServiceClient) Ping(ctx context.Context, in *PingRequest, opts ...g
func (c *testServiceClient) PingError(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*Empty, error) {
out := new(Empty)
- err := grpc.Invoke(ctx, "/mwitkow.testproto.TestService/PingError", in, out, c.cc, opts...)
+ err := c.cc.Invoke(ctx, "/mwitkow.testproto.TestService/PingError", in, out, opts...)
if err != nil {
return nil, err
}
@@ -143,7 +227,7 @@ func (c *testServiceClient) PingError(ctx context.Context, in *PingRequest, opts
}
func (c *testServiceClient) PingList(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (TestService_PingListClient, error) {
- stream, err := grpc.NewClientStream(ctx, &_TestService_serviceDesc.Streams[0], c.cc, "/mwitkow.testproto.TestService/PingList", opts...)
+ stream, err := c.cc.NewStream(ctx, &_TestService_serviceDesc.Streams[0], "/mwitkow.testproto.TestService/PingList", opts...)
if err != nil {
return nil, err
}
@@ -175,7 +259,7 @@ func (x *testServicePingListClient) Recv() (*PingResponse, error) {
}
func (c *testServiceClient) PingStream(ctx context.Context, opts ...grpc.CallOption) (TestService_PingStreamClient, error) {
- stream, err := grpc.NewClientStream(ctx, &_TestService_serviceDesc.Streams[1], c.cc, "/mwitkow.testproto.TestService/PingStream", opts...)
+ stream, err := c.cc.NewStream(ctx, &_TestService_serviceDesc.Streams[1], "/mwitkow.testproto.TestService/PingStream", opts...)
if err != nil {
return nil, err
}
@@ -205,8 +289,7 @@ func (x *testServicePingStreamClient) Recv() (*PingResponse, error) {
return m, nil
}
-// Server API for TestService service
-
+// TestServiceServer is the server API for TestService service.
type TestServiceServer interface {
PingEmpty(context.Context, *Empty) (*PingResponse, error)
Ping(context.Context, *PingRequest) (*PingResponse, error)
@@ -215,6 +298,26 @@ type TestServiceServer interface {
PingStream(TestService_PingStreamServer) error
}
+// UnimplementedTestServiceServer can be embedded to have forward compatible implementations.
+type UnimplementedTestServiceServer struct {
+}
+
+func (*UnimplementedTestServiceServer) PingEmpty(ctx context.Context, req *Empty) (*PingResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method PingEmpty not implemented")
+}
+func (*UnimplementedTestServiceServer) Ping(ctx context.Context, req *PingRequest) (*PingResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented")
+}
+func (*UnimplementedTestServiceServer) PingError(ctx context.Context, req *PingRequest) (*Empty, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method PingError not implemented")
+}
+func (*UnimplementedTestServiceServer) PingList(req *PingRequest, srv TestService_PingListServer) error {
+ return status.Errorf(codes.Unimplemented, "method PingList not implemented")
+}
+func (*UnimplementedTestServiceServer) PingStream(srv TestService_PingStreamServer) error {
+ return status.Errorf(codes.Unimplemented, "method PingStream not implemented")
+}
+
func RegisterTestServiceServer(s *grpc.Server, srv TestServiceServer) {
s.RegisterService(&_TestService_serviceDesc, srv)
}
@@ -350,26 +453,5 @@ var _TestService_serviceDesc = grpc.ServiceDesc{
ClientStreams: true,
},
},
- Metadata: "test.proto",
-}
-
-func init() { proto.RegisterFile("test.proto", fileDescriptor0) }
-
-var fileDescriptor0 = []byte{
- // 237 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x8f, 0x31, 0x4b, 0xc4, 0x40,
- 0x10, 0x85, 0x6f, 0xd5, 0x78, 0xde, 0x9c, 0x8d, 0x83, 0xc5, 0x62, 0xa1, 0xc7, 0xda, 0xa4, 0x5a,
- 0x0e, 0xed, 0xed, 0x44, 0x05, 0x41, 0x49, 0xc4, 0xfe, 0x0c, 0x83, 0x2c, 0x9a, 0x6c, 0xdc, 0x9d,
- 0x24, 0xf8, 0x33, 0xfc, 0xc7, 0xb2, 0x1b, 0x85, 0x80, 0x06, 0x2d, 0x52, 0xce, 0x7b, 0x1f, 0x8f,
- 0x6f, 0x00, 0x98, 0x3c, 0xeb, 0xda, 0x59, 0xb6, 0x78, 0x50, 0x76, 0x86, 0x5f, 0x6c, 0xa7, 0x43,
- 0x16, 0x23, 0x35, 0x87, 0xe4, 0xb2, 0xac, 0xf9, 0x5d, 0x9d, 0xc2, 0xf2, 0xde, 0x54, 0xcf, 0x19,
- 0xbd, 0x35, 0xe4, 0x19, 0x0f, 0x21, 0x69, 0x37, 0xaf, 0x0d, 0x49, 0xb1, 0x12, 0xe9, 0x22, 0xeb,
- 0x0f, 0x75, 0x01, 0xfb, 0x3d, 0xe4, 0x6b, 0x5b, 0x79, 0x0a, 0xd4, 0xe3, 0x90, 0x8a, 0x07, 0x4a,
- 0x98, 0x17, 0xb6, 0xa9, 0x98, 0x9c, 0xdc, 0x5a, 0x89, 0x34, 0xc9, 0xbe, 0xcf, 0xb3, 0x8f, 0x6d,
- 0x58, 0x3e, 0x90, 0xe7, 0x9c, 0x5c, 0x6b, 0x0a, 0xc2, 0x6b, 0x58, 0x84, 0xbd, 0x68, 0x80, 0x52,
- 0xff, 0xd0, 0xd3, 0xb1, 0x39, 0x3a, 0xf9, 0xa5, 0x19, 0x7a, 0xa8, 0x19, 0xde, 0xc0, 0x4e, 0x48,
- 0xf0, 0x78, 0x14, 0x8d, 0x7f, 0xfd, 0x67, 0xea, 0xea, 0x4b, 0xca, 0x39, 0xeb, 0xfe, 0xdc, 0x1b,
- 0x95, 0x56, 0x33, 0xbc, 0x83, 0xbd, 0x80, 0xde, 0x1a, 0xcf, 0x13, 0x78, 0xad, 0x05, 0xe6, 0x00,
- 0x21, 0xcb, 0xd9, 0xd1, 0xa6, 0x9c, 0x60, 0x32, 0x15, 0x6b, 0xf1, 0xb4, 0x1b, 0x9b, 0xf3, 0xcf,
- 0x00, 0x00, 0x00, 0xff, 0xff, 0x4a, 0xc0, 0x8e, 0xe7, 0x29, 0x02, 0x00, 0x00,
+ Metadata: "internal/praefect/grpc-proxy/testdata/test.proto",
}
diff --git a/internal/service/commit/count_diverging_commits_test.go b/internal/service/commit/count_diverging_commits_test.go
index 684a6da0e..928a9143a 100644
--- a/internal/service/commit/count_diverging_commits_test.go
+++ b/internal/service/commit/count_diverging_commits_test.go
@@ -1,6 +1,7 @@
package commit
import (
+ "context"
"fmt"
"testing"
@@ -8,7 +9,6 @@ import (
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitaly/internal/testhelper"
"gitlab.com/gitlab-org/gitaly/proto/go/gitalypb"
- "golang.org/x/net/context"
"google.golang.org/grpc/codes"
)