Commit 87f1189b authored by Zeger-Jan van de Weg's avatar Zeger-Jan van de Weg

Update Gitaly to v0.124.0

This is a version than includes the new gitaly-proto, which has the
package name changed. Now gitalypb is used everywhere. The client of
Gitaly is updated too, as only one proto definition can register a type.
parent 1788824b
...@@ -15,7 +15,7 @@ import ( ...@@ -15,7 +15,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
pb "gitlab.com/gitlab-org/gitaly-proto/go" "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/api" "gitlab.com/gitlab-org/gitlab-workhorse/internal/api"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/gitaly" "gitlab.com/gitlab-org/gitlab-workhorse/internal/gitaly"
...@@ -62,7 +62,7 @@ func ensureGitalyRepository(t *testing.T, apiResponse *api.Response) error { ...@@ -62,7 +62,7 @@ func ensureGitalyRepository(t *testing.T, apiResponse *api.Response) error {
} }
// Remove the repository if it already exists, for consistency // Remove the repository if it already exists, for consistency
rmNsReq := &pb.RemoveNamespaceRequest{ rmNsReq := &gitalypb.RemoveNamespaceRequest{
StorageName: apiResponse.Repository.StorageName, StorageName: apiResponse.Repository.StorageName,
Name: apiResponse.Repository.RelativePath, Name: apiResponse.Repository.RelativePath,
} }
...@@ -71,7 +71,7 @@ func ensureGitalyRepository(t *testing.T, apiResponse *api.Response) error { ...@@ -71,7 +71,7 @@ func ensureGitalyRepository(t *testing.T, apiResponse *api.Response) error {
return err return err
} }
createReq := &pb.CreateRepositoryFromURLRequest{ createReq := &gitalypb.CreateRepositoryFromURLRequest{
Repository: &apiResponse.Repository, Repository: &apiResponse.Repository,
Url: "https://gitlab.com/gitlab-org/gitlab-test.git", Url: "https://gitlab.com/gitlab-org/gitlab-test.git",
} }
...@@ -237,7 +237,7 @@ func TestAllowedGetGitDiff(t *testing.T) { ...@@ -237,7 +237,7 @@ func TestAllowedGetGitDiff(t *testing.T) {
rightCommit := "e395f646b1499e8e0279445fc99a0596a65fab7e" rightCommit := "e395f646b1499e8e0279445fc99a0596a65fab7e"
expectedBody := "diff --git a/README.md b/README.md" expectedBody := "diff --git a/README.md b/README.md"
msg := serializedMessage("RawDiffRequest", &pb.RawDiffRequest{ msg := serializedMessage("RawDiffRequest", &gitalypb.RawDiffRequest{
Repository: &apiResponse.Repository, Repository: &apiResponse.Repository,
LeftCommitId: leftCommit, LeftCommitId: leftCommit,
RightCommitId: rightCommit, RightCommitId: rightCommit,
...@@ -262,7 +262,7 @@ func TestAllowedGetGitFormatPatch(t *testing.T) { ...@@ -262,7 +262,7 @@ func TestAllowedGetGitFormatPatch(t *testing.T) {
leftCommit := "8a0f2ee90d940bfb0ba1e14e8214b0649056e4ab" leftCommit := "8a0f2ee90d940bfb0ba1e14e8214b0649056e4ab"
rightCommit := "e395f646b1499e8e0279445fc99a0596a65fab7e" rightCommit := "e395f646b1499e8e0279445fc99a0596a65fab7e"
msg := serializedMessage("RawPatchRequest", &pb.RawPatchRequest{ msg := serializedMessage("RawPatchRequest", &gitalypb.RawPatchRequest{
Repository: &apiResponse.Repository, Repository: &apiResponse.Repository,
LeftCommitId: leftCommit, LeftCommitId: leftCommit,
RightCommitId: rightCommit, RightCommitId: rightCommit,
......
...@@ -19,10 +19,11 @@ import ( ...@@ -19,10 +19,11 @@ import (
"github.com/golang/protobuf/proto" "github.com/golang/protobuf/proto"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
pb "gitlab.com/gitlab-org/gitaly-proto/go"
"google.golang.org/grpc" "google.golang.org/grpc"
"google.golang.org/grpc/codes" "google.golang.org/grpc/codes"
"gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/api" "gitlab.com/gitlab-org/gitlab-workhorse/internal/api"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/git" "gitlab.com/gitlab-org/gitlab-workhorse/internal/git"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/gitaly" "gitlab.com/gitlab-org/gitlab-workhorse/internal/gitaly"
...@@ -91,7 +92,7 @@ func TestGetInfoRefsProxiedToGitalySuccessfully(t *testing.T) { ...@@ -91,7 +92,7 @@ func TestGetInfoRefsProxiedToGitalySuccessfully(t *testing.T) {
bodySplit := strings.SplitN(body, "\000", 3) bodySplit := strings.SplitN(body, "\000", 3)
require.Len(t, bodySplit, 3) require.Len(t, bodySplit, 3)
gitalyRequest := &pb.InfoRefsRequest{} gitalyRequest := &gitalypb.InfoRefsRequest{}
require.NoError(t, jsonpb.UnmarshalString(bodySplit[0], gitalyRequest)) require.NoError(t, jsonpb.UnmarshalString(bodySplit[0], gitalyRequest))
require.Equal(t, gitProtocol, gitalyRequest.GitProtocol) require.Equal(t, gitProtocol, gitalyRequest.GitProtocol)
...@@ -172,7 +173,7 @@ func TestPostReceivePackProxiedToGitalySuccessfully(t *testing.T) { ...@@ -172,7 +173,7 @@ func TestPostReceivePackProxiedToGitalySuccessfully(t *testing.T) {
split := strings.SplitN(body, "\000", 2) split := strings.SplitN(body, "\000", 2)
require.Len(t, split, 2) require.Len(t, split, 2)
gitalyRequest := &pb.PostReceivePackRequest{} gitalyRequest := &gitalypb.PostReceivePackRequest{}
require.NoError(t, jsonpb.UnmarshalString(split[0], gitalyRequest)) require.NoError(t, jsonpb.UnmarshalString(split[0], gitalyRequest))
assert.Equal(t, apiResponse.Repository.StorageName, gitalyRequest.Repository.StorageName) assert.Equal(t, apiResponse.Repository.StorageName, gitalyRequest.Repository.StorageName)
...@@ -268,7 +269,7 @@ func TestPostUploadPackProxiedToGitalySuccessfully(t *testing.T) { ...@@ -268,7 +269,7 @@ func TestPostUploadPackProxiedToGitalySuccessfully(t *testing.T) {
bodySplit := strings.SplitN(body, "\000", 2) bodySplit := strings.SplitN(body, "\000", 2)
require.Len(t, bodySplit, 2) require.Len(t, bodySplit, 2)
gitalyRequest := &pb.PostUploadPackRequest{} gitalyRequest := &gitalypb.PostUploadPackRequest{}
require.NoError(t, jsonpb.UnmarshalString(bodySplit[0], gitalyRequest)) require.NoError(t, jsonpb.UnmarshalString(bodySplit[0], gitalyRequest))
require.Equal(t, apiResponse.Repository.StorageName, gitalyRequest.Repository.StorageName) require.Equal(t, apiResponse.Repository.StorageName, gitalyRequest.Repository.StorageName)
...@@ -583,8 +584,8 @@ func TestGetSnapshotProxiedToGitalyInterruptedStream(t *testing.T) { ...@@ -583,8 +584,8 @@ func TestGetSnapshotProxiedToGitalyInterruptedStream(t *testing.T) {
} }
} }
func buildGetSnapshotParams(gitalyAddress string, repo *pb.Repository) string { func buildGetSnapshotParams(gitalyAddress string, repo *gitalypb.Repository) string {
msg := serializedMessage("GetSnapshotRequest", &pb.GetSnapshotRequest{Repository: repo}) msg := serializedMessage("GetSnapshotRequest", &gitalypb.GetSnapshotRequest{Repository: repo})
return buildGitalyRPCParams(gitalyAddress, msg) return buildGitalyRPCParams(gitalyAddress, msg)
} }
...@@ -617,8 +618,8 @@ func buildGitalyRPCParams(gitalyAddress string, rpcArgs ...rpcArg) string { ...@@ -617,8 +618,8 @@ func buildGitalyRPCParams(gitalyAddress string, rpcArgs ...rpcArg) string {
return string(b) return string(b)
} }
func buildPbRepo(storageName, relativePath string) *pb.Repository { func buildPbRepo(storageName, relativePath string) *gitalypb.Repository {
return &pb.Repository{ return &gitalypb.Repository{
StorageName: storageName, StorageName: storageName,
RelativePath: relativePath, RelativePath: relativePath,
} }
...@@ -649,10 +650,10 @@ func startGitalyServer(t *testing.T, finalMessageCode codes.Code) (*combinedServ ...@@ -649,10 +650,10 @@ func startGitalyServer(t *testing.T, finalMessageCode codes.Code) (*combinedServ
require.NoError(t, err) require.NoError(t, err)
gitalyServer := testhelper.NewGitalyServer(finalMessageCode) gitalyServer := testhelper.NewGitalyServer(finalMessageCode)
pb.RegisterSmartHTTPServiceServer(server, gitalyServer) gitalypb.RegisterSmartHTTPServiceServer(server, gitalyServer)
pb.RegisterBlobServiceServer(server, gitalyServer) gitalypb.RegisterBlobServiceServer(server, gitalyServer)
pb.RegisterRepositoryServiceServer(server, gitalyServer) gitalypb.RegisterRepositoryServiceServer(server, gitalyServer)
pb.RegisterDiffServiceServer(server, gitalyServer) gitalypb.RegisterDiffServiceServer(server, gitalyServer)
go server.Serve(listener) go server.Serve(listener)
......
...@@ -11,7 +11,8 @@ import ( ...@@ -11,7 +11,8 @@ import (
"strings" "strings"
"github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus"
pb "gitlab.com/gitlab-org/gitaly-proto/go"
"gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/gitaly" "gitlab.com/gitlab-org/gitlab-workhorse/internal/gitaly"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper" "gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
...@@ -130,7 +131,7 @@ type Response struct { ...@@ -130,7 +131,7 @@ type Response struct {
// GitalyServer specifies an address and authentication token for a gitaly server we should connect to. // GitalyServer specifies an address and authentication token for a gitaly server we should connect to.
GitalyServer gitaly.Server GitalyServer gitaly.Server
// Repository object for making gRPC requests to Gitaly. // Repository object for making gRPC requests to Gitaly.
Repository pb.Repository Repository gitalypb.Repository
// For git-http, does the requestor have the right to view all refs? // For git-http, does the requestor have the right to view all refs?
ShowAllRefs bool ShowAllRefs bool
} }
......
...@@ -16,7 +16,8 @@ import ( ...@@ -16,7 +16,8 @@ import (
"time" "time"
"github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus"
pb "gitlab.com/gitlab-org/gitaly-proto/go"
"gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/gitaly" "gitlab.com/gitlab-org/gitlab-workhorse/internal/gitaly"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper" "gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
...@@ -29,7 +30,7 @@ type archiveParams struct { ...@@ -29,7 +30,7 @@ type archiveParams struct {
ArchivePrefix string ArchivePrefix string
CommitId string CommitId string
GitalyServer gitaly.Server GitalyServer gitaly.Server
GitalyRepository pb.Repository GitalyRepository gitalypb.Repository
DisableCache bool DisableCache bool
} }
...@@ -128,13 +129,13 @@ func (a *archive) Inject(w http.ResponseWriter, r *http.Request, sendData string ...@@ -128,13 +129,13 @@ func (a *archive) Inject(w http.ResponseWriter, r *http.Request, sendData string
} }
} }
func handleArchiveWithGitaly(r *http.Request, params archiveParams, format pb.GetArchiveRequest_Format) (io.Reader, error) { func handleArchiveWithGitaly(r *http.Request, params archiveParams, format gitalypb.GetArchiveRequest_Format) (io.Reader, error) {
c, err := gitaly.NewRepositoryClient(params.GitalyServer) c, err := gitaly.NewRepositoryClient(params.GitalyServer)
if err != nil { if err != nil {
return nil, err return nil, err
} }
request := &pb.GetArchiveRequest{ request := &gitalypb.GetArchiveRequest{
Repository: &params.GitalyRepository, Repository: &params.GitalyRepository,
CommitId: params.CommitId, CommitId: params.CommitId,
Prefix: params.ArchivePrefix, Prefix: params.ArchivePrefix,
...@@ -144,10 +145,10 @@ func handleArchiveWithGitaly(r *http.Request, params archiveParams, format pb.Ge ...@@ -144,10 +145,10 @@ func handleArchiveWithGitaly(r *http.Request, params archiveParams, format pb.Ge
return c.ArchiveReader(r.Context(), request) return c.ArchiveReader(r.Context(), request)
} }
func setArchiveHeaders(w http.ResponseWriter, format pb.GetArchiveRequest_Format, archiveFilename string) { func setArchiveHeaders(w http.ResponseWriter, format gitalypb.GetArchiveRequest_Format, archiveFilename string) {
w.Header().Del("Content-Length") w.Header().Del("Content-Length")
w.Header().Set("Content-Disposition", fmt.Sprintf(`attachment; filename="%s"`, archiveFilename)) w.Header().Set("Content-Disposition", fmt.Sprintf(`attachment; filename="%s"`, archiveFilename))
if format == pb.GetArchiveRequest_ZIP { if format == gitalypb.GetArchiveRequest_ZIP {
w.Header().Set("Content-Type", "application/zip") w.Header().Set("Content-Type", "application/zip")
} else { } else {
w.Header().Set("Content-Type", "application/octet-stream") w.Header().Set("Content-Type", "application/octet-stream")
...@@ -181,20 +182,20 @@ var ( ...@@ -181,20 +182,20 @@ var (
patternTarBz2 = regexp.MustCompile(`\.(tar\.bz2|tbz|tbz2|tb2|bz2)$`) patternTarBz2 = regexp.MustCompile(`\.(tar\.bz2|tbz|tbz2|tb2|bz2)$`)
) )
func parseBasename(basename string) (pb.GetArchiveRequest_Format, bool) { func parseBasename(basename string) (gitalypb.GetArchiveRequest_Format, bool) {
var format pb.GetArchiveRequest_Format var format gitalypb.GetArchiveRequest_Format
switch { switch {
case (basename == "archive"): case (basename == "archive"):
format = pb.GetArchiveRequest_TAR_GZ format = gitalypb.GetArchiveRequest_TAR_GZ
case patternZip.MatchString(basename): case patternZip.MatchString(basename):
format = pb.GetArchiveRequest_ZIP format = gitalypb.GetArchiveRequest_ZIP
case patternTar.MatchString(basename): case patternTar.MatchString(basename):
format = pb.GetArchiveRequest_TAR format = gitalypb.GetArchiveRequest_TAR
case patternTarGz.MatchString(basename): case patternTarGz.MatchString(basename):
format = pb.GetArchiveRequest_TAR_GZ format = gitalypb.GetArchiveRequest_TAR_GZ
case patternTarBz2.MatchString(basename): case patternTarBz2.MatchString(basename):
format = pb.GetArchiveRequest_TAR_BZ2 format = gitalypb.GetArchiveRequest_TAR_BZ2
default: default:
return format, false return format, false
} }
......
...@@ -5,7 +5,7 @@ import ( ...@@ -5,7 +5,7 @@ import (
"net/http/httptest" "net/http/httptest"
"testing" "testing"
pb "gitlab.com/gitlab-org/gitaly-proto/go" "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper" "gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper"
) )
...@@ -13,17 +13,17 @@ import ( ...@@ -13,17 +13,17 @@ import (
func TestParseBasename(t *testing.T) { func TestParseBasename(t *testing.T) {
for _, testCase := range []struct { for _, testCase := range []struct {
in string in string
out pb.GetArchiveRequest_Format out gitalypb.GetArchiveRequest_Format
}{ }{
{"archive", pb.GetArchiveRequest_TAR_GZ}, {"archive", gitalypb.GetArchiveRequest_TAR_GZ},
{"master.tar.gz", pb.GetArchiveRequest_TAR_GZ}, {"master.tar.gz", gitalypb.GetArchiveRequest_TAR_GZ},
{"foo-master.tgz", pb.GetArchiveRequest_TAR_GZ}, {"foo-master.tgz", gitalypb.GetArchiveRequest_TAR_GZ},
{"foo-v1.2.1.gz", pb.GetArchiveRequest_TAR_GZ}, {"foo-v1.2.1.gz", gitalypb.GetArchiveRequest_TAR_GZ},
{"foo.tar.bz2", pb.GetArchiveRequest_TAR_BZ2}, {"foo.tar.bz2", gitalypb.GetArchiveRequest_TAR_BZ2},
{"archive.tbz", pb.GetArchiveRequest_TAR_BZ2}, {"archive.tbz", gitalypb.GetArchiveRequest_TAR_BZ2},
{"archive.tbz2", pb.GetArchiveRequest_TAR_BZ2}, {"archive.tbz2", gitalypb.GetArchiveRequest_TAR_BZ2},
{"archive.tb2", pb.GetArchiveRequest_TAR_BZ2}, {"archive.tb2", gitalypb.GetArchiveRequest_TAR_BZ2},
{"archive.bz2", pb.GetArchiveRequest_TAR_BZ2}, {"archive.bz2", gitalypb.GetArchiveRequest_TAR_BZ2},
} { } {
basename := testCase.in basename := testCase.in
out, ok := parseBasename(basename) out, ok := parseBasename(basename)
...@@ -53,13 +53,13 @@ func TestFinalizeArchive(t *testing.T) { ...@@ -53,13 +53,13 @@ func TestFinalizeArchive(t *testing.T) {
func TestSetArchiveHeaders(t *testing.T) { func TestSetArchiveHeaders(t *testing.T) {
for _, testCase := range []struct { for _, testCase := range []struct {
in pb.GetArchiveRequest_Format in gitalypb.GetArchiveRequest_Format
out string out string
}{ }{
{pb.GetArchiveRequest_ZIP, "application/zip"}, {gitalypb.GetArchiveRequest_ZIP, "application/zip"},
{pb.GetArchiveRequest_TAR, "application/octet-stream"}, {gitalypb.GetArchiveRequest_TAR, "application/octet-stream"},
{pb.GetArchiveRequest_TAR_GZ, "application/octet-stream"}, {gitalypb.GetArchiveRequest_TAR_GZ, "application/octet-stream"},
{pb.GetArchiveRequest_TAR_BZ2, "application/octet-stream"}, {gitalypb.GetArchiveRequest_TAR_BZ2, "application/octet-stream"},
} { } {
w := httptest.NewRecorder() w := httptest.NewRecorder()
......
...@@ -4,7 +4,7 @@ import ( ...@@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"net/http" "net/http"
pb "gitlab.com/gitlab-org/gitaly-proto/go" "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/gitaly" "gitlab.com/gitlab-org/gitlab-workhorse/internal/gitaly"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper" "gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
...@@ -14,7 +14,7 @@ import ( ...@@ -14,7 +14,7 @@ import (
type blob struct{ senddata.Prefix } type blob struct{ senddata.Prefix }
type blobParams struct { type blobParams struct {
GitalyServer gitaly.Server GitalyServer gitaly.Server
GetBlobRequest pb.GetBlobRequest GetBlobRequest gitalypb.GetBlobRequest
} }
var SendBlob = &blob{"git-blob:"} var SendBlob = &blob{"git-blob:"}
......
...@@ -5,7 +5,8 @@ import ( ...@@ -5,7 +5,8 @@ import (
"net/http" "net/http"
"github.com/golang/protobuf/jsonpb" "github.com/golang/protobuf/jsonpb"
pb "gitlab.com/gitlab-org/gitaly-proto/go"
"gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/gitaly" "gitlab.com/gitlab-org/gitlab-workhorse/internal/gitaly"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper" "gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
...@@ -27,7 +28,7 @@ func (d *diff) Inject(w http.ResponseWriter, r *http.Request, sendData string) { ...@@ -27,7 +28,7 @@ func (d *diff) Inject(w http.ResponseWriter, r *http.Request, sendData string) {
return return
} }
request := &pb.RawDiffRequest{} request := &gitalypb.RawDiffRequest{}
if err := jsonpb.UnmarshalString(params.RawDiffRequest, request); err != nil { if err := jsonpb.UnmarshalString(params.RawDiffRequest, request); err != nil {
helper.Fail500(w, r, fmt.Errorf("diff.RawDiff: %v", err)) helper.Fail500(w, r, fmt.Errorf("diff.RawDiff: %v", err))
return return
......
...@@ -5,7 +5,8 @@ import ( ...@@ -5,7 +5,8 @@ import (
"net/http" "net/http"
"github.com/golang/protobuf/jsonpb" "github.com/golang/protobuf/jsonpb"
pb "gitlab.com/gitlab-org/gitaly-proto/go"
"gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/gitaly" "gitlab.com/gitlab-org/gitlab-workhorse/internal/gitaly"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper" "gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
...@@ -27,7 +28,7 @@ func (p *patch) Inject(w http.ResponseWriter, r *http.Request, sendData string) ...@@ -27,7 +28,7 @@ func (p *patch) Inject(w http.ResponseWriter, r *http.Request, sendData string)
return return
} }
request := &pb.RawPatchRequest{} request := &gitalypb.RawPatchRequest{}
if err := jsonpb.UnmarshalString(params.RawPatchRequest, request); err != nil { if err := jsonpb.UnmarshalString(params.RawPatchRequest, request); err != nil {
helper.Fail500(w, r, fmt.Errorf("diff.RawPatch: %v", err)) helper.Fail500(w, r, fmt.Errorf("diff.RawPatch: %v", err))
return return
......
...@@ -6,7 +6,8 @@ import ( ...@@ -6,7 +6,8 @@ import (
"net/http" "net/http"
"github.com/golang/protobuf/jsonpb" "github.com/golang/protobuf/jsonpb"
pb "gitlab.com/gitlab-org/gitaly-proto/go"
"gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/gitaly" "gitlab.com/gitlab-org/gitlab-workhorse/internal/gitaly"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper" "gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
...@@ -34,7 +35,7 @@ func (s *snapshot) Inject(w http.ResponseWriter, r *http.Request, sendData strin ...@@ -34,7 +35,7 @@ func (s *snapshot) Inject(w http.ResponseWriter, r *http.Request, sendData strin
return return
} }
request := &pb.GetSnapshotRequest{} request := &gitalypb.GetSnapshotRequest{}
if err := jsonpb.UnmarshalString(params.GetSnapshotRequest, request); err != nil { if err := jsonpb.UnmarshalString(params.GetSnapshotRequest, request); err != nil {
helper.Fail500(w, r, fmt.Errorf("SendSnapshot: unmarshal GetSnapshotRequest: %v", err)) helper.Fail500(w, r, fmt.Errorf("SendSnapshot: unmarshal GetSnapshotRequest: %v", err))
return return
......
...@@ -7,15 +7,15 @@ import ( ...@@ -7,15 +7,15 @@ import (
"net/http" "net/http"
"strconv" "strconv"
pb "gitlab.com/gitlab-org/gitaly-proto/go" "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
"gitlab.com/gitlab-org/gitaly/streamio" "gitlab.com/gitlab-org/gitaly/streamio"
) )
type BlobClient struct { type BlobClient struct {
pb.BlobServiceClient gitalypb.BlobServiceClient
} }
func (client *BlobClient) SendBlob(ctx context.Context, w http.ResponseWriter, request *pb.GetBlobRequest) error { func (client *BlobClient) SendBlob(ctx context.Context, w http.ResponseWriter, request *gitalypb.GetBlobRequest) error {
c, err := client.GetBlob(ctx, request) c, err := client.GetBlob(ctx, request)
if err != nil { if err != nil {
return fmt.Errorf("rpc failed: %v", err) return fmt.Errorf("rpc failed: %v", err)
......
...@@ -6,15 +6,15 @@ import ( ...@@ -6,15 +6,15 @@ import (
"io" "io"
"net/http" "net/http"
pb "gitlab.com/gitlab-org/gitaly-proto/go" "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
"gitlab.com/gitlab-org/gitaly/streamio" "gitlab.com/gitlab-org/gitaly/streamio"
) )
type DiffClient struct { type DiffClient struct {
pb.DiffServiceClient gitalypb.DiffServiceClient
} }
func (client *DiffClient) SendRawDiff(ctx context.Context, w http.ResponseWriter, request *pb.RawDiffRequest) error { func (client *DiffClient) SendRawDiff(ctx context.Context, w http.ResponseWriter, request *gitalypb.RawDiffRequest) error {
c, err := client.RawDiff(ctx, request) c, err := client.RawDiff(ctx, request)
if err != nil { if err != nil {
return fmt.Errorf("rpc failed: %v", err) return fmt.Errorf("rpc failed: %v", err)
...@@ -34,7 +34,7 @@ func (client *DiffClient) SendRawDiff(ctx context.Context, w http.ResponseWriter ...@@ -34,7 +34,7 @@ func (client *DiffClient) SendRawDiff(ctx context.Context, w http.ResponseWriter
return nil return nil
} }
func (client *DiffClient) SendRawPatch(ctx context.Context, w http.ResponseWriter, request *pb.RawPatchRequest) error { func (client *DiffClient) SendRawPatch(ctx context.Context, w http.ResponseWriter, request *gitalypb.RawPatchRequest) error {
c, err := client.RawPatch(ctx, request) c, err := client.RawPatch(ctx, request)
if err != nil { if err != nil {
return fmt.Errorf("rpc failed: %v", err) return fmt.Errorf("rpc failed: %v", err)
......
...@@ -5,7 +5,7 @@ import ( ...@@ -5,7 +5,7 @@ import (
grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware" grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus" grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus"
pb "gitlab.com/gitlab-org/gitaly-proto/go" "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
gitalyauth "gitlab.com/gitlab-org/gitaly/auth" gitalyauth "gitlab.com/gitlab-org/gitaly/auth"
gitalyclient "gitlab.com/gitlab-org/gitaly/client" gitalyclient "gitlab.com/gitlab-org/gitaly/client"
"google.golang.org/grpc" "google.golang.org/grpc"
...@@ -32,7 +32,7 @@ func NewSmartHTTPClient(server Server) (*SmartHTTPClient, error) { ...@@ -32,7 +32,7 @@ func NewSmartHTTPClient(server Server) (*SmartHTTPClient, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
grpcClient := pb.NewSmartHTTPServiceClient(conn) grpcClient := gitalypb.NewSmartHTTPServiceClient(conn)
return &SmartHTTPClient{grpcClient}, nil return &SmartHTTPClient{grpcClient}, nil
} }
...@@ -41,7 +41,7 @@ func NewBlobClient(server Server) (*BlobClient, error) { ...@@ -41,7 +41,7 @@ func NewBlobClient(server Server) (*BlobClient, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
grpcClient := pb.NewBlobServiceClient(conn) grpcClient := gitalypb.NewBlobServiceClient(conn)
return &BlobClient{grpcClient}, nil return &BlobClient{grpcClient}, nil
} }
...@@ -50,7 +50,7 @@ func NewRepositoryClient(server Server) (*RepositoryClient, error) { ...@@ -50,7 +50,7 @@ func NewRepositoryClient(server Server) (*RepositoryClient, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
grpcClient := pb.NewRepositoryServiceClient(conn) grpcClient := gitalypb.NewRepositoryServiceClient(conn)
return &RepositoryClient{grpcClient}, nil return &RepositoryClient{grpcClient}, nil
} }
...@@ -60,7 +60,7 @@ func NewNamespaceClient(server Server) (*NamespaceClient, error) { ...@@ -60,7 +60,7 @@ func NewNamespaceClient(server Server) (*NamespaceClient, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
grpcClient := pb.NewNamespaceServiceClient(conn) grpcClient := gitalypb.NewNamespaceServiceClient(conn)
return &NamespaceClient{grpcClient}, nil return &NamespaceClient{grpcClient}, nil
} }
...@@ -69,7 +69,7 @@ func NewDiffClient(server Server) (*DiffClient, error) { ...@@ -69,7 +69,7 @@ func NewDiffClient(server Server) (*DiffClient, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
grpcClient := pb.NewDiffServiceClient(conn) grpcClient := gitalypb.NewDiffServiceClient(conn)
return &DiffClient{grpcClient}, nil return &DiffClient{grpcClient}, nil
} }
......
package gitaly package gitaly
import ( import "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
pb "gitlab.com/gitlab-org/gitaly-proto/go"
)
// NamespaceClient encapsulates NamespaceService calls // NamespaceClient encapsulates NamespaceService calls
type NamespaceClient struct { type NamespaceClient struct {
pb.NamespaceServiceClient gitalypb.NamespaceServiceClient
} }
...@@ -5,18 +5,18 @@ import ( ...@@ -5,18 +5,18 @@ import (
"fmt" "fmt"
"io" "io"
pb "gitlab.com/gitlab-org/gitaly-proto/go" "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
"gitlab.com/gitlab-org/gitaly/streamio" "gitlab.com/gitlab-org/gitaly/streamio"
) )
// RepositoryClient encapsulates RepositoryService calls // RepositoryClient encapsulates RepositoryService calls
type RepositoryClient struct { type RepositoryClient struct {
pb.RepositoryServiceClient gitalypb.RepositoryServiceClient
} }
// ArchiveReader performs a GetArchive Gitaly request and returns an io.Reader // ArchiveReader performs a GetArchive Gitaly request and returns an io.Reader
// for the response // for the response
func (client *RepositoryClient) ArchiveReader(ctx context.Context, request *pb.GetArchiveRequest) (io.Reader, error) { func (client *RepositoryClient) ArchiveReader(ctx context.Context, request *gitalypb.GetArchiveRequest) (io.Reader, error) {
c, err := client.GetArchive(ctx, request) c, err := client.GetArchive(ctx, request)
if err != nil { if err != nil {
return nil, fmt.Errorf("RepositoryService::GetArchive: %v", err) return nil, fmt.Errorf("RepositoryService::GetArchive: %v", err)
...@@ -31,7 +31,7 @@ func (client *RepositoryClient) ArchiveReader(ctx context.Context, request *pb.G ...@@ -31,7 +31,7 @@ func (client *RepositoryClient) ArchiveReader(ctx context.Context, request *pb.G
// SnapshotReader performs a GetSnapshot Gitaly request and returns an io.Reader // SnapshotReader performs a GetSnapshot Gitaly request and returns an io.Reader
// for the response // for the response
func (client *RepositoryClient) SnapshotReader(ctx context.Context, request *pb.GetSnapshotRequest) (io.Reader, error) { func (client *RepositoryClient) SnapshotReader(ctx context.Context, request *gitalypb.GetSnapshotRequest) (io.Reader, error) {
c, err := client.GetSnapshot(ctx, request) c, err := client.GetSnapshot(ctx, request)
if err != nil { if err != nil {
return nil, fmt.Errorf("RepositoryService::GetSnapshot: %v", err) return nil, fmt.Errorf("RepositoryService::GetSnapshot: %v", err)
......
...@@ -5,16 +5,16 @@ import ( ...@@ -5,16 +5,16 @@ import (
"fmt" "fmt"
"io" "io"
pb "gitlab.com/gitlab-org/gitaly-proto/go" "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
"gitlab.com/gitlab-org/gitaly/streamio" "gitlab.com/gitlab-org/gitaly/streamio"
) )
type SmartHTTPClient struct { type SmartHTTPClient struct {
pb.SmartHTTPServiceClient gitalypb.SmartHTTPServiceClient
} }
func (client *SmartHTTPClient) InfoRefsResponseReader(ctx context.Context, repo *pb.Repository, rpc string, gitConfigOptions []string, gitProtocol string) (io.Reader, error) { func (client *SmartHTTPClient) InfoRefsResponseReader(ctx context.Context, repo *gitalypb.Repository, rpc string, gitConfigOptions []string, gitProtocol string) (io.Reader, error) {
rpcRequest := &pb.InfoRefsRequest{ rpcRequest := &gitalypb.InfoRefsRequest{
Repository: repo, Repository: repo,
GitConfigOptions: gitConfigOptions, GitConfigOptions: gitConfigOptions,
GitProtocol: gitProtocol, GitProtocol: gitProtocol,
...@@ -33,7 +33,7 @@ func (client *SmartHTTPClient) InfoRefsResponseReader(ctx context.Context, repo ...@@ -33,7 +33,7 @@ func (client *SmartHTTPClient) InfoRefsResponseReader(ctx context.Context, repo
} }
type infoRefsClient interface { type infoRefsClient interface {
Recv() (*pb.InfoRefsResponse, error) Recv() (*gitalypb.InfoRefsResponse, error)
} }
func infoRefsReader(stream infoRefsClient) io.Reader { func infoRefsReader(stream infoRefsClient) io.Reader {
...@@ -43,13 +43,13 @@ func infoRefsReader(stream infoRefsClient) io.Reader { ...@@ -43,13 +43,13 @@ func infoRefsReader(stream infoRefsClient) io.Reader {
}) })
} }
func (client *SmartHTTPClient) ReceivePack(ctx context.Context, repo *pb.Repository, glId string, glUsername string, glRepository string, gitConfigOptions []string, clientRequest io.Reader, clientResponse io.Writer, gitProtocol string) error { func (client *SmartHTTPClient) ReceivePack(ctx context.Context, repo *gitalypb.Repository, glId string, glUsername string, glRepository string, gitConfigOptions []string, clientRequest io.Reader, clientResponse io.Writer, gitProtocol string) error {
stream, err := client.PostReceivePack(ctx) stream, err := client.PostReceivePack(ctx)
if err != nil { if err != nil {
return err return err
} }
rpcRequest := &pb.PostReceivePackRequest{ rpcRequest := &gitalypb.PostReceivePackRequest{
Repository: repo, Repository: repo,
GlId: glId, GlId: glId,
GlUsername: glUsername, GlUsername: glUsername,
...@@ -76,7 +76,7 @@ func (client *SmartHTTPClient) ReceivePack(ctx context.Context, repo *pb.Reposit ...@@ -76,7 +76,7 @@ func (client *SmartHTTPClient) ReceivePack(ctx context.Context, repo *pb.Reposit
go func() { go func() {
sw := streamio.NewWriter(func(data []byte) error { sw := streamio.NewWriter(func(data []byte) error {
return stream.Send(&pb.PostReceivePackRequest{Data: data}) return stream.Send(&gitalypb.PostReceivePackRequest{Data: data})
}) })
_, err := io.Copy(sw, clientRequest) _, err := io.Copy(sw, clientRequest)
stream.CloseSend() stream.CloseSend()
...@@ -92,13 +92,13 @@ func (client *SmartHTTPClient) ReceivePack(ctx context.Context, repo *pb.Reposit ...@@ -92,13 +92,13 @@ func (client *SmartHTTPClient) ReceivePack(ctx context.Context, repo *pb.Reposit
return nil return nil
} }
func (client *SmartHTTPClient) UploadPack(ctx context.Context, repo *pb.Repository, clientRequest io.Reader, clientResponse io.Writer, gitConfigOptions []string, gitProtocol string) error { func (client *SmartHTTPClient) UploadPack(ctx context.Context, repo *gitalypb.Repository, clientRequest io.Reader, clientResponse io.Writer, gitConfigOptions []string, gitProtocol string) error {
stream, err := client.PostUploadPack(ctx) stream, err := client.PostUploadPack(ctx)
if err != nil { if err != nil {
return err return err
} }
rpcRequest := &pb.PostUploadPackRequest{ rpcRequest := &gitalypb.PostUploadPackRequest{
Repository: repo, Repository: repo,
GitConfigOptions: gitConfigOptions, GitConfigOptions: gitConfigOptions,
GitProtocol: gitProtocol, GitProtocol: gitProtocol,
...@@ -122,7 +122,7 @@ func (client *SmartHTTPClient) UploadPack(ctx context.Context, repo *pb.Reposito ...@@ -122,7 +122,7 @@ func (client *SmartHTTPClient) UploadPack(ctx context.Context, repo *pb.Reposito
go func() { go func() {
sw := streamio.NewWriter(func(data []byte) error { sw := streamio.NewWriter(func(data []byte) error {
return stream.Send(&pb.PostUploadPackRequest{Data: data}) return stream.Send(&gitalypb.PostUploadPackRequest{Data: data})
}) })
_, err := io.Copy(sw, clientRequest) _, err := io.Copy(sw, clientRequest)
stream.CloseSend() stream.CloseSend()
......
...@@ -11,7 +11,7 @@ import ( ...@@ -11,7 +11,7 @@ import (
"github.com/golang/protobuf/jsonpb" "github.com/golang/protobuf/jsonpb"
"github.com/golang/protobuf/proto" "github.com/golang/protobuf/proto"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
pb "gitlab.com/gitlab-org/gitaly-proto/go" "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
"golang.org/x/net/context" "golang.org/x/net/context"
"google.golang.org/grpc/codes" "google.golang.org/grpc/codes"
"google.golang.org/grpc/status" "google.golang.org/grpc/status"
...@@ -49,7 +49,7 @@ func NewGitalyServer(finalMessageCode codes.Code) *GitalyTestServer { ...@@ -49,7 +49,7 @@ func NewGitalyServer(finalMessageCode codes.Code) *GitalyTestServer {
return &GitalyTestServer{finalMessageCode: finalMessageCode} return &GitalyTestServer{finalMessageCode: finalMessageCode}
} }
func (s *GitalyTestServer) InfoRefsUploadPack(in *pb.InfoRefsRequest, stream pb.SmartHTTPService_InfoRefsUploadPackServer) error { func (s *GitalyTestServer) InfoRefsUploadPack(in *gitalypb.InfoRefsRequest, stream gitalypb.SmartHTTPService_InfoRefsUploadPackServer) error {
s.WaitGroup.Add(1) s.WaitGroup.Add(1)
defer s.WaitGroup.Done() defer s.WaitGroup.Done()
...@@ -74,7 +74,7 @@ func (s *GitalyTestServer) InfoRefsUploadPack(in *pb.InfoRefsRequest, stream pb. ...@@ -74,7 +74,7 @@ func (s *GitalyTestServer) InfoRefsUploadPack(in *pb.InfoRefsRequest, stream pb.
return s.sendInfoRefs(stream, data) return s.sendInfoRefs(stream, data)
} }
func (s *GitalyTestServer) InfoRefsReceivePack(in *pb.InfoRefsRequest, stream pb.SmartHTTPService_InfoRefsReceivePackServer) error { func (s *GitalyTestServer) InfoRefsReceivePack(in *gitalypb.InfoRefsRequest, stream gitalypb.SmartHTTPService_InfoRefsReceivePackServer) error {
s.WaitGroup.Add(1) s.WaitGroup.Add(1)
defer s.WaitGroup.Done() defer s.WaitGroup.Done()
...@@ -104,12 +104,12 @@ func marshalJSON(msg proto.Message) (string, error) { ...@@ -104,12 +104,12 @@ func marshalJSON(msg proto.Message) (string, error) {
} }
type infoRefsSender interface { type infoRefsSender interface {
Send(*pb.InfoRefsResponse) error Send(*gitalypb.InfoRefsResponse) error
} }
func (s *GitalyTestServer) sendInfoRefs(stream infoRefsSender, data []byte) error { func (s *GitalyTestServer) sendInfoRefs(stream infoRefsSender, data []byte) error {
nSends, err := sendBytes(data, 100, func(p []byte) error { nSends, err := sendBytes(data, 100, func(p []byte) error {
return stream.Send(&pb.InfoRefsResponse{Data: p}) return stream.Send(&gitalypb.InfoRefsResponse{Data: p})
}) })
if err != nil { if err != nil {
return err return err
...@@ -121,7 +121,7 @@ func (s *GitalyTestServer) sendInfoRefs(stream infoRefsSender, data []byte) erro ...@@ -121,7 +121,7 @@ func (s *GitalyTestServer) sendInfoRefs(stream infoRefsSender, data []byte) erro
return s.finalError() return s.finalError()
} }
func (s *GitalyTestServer) PostReceivePack(stream pb.SmartHTTPService_PostReceivePackServer) error { func (s *GitalyTestServer) PostReceivePack(stream gitalypb.SmartHTTPService_PostReceivePackServer) error {
s.WaitGroup.Add(1) s.WaitGroup.Add(1)
defer s.WaitGroup.Done() defer s.WaitGroup.Done()
...@@ -157,7 +157,7 @@ func (s *GitalyTestServer) PostReceivePack(stream pb.SmartHTTPService_PostReceiv ...@@ -157,7 +157,7 @@ func (s *GitalyTestServer) PostReceivePack(stream pb.SmartHTTPService_PostReceiv
} }
nSends, _ := sendBytes(data, 100, func(p []byte) error { nSends, _ := sendBytes(data, 100, func(p []byte) error {
return stream.Send(&pb.PostReceivePackResponse{Data: p}) return stream.Send(&gitalypb.PostReceivePackResponse{Data: p})
}) })
if nSends <= 1 { if nSends <= 1 {
...@@ -167,7 +167,7 @@ func (s *GitalyTestServer) PostReceivePack(stream pb.SmartHTTPService_PostReceiv ...@@ -167,7 +167,7 @@ func (s *GitalyTestServer) PostReceivePack(stream pb.SmartHTTPService_PostReceiv
return s.finalError() return s.finalError()
} }
func (s *GitalyTestServer) PostUploadPack(stream pb.SmartHTTPService_PostUploadPackServer) error { func (s *GitalyTestServer) PostUploadPack(stream gitalypb.SmartHTTPService_PostUploadPackServer) error {
s.WaitGroup.Add(1) s.WaitGroup.Add(1)
defer s.WaitGroup.Done() defer s.WaitGroup.Done()
...@@ -203,7 +203,7 @@ func (s *GitalyTestServer) PostUploadPack(stream pb.SmartHTTPService_PostUploadP ...@@ -203,7 +203,7 @@ func (s *GitalyTestServer) PostUploadPack(stream pb.SmartHTTPService_PostUploadP
} }
nSends, _ := sendBytes(data, 100, func(p []byte) error { nSends, _ := sendBytes(data, 100, func(p []byte) error {
return stream.Send(&pb.PostUploadPackResponse{Data: p}) return stream.Send(&gitalypb.PostUploadPackResponse{Data: p})
}) })
if nSends <= 1 { if nSends <= 1 {
...@@ -213,11 +213,11 @@ func (s *GitalyTestServer) PostUploadPack(stream pb.SmartHTTPService_PostUploadP ...@@ -213,11 +213,11 @@ func (s *GitalyTestServer) PostUploadPack(stream pb.SmartHTTPService_PostUploadP
return s.finalError() return s.finalError()
} }
func (s *GitalyTestServer) CommitIsAncestor(ctx context.Context, in *pb.CommitIsAncestorRequest) (*pb.CommitIsAncestorResponse, error) { func (s *GitalyTestServer) CommitIsAncestor(ctx context.Context, in *gitalypb.CommitIsAncestorRequest) (*gitalypb.CommitIsAncestorResponse, error) {
return nil, nil return nil, nil
} }
func (s *GitalyTestServer) GetBlob(in *pb.GetBlobRequest, stream pb.BlobService_GetBlobServer) error { func (s *GitalyTestServer) GetBlob(in *gitalypb.GetBlobRequest, stream gitalypb.BlobService_GetBlobServer) error {
s.WaitGroup.Add(1) s.WaitGroup.Add(1)
defer s.WaitGroup.Done() defer s.WaitGroup.Done()
...@@ -225,7 +225,7 @@ func (s *GitalyTestServer) GetBlob(in *pb.GetBlobRequest, stream pb.BlobService_ ...@@ -225,7 +225,7 @@ func (s *GitalyTestServer) GetBlob(in *pb.GetBlobRequest, stream pb.BlobService_
return err return err
} }
response := &pb.GetBlobResponse{ response := &gitalypb.GetBlobResponse{
Oid: in.GetOid(), Oid: in.GetOid(),
Size: int64(len(GitalyGetBlobResponseMock)), Size: int64(len(GitalyGetBlobResponseMock)),
} }
...@@ -237,7 +237,7 @@ func (s *GitalyTestServer) GetBlob(in *pb.GetBlobRequest, stream pb.BlobService_ ...@@ -237,7 +237,7 @@ func (s *GitalyTestServer) GetBlob(in *pb.GetBlobRequest, stream pb.BlobService_
} }
// Use a new response so we don't send other fields (Size, ...) over and over // Use a new response so we don't send other fields (Size, ...) over and over
response = &pb.GetBlobResponse{} response = &gitalypb.GetBlobResponse{}
return nil return nil
}) })
...@@ -251,7 +251,7 @@ func (s *GitalyTestServer) GetBlob(in *pb.GetBlobRequest, stream pb.BlobService_ ...@@ -251,7 +251,7 @@ func (s *GitalyTestServer) GetBlob(in *pb.GetBlobRequest, stream pb.BlobService_
return s.finalError() return s.finalError()
} }
func (s *GitalyTestServer) GetArchive(in *pb.GetArchiveRequest, stream pb.RepositoryService_GetArchiveServer) error { func (s *GitalyTestServer) GetArchive(in *gitalypb.GetArchiveRequest, stream gitalypb.RepositoryService_GetArchiveServer) error {
s.WaitGroup.Add(1) s.WaitGroup.Add(1)
defer s.WaitGroup.Done() defer s.WaitGroup.Done()
...@@ -260,7 +260,7 @@ func (s *GitalyTestServer) GetArchive(in *pb.GetArchiveRequest, stream pb.Reposi ...@@ -260,7 +260,7 @@ func (s *GitalyTestServer) GetArchive(in *pb.GetArchiveRequest, stream pb.Reposi
} }
nSends, err := sendBytes([]byte(GitalyGetArchiveResponseMock), 100, func(p []byte) error { nSends, err := sendBytes([]byte(GitalyGetArchiveResponseMock), 100, func(p []byte) error {
return stream.Send(&pb.GetArchiveResponse{Data: p}) return stream.Send(&gitalypb.GetArchiveResponse{Data: p})
}) })
if err != nil { if err != nil {
return err return err
...@@ -272,9 +272,9 @@ func (s *GitalyTestServer) GetArchive(in *pb.GetArchiveRequest, stream pb.Reposi ...@@ -272,9 +272,9 @@ func (s *GitalyTestServer) GetArchive(in *pb.GetArchiveRequest, stream pb.Reposi
return s.finalError() return s.finalError()
} }
func (s *GitalyTestServer) RawDiff(in *pb.RawDiffRequest, stream pb.DiffService_RawDiffServer) error { func (s *GitalyTestServer) RawDiff(in *gitalypb.RawDiffRequest, stream gitalypb.DiffService_RawDiffServer) error {
nSends, err := sendBytes([]byte(GitalyGetDiffResponseMock), 100, func(p []byte) error { nSends, err := sendBytes([]byte(GitalyGetDiffResponseMock), 100, func(p []byte) error {
return stream.Send(&pb.RawDiffResponse{ return stream.Send(&gitalypb.RawDiffResponse{
Data: p, Data: p,
}) })
}) })
...@@ -288,7 +288,7 @@ func (s *GitalyTestServer) RawDiff(in *pb.RawDiffRequest, stream pb.DiffService_ ...@@ -288,7 +288,7 @@ func (s *GitalyTestServer) RawDiff(in *pb.RawDiffRequest, stream pb.DiffService_
return s.finalError() return s.finalError()
} }
func (s *GitalyTestServer) RawPatch(in *pb.RawPatchRequest, stream pb.DiffService_RawPatchServer) error { func (s *GitalyTestServer) RawPatch(in *gitalypb.RawPatchRequest, stream gitalypb.DiffService_RawPatchServer) error {
s.WaitGroup.Add(1) s.WaitGroup.Add(1)
defer s.WaitGroup.Done() defer s.WaitGroup.Done()
...@@ -297,7 +297,7 @@ func (s *GitalyTestServer) RawPatch(in *pb.RawPatchRequest, stream pb.DiffServic ...@@ -297,7 +297,7 @@ func (s *GitalyTestServer) RawPatch(in *pb.RawPatchRequest, stream pb.DiffServic
} }
nSends, err := sendBytes([]byte(GitalyGetPatchResponseMock), 100, func(p []byte) error { nSends, err := sendBytes([]byte(GitalyGetPatchResponseMock), 100, func(p []byte) error {
return stream.Send(&pb.RawPatchResponse{ return stream.Send(&gitalypb.RawPatchResponse{
Data: p, Data: p,
}) })
}) })
...@@ -311,7 +311,7 @@ func (s *GitalyTestServer) RawPatch(in *pb.RawPatchRequest, stream pb.DiffServic ...@@ -311,7 +311,7 @@ func (s *GitalyTestServer) RawPatch(in *pb.RawPatchRequest, stream pb.DiffServic
return s.finalError() return s.finalError()
} }
func (s *GitalyTestServer) GetSnapshot(in *pb.GetSnapshotRequest, stream pb.RepositoryService_GetSnapshotServer) error { func (s *GitalyTestServer) GetSnapshot(in *gitalypb.GetSnapshotRequest, stream gitalypb.RepositoryService_GetSnapshotServer) error {
s.WaitGroup.Add(1) s.WaitGroup.Add(1)
defer s.WaitGroup.Done() defer s.WaitGroup.Done()
...@@ -320,7 +320,7 @@ func (s *GitalyTestServer) GetSnapshot(in *pb.GetSnapshotRequest, stream pb.Repo ...@@ -320,7 +320,7 @@ func (s *GitalyTestServer) GetSnapshot(in *pb.GetSnapshotRequest, stream pb.Repo
} }
nSends, err := sendBytes([]byte(GitalyGetSnapshotResponseMock), 100, func(p []byte) error { nSends, err := sendBytes([]byte(GitalyGetSnapshotResponseMock), 100, func(p []byte) error {
return stream.Send(&pb.GetSnapshotResponse{Data: p}) return stream.Send(&gitalypb.GetSnapshotResponse{Data: p})
}) })
if err != nil { if err != nil {
return err return err
...@@ -358,7 +358,7 @@ func (s *GitalyTestServer) finalError() error { ...@@ -358,7 +358,7 @@ func (s *GitalyTestServer) finalError() error {
return nil return nil
} }
func validateRepository(repo *pb.Repository) error { func validateRepository(repo *gitalypb.Repository) error {
if len(repo.GetStorageName()) == 0 { if len(repo.GetStorageName()) == 0 {
return fmt.Errorf("missing storage_name: %v", repo) return fmt.Errorf("missing storage_name: %v", repo)
} }
......
This diff is collapsed.
...@@ -19,7 +19,8 @@ import ( ...@@ -19,7 +19,8 @@ import (
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
pb "gitlab.com/gitlab-org/gitaly-proto/go"
"gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/api" "gitlab.com/gitlab-org/gitlab-workhorse/internal/api"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/config" "gitlab.com/gitlab-org/gitlab-workhorse/internal/config"
...@@ -525,7 +526,7 @@ func gitOkBody(t *testing.T) *api.Response { ...@@ -525,7 +526,7 @@ func gitOkBody(t *testing.T) *api.Response {
return &api.Response{ return &api.Response{
GL_ID: "user-123", GL_ID: "user-123",
GL_USERNAME: "username", GL_USERNAME: "username",
Repository: pb.Repository{ Repository: gitalypb.Repository{
StorageName: "default", StorageName: "default",
RelativePath: "foo/bar.git", RelativePath: "foo/bar.git",
}, },
......
# Auto-generated Go gRPC bindings for gitaly
This Go package is used both by the Gitaly server itself and by Go
Gitaly clients (such as gitlab-workhorse).
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// source: conflicts.proto // source: conflicts.proto
package gitaly package gitalypb
import proto "github.com/golang/protobuf/proto" import proto "github.com/golang/protobuf/proto"
import fmt "fmt" import fmt "fmt"
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// source: namespace.proto // source: namespace.proto
package gitaly package gitalypb
import proto "github.com/golang/protobuf/proto" import proto "github.com/golang/protobuf/proto"
import fmt "fmt" import fmt "fmt"
...@@ -25,7 +25,7 @@ type AddNamespaceRequest struct { ...@@ -25,7 +25,7 @@ type AddNamespaceRequest struct {
func (m *AddNamespaceRequest) Reset() { *m = AddNamespaceRequest{} } func (m *AddNamespaceRequest) Reset() { *m = AddNamespaceRequest{} }
func (m *AddNamespaceRequest) String() string { return proto.CompactTextString(m) } func (m *AddNamespaceRequest) String() string { return proto.CompactTextString(m) }
func (*AddNamespaceRequest) ProtoMessage() {} func (*AddNamespaceRequest) ProtoMessage() {}
func (*AddNamespaceRequest) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{0} } func (*AddNamespaceRequest) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{0} }
func (m *AddNamespaceRequest) GetStorageName() string { func (m *AddNamespaceRequest) GetStorageName() string {
if m != nil { if m != nil {
...@@ -49,7 +49,7 @@ type RemoveNamespaceRequest struct { ...@@ -49,7 +49,7 @@ type RemoveNamespaceRequest struct {
func (m *RemoveNamespaceRequest) Reset() { *m = RemoveNamespaceRequest{} } func (m *RemoveNamespaceRequest) Reset() { *m = RemoveNamespaceRequest{} }
func (m *RemoveNamespaceRequest) String() string { return proto.CompactTextString(m) } func (m *RemoveNamespaceRequest) String() string { return proto.CompactTextString(m) }
func (*RemoveNamespaceRequest) ProtoMessage() {} func (*RemoveNamespaceRequest) ProtoMessage() {}
func (*RemoveNamespaceRequest) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{1} } func (*RemoveNamespaceRequest) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{1} }
func (m *RemoveNamespaceRequest) GetStorageName() string { func (m *RemoveNamespaceRequest) GetStorageName() string {
if m != nil { if m != nil {
...@@ -74,7 +74,7 @@ type RenameNamespaceRequest struct { ...@@ -74,7 +74,7 @@ type RenameNamespaceRequest struct {
func (m *RenameNamespaceRequest) Reset() { *m = RenameNamespaceRequest{} } func (m *RenameNamespaceRequest) Reset() { *m = RenameNamespaceRequest{} }
func (m *RenameNamespaceRequest) String() string { return proto.CompactTextString(m) } func (m *RenameNamespaceRequest) String() string { return proto.CompactTextString(m) }
func (*RenameNamespaceRequest) ProtoMessage() {} func (*RenameNamespaceRequest) ProtoMessage() {}
func (*RenameNamespaceRequest) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{2} } func (*RenameNamespaceRequest) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{2} }
func (m *RenameNamespaceRequest) GetStorageName() string { func (m *RenameNamespaceRequest) GetStorageName() string {
if m != nil { if m != nil {
...@@ -105,7 +105,7 @@ type NamespaceExistsRequest struct { ...@@ -105,7 +105,7 @@ type NamespaceExistsRequest struct {
func (m *NamespaceExistsRequest) Reset() { *m = NamespaceExistsRequest{} } func (m *NamespaceExistsRequest) Reset() { *m = NamespaceExistsRequest{} }
func (m *NamespaceExistsRequest) String() string { return proto.CompactTextString(m) } func (m *NamespaceExistsRequest) String() string { return proto.CompactTextString(m) }
func (*NamespaceExistsRequest) ProtoMessage() {} func (*NamespaceExistsRequest) ProtoMessage() {}
func (*NamespaceExistsRequest) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{3} } func (*NamespaceExistsRequest) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{3} }
func (m *NamespaceExistsRequest) GetStorageName() string { func (m *NamespaceExistsRequest) GetStorageName() string {
if m != nil { if m != nil {
...@@ -128,7 +128,7 @@ type NamespaceExistsResponse struct { ...@@ -128,7 +128,7 @@ type NamespaceExistsResponse struct {
func (m *NamespaceExistsResponse) Reset() { *m = NamespaceExistsResponse{} } func (m *NamespaceExistsResponse) Reset() { *m = NamespaceExistsResponse{} }
func (m *NamespaceExistsResponse) String() string { return proto.CompactTextString(m) } func (m *NamespaceExistsResponse) String() string { return proto.CompactTextString(m) }
func (*NamespaceExistsResponse) ProtoMessage() {} func (*NamespaceExistsResponse) ProtoMessage() {}
func (*NamespaceExistsResponse) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{4} } func (*NamespaceExistsResponse) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{4} }
func (m *NamespaceExistsResponse) GetExists() bool { func (m *NamespaceExistsResponse) GetExists() bool {
if m != nil { if m != nil {
...@@ -143,7 +143,7 @@ type AddNamespaceResponse struct { ...@@ -143,7 +143,7 @@ type AddNamespaceResponse struct {
func (m *AddNamespaceResponse) Reset() { *m = AddNamespaceResponse{} } func (m *AddNamespaceResponse) Reset() { *m = AddNamespaceResponse{} }
func (m *AddNamespaceResponse) String() string { return proto.CompactTextString(m) } func (m *AddNamespaceResponse) String() string { return proto.CompactTextString(m) }
func (*AddNamespaceResponse) ProtoMessage() {} func (*AddNamespaceResponse) ProtoMessage() {}
func (*AddNamespaceResponse) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{5} } func (*AddNamespaceResponse) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{5} }
type RemoveNamespaceResponse struct { type RemoveNamespaceResponse struct {
} }
...@@ -151,7 +151,7 @@ type RemoveNamespaceResponse struct { ...@@ -151,7 +151,7 @@ type RemoveNamespaceResponse struct {
func (m *RemoveNamespaceResponse) Reset() { *m = RemoveNamespaceResponse{} } func (m *RemoveNamespaceResponse) Reset() { *m = RemoveNamespaceResponse{} }
func (m *RemoveNamespaceResponse) String() string { return proto.CompactTextString(m) } func (m *RemoveNamespaceResponse) String() string { return proto.CompactTextString(m) }
func (*RemoveNamespaceResponse) ProtoMessage() {} func (*RemoveNamespaceResponse) ProtoMessage() {}
func (*RemoveNamespaceResponse) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{6} } func (*RemoveNamespaceResponse) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{6} }
type RenameNamespaceResponse struct { type RenameNamespaceResponse struct {
} }
...@@ -159,7 +159,7 @@ type RenameNamespaceResponse struct { ...@@ -159,7 +159,7 @@ type RenameNamespaceResponse struct {
func (m *RenameNamespaceResponse) Reset() { *m = RenameNamespaceResponse{} } func (m *RenameNamespaceResponse) Reset() { *m = RenameNamespaceResponse{} }
func (m *RenameNamespaceResponse) String() string { return proto.CompactTextString(m) } func (m *RenameNamespaceResponse) String() string { return proto.CompactTextString(m) }
func (*RenameNamespaceResponse) ProtoMessage() {} func (*RenameNamespaceResponse) ProtoMessage() {}
func (*RenameNamespaceResponse) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{7} } func (*RenameNamespaceResponse) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{7} }
func init() { func init() {
proto.RegisterType((*AddNamespaceRequest)(nil), "gitaly.AddNamespaceRequest") proto.RegisterType((*AddNamespaceRequest)(nil), "gitaly.AddNamespaceRequest")
...@@ -343,9 +343,9 @@ var _NamespaceService_serviceDesc = grpc.ServiceDesc{ ...@@ -343,9 +343,9 @@ var _NamespaceService_serviceDesc = grpc.ServiceDesc{
Metadata: "namespace.proto", Metadata: "namespace.proto",
} }
func init() { proto.RegisterFile("namespace.proto", fileDescriptor5) } func init() { proto.RegisterFile("namespace.proto", fileDescriptor4) }
var fileDescriptor5 = []byte{ var fileDescriptor4 = []byte{
// 291 bytes of a gzipped FileDescriptorProto // 291 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xcf, 0x4b, 0xcc, 0x4d, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xcf, 0x4b, 0xcc, 0x4d,
0x2d, 0x2e, 0x48, 0x4c, 0x4e, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x4b, 0xcf, 0x2c, 0x2d, 0x2e, 0x48, 0x4c, 0x4e, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x4b, 0xcf, 0x2c,
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// source: notifications.proto // source: notifications.proto
package gitaly package gitalypb
import proto "github.com/golang/protobuf/proto" import proto "github.com/golang/protobuf/proto"
import fmt "fmt" import fmt "fmt"
...@@ -24,7 +24,7 @@ type PostReceiveRequest struct { ...@@ -24,7 +24,7 @@ type PostReceiveRequest struct {
func (m *PostReceiveRequest) Reset() { *m = PostReceiveRequest{} } func (m *PostReceiveRequest) Reset() { *m = PostReceiveRequest{} }
func (m *PostReceiveRequest) String() string { return proto.CompactTextString(m) } func (m *PostReceiveRequest) String() string { return proto.CompactTextString(m) }
func (*PostReceiveRequest) ProtoMessage() {} func (*PostReceiveRequest) ProtoMessage() {}
func (*PostReceiveRequest) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{0} } func (*PostReceiveRequest) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{0} }
func (m *PostReceiveRequest) GetRepository() *Repository { func (m *PostReceiveRequest) GetRepository() *Repository {
if m != nil { if m != nil {
...@@ -39,7 +39,7 @@ type PostReceiveResponse struct { ...@@ -39,7 +39,7 @@ type PostReceiveResponse struct {
func (m *PostReceiveResponse) Reset() { *m = PostReceiveResponse{} } func (m *PostReceiveResponse) Reset() { *m = PostReceiveResponse{} }
func (m *PostReceiveResponse) String() string { return proto.CompactTextString(m) } func (m *PostReceiveResponse) String() string { return proto.CompactTextString(m) }
func (*PostReceiveResponse) ProtoMessage() {} func (*PostReceiveResponse) ProtoMessage() {}
func (*PostReceiveResponse) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{1} } func (*PostReceiveResponse) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{1} }
func init() { func init() {
proto.RegisterType((*PostReceiveRequest)(nil), "gitaly.PostReceiveRequest") proto.RegisterType((*PostReceiveRequest)(nil), "gitaly.PostReceiveRequest")
...@@ -118,9 +118,9 @@ var _NotificationService_serviceDesc = grpc.ServiceDesc{ ...@@ -118,9 +118,9 @@ var _NotificationService_serviceDesc = grpc.ServiceDesc{
Metadata: "notifications.proto", Metadata: "notifications.proto",
} }
func init() { proto.RegisterFile("notifications.proto", fileDescriptor6) } func init() { proto.RegisterFile("notifications.proto", fileDescriptor5) }
var fileDescriptor6 = []byte{ var fileDescriptor5 = []byte{
// 170 bytes of a gzipped FileDescriptorProto // 170 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xce, 0xcb, 0x2f, 0xc9, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xce, 0xcb, 0x2f, 0xc9,
0x4c, 0xcb, 0x4c, 0x4e, 0x2c, 0xc9, 0xcc, 0xcf, 0x2b, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x4c, 0xcb, 0x4c, 0x4e, 0x2c, 0xc9, 0xcc, 0xcf, 0x2b, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17,
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// source: server.proto // source: server.proto
package gitaly package gitalypb
import proto "github.com/golang/protobuf/proto" import proto "github.com/golang/protobuf/proto"
import fmt "fmt" import fmt "fmt"
...@@ -23,7 +23,7 @@ type ServerInfoRequest struct { ...@@ -23,7 +23,7 @@ type ServerInfoRequest struct {
func (m *ServerInfoRequest) Reset() { *m = ServerInfoRequest{} } func (m *ServerInfoRequest) Reset() { *m = ServerInfoRequest{} }
func (m *ServerInfoRequest) String() string { return proto.CompactTextString(m) } func (m *ServerInfoRequest) String() string { return proto.CompactTextString(m) }
func (*ServerInfoRequest) ProtoMessage() {} func (*ServerInfoRequest) ProtoMessage() {}
func (*ServerInfoRequest) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{0} } func (*ServerInfoRequest) Descriptor() ([]byte, []int) { return fileDescriptor10, []int{0} }
type ServerInfoResponse struct { type ServerInfoResponse struct {
ServerVersion string `protobuf:"bytes,1,opt,name=server_version,json=serverVersion" json:"server_version,omitempty"` ServerVersion string `protobuf:"bytes,1,opt,name=server_version,json=serverVersion" json:"server_version,omitempty"`
...@@ -34,7 +34,7 @@ type ServerInfoResponse struct { ...@@ -34,7 +34,7 @@ type ServerInfoResponse struct {
func (m *ServerInfoResponse) Reset() { *m = ServerInfoResponse{} } func (m *ServerInfoResponse) Reset() { *m = ServerInfoResponse{} }
func (m *ServerInfoResponse) String() string { return proto.CompactTextString(m) } func (m *ServerInfoResponse) String() string { return proto.CompactTextString(m) }
func (*ServerInfoResponse) ProtoMessage() {} func (*ServerInfoResponse) ProtoMessage() {}
func (*ServerInfoResponse) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{1} } func (*ServerInfoResponse) Descriptor() ([]byte, []int) { return fileDescriptor10, []int{1} }
func (m *ServerInfoResponse) GetServerVersion() string { func (m *ServerInfoResponse) GetServerVersion() string {
if m != nil { if m != nil {
...@@ -67,7 +67,7 @@ func (m *ServerInfoResponse_StorageStatus) Reset() { *m = ServerInfoResp ...@@ -67,7 +67,7 @@ func (m *ServerInfoResponse_StorageStatus) Reset() { *m = ServerInfoResp
func (m *ServerInfoResponse_StorageStatus) String() string { return proto.CompactTextString(m) } func (m *ServerInfoResponse_StorageStatus) String() string { return proto.CompactTextString(m) }
func (*ServerInfoResponse_StorageStatus) ProtoMessage() {} func (*ServerInfoResponse_StorageStatus) ProtoMessage() {}
func (*ServerInfoResponse_StorageStatus) Descriptor() ([]byte, []int) { func (*ServerInfoResponse_StorageStatus) Descriptor() ([]byte, []int) {
return fileDescriptor11, []int{1, 0} return fileDescriptor10, []int{1, 0}
} }
func (m *ServerInfoResponse_StorageStatus) GetStorageName() string { func (m *ServerInfoResponse_StorageStatus) GetStorageName() string {
...@@ -169,9 +169,9 @@ var _ServerService_serviceDesc = grpc.ServiceDesc{ ...@@ -169,9 +169,9 @@ var _ServerService_serviceDesc = grpc.ServiceDesc{
Metadata: "server.proto", Metadata: "server.proto",
} }
func init() { proto.RegisterFile("server.proto", fileDescriptor11) } func init() { proto.RegisterFile("server.proto", fileDescriptor10) }
var fileDescriptor11 = []byte{ var fileDescriptor10 = []byte{
// 258 bytes of a gzipped FileDescriptorProto // 258 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0xcf, 0x4a, 0xc3, 0x40, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0xcf, 0x4a, 0xc3, 0x40,
0x10, 0xc6, 0x6d, 0x03, 0xa5, 0x9d, 0x34, 0xfe, 0x19, 0x2f, 0x35, 0x08, 0xd6, 0x80, 0x90, 0x53, 0x10, 0xc6, 0x6d, 0x03, 0xa5, 0x9d, 0x34, 0xfe, 0x19, 0x2f, 0x35, 0x08, 0xd6, 0x80, 0x90, 0x53,
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// source: smarthttp.proto // source: smarthttp.proto
package gitaly package gitalypb
import proto "github.com/golang/protobuf/proto" import proto "github.com/golang/protobuf/proto"
import fmt "fmt" import fmt "fmt"
...@@ -28,7 +28,7 @@ type InfoRefsRequest struct { ...@@ -28,7 +28,7 @@ type InfoRefsRequest struct {
func (m *InfoRefsRequest) Reset() { *m = InfoRefsRequest{} } func (m *InfoRefsRequest) Reset() { *m = InfoRefsRequest{} }
func (m *InfoRefsRequest) String() string { return proto.CompactTextString(m) } func (m *InfoRefsRequest) String() string { return proto.CompactTextString(m) }
func (*InfoRefsRequest) ProtoMessage() {} func (*InfoRefsRequest) ProtoMessage() {}
func (*InfoRefsRequest) Descriptor() ([]byte, []int) { return fileDescriptor13, []int{0} } func (*InfoRefsRequest) Descriptor() ([]byte, []int) { return fileDescriptor12, []int{0} }
func (m *InfoRefsRequest) GetRepository() *Repository { func (m *InfoRefsRequest) GetRepository() *Repository {
if m != nil { if m != nil {
...@@ -58,7 +58,7 @@ type InfoRefsResponse struct { ...@@ -58,7 +58,7 @@ type InfoRefsResponse struct {
func (m *InfoRefsResponse) Reset() { *m = InfoRefsResponse{} } func (m *InfoRefsResponse) Reset() { *m = InfoRefsResponse{} }
func (m *InfoRefsResponse) String() string { return proto.CompactTextString(m) } func (m *InfoRefsResponse) String() string { return proto.CompactTextString(m) }
func (*InfoRefsResponse) ProtoMessage() {} func (*InfoRefsResponse) ProtoMessage() {}
func (*InfoRefsResponse) Descriptor() ([]byte, []int) { return fileDescriptor13, []int{1} } func (*InfoRefsResponse) Descriptor() ([]byte, []int) { return fileDescriptor12, []int{1} }
func (m *InfoRefsResponse) GetData() []byte { func (m *InfoRefsResponse) GetData() []byte {
if m != nil { if m != nil {
...@@ -81,7 +81,7 @@ type PostUploadPackRequest struct { ...@@ -81,7 +81,7 @@ type PostUploadPackRequest struct {
func (m *PostUploadPackRequest) Reset() { *m = PostUploadPackRequest{} } func (m *PostUploadPackRequest) Reset() { *m = PostUploadPackRequest{} }
func (m *PostUploadPackRequest) String() string { return proto.CompactTextString(m) } func (m *PostUploadPackRequest) String() string { return proto.CompactTextString(m) }
func (*PostUploadPackRequest) ProtoMessage() {} func (*PostUploadPackRequest) ProtoMessage() {}
func (*PostUploadPackRequest) Descriptor() ([]byte, []int) { return fileDescriptor13, []int{2} } func (*PostUploadPackRequest) Descriptor() ([]byte, []int) { return fileDescriptor12, []int{2} }
func (m *PostUploadPackRequest) GetRepository() *Repository { func (m *PostUploadPackRequest) GetRepository() *Repository {
if m != nil { if m != nil {
...@@ -119,7 +119,7 @@ type PostUploadPackResponse struct { ...@@ -119,7 +119,7 @@ type PostUploadPackResponse struct {
func (m *PostUploadPackResponse) Reset() { *m = PostUploadPackResponse{} } func (m *PostUploadPackResponse) Reset() { *m = PostUploadPackResponse{} }
func (m *PostUploadPackResponse) String() string { return proto.CompactTextString(m) } func (m *PostUploadPackResponse) String() string { return proto.CompactTextString(m) }
func (*PostUploadPackResponse) ProtoMessage() {} func (*PostUploadPackResponse) ProtoMessage() {}
func (*PostUploadPackResponse) Descriptor() ([]byte, []int) { return fileDescriptor13, []int{3} } func (*PostUploadPackResponse) Descriptor() ([]byte, []int) { return fileDescriptor12, []int{3} }
func (m *PostUploadPackResponse) GetData() []byte { func (m *PostUploadPackResponse) GetData() []byte {
if m != nil { if m != nil {
...@@ -147,7 +147,7 @@ type PostReceivePackRequest struct { ...@@ -147,7 +147,7 @@ type PostReceivePackRequest struct {
func (m *PostReceivePackRequest) Reset() { *m = PostReceivePackRequest{} } func (m *PostReceivePackRequest) Reset() { *m = PostReceivePackRequest{} }
func (m *PostReceivePackRequest) String() string { return proto.CompactTextString(m) } func (m *PostReceivePackRequest) String() string { return proto.CompactTextString(m) }
func (*PostReceivePackRequest) ProtoMessage() {} func (*PostReceivePackRequest) ProtoMessage() {}
func (*PostReceivePackRequest) Descriptor() ([]byte, []int) { return fileDescriptor13, []int{4} } func (*PostReceivePackRequest) Descriptor() ([]byte, []int) { return fileDescriptor12, []int{4} }
func (m *PostReceivePackRequest) GetRepository() *Repository { func (m *PostReceivePackRequest) GetRepository() *Repository {
if m != nil { if m != nil {
...@@ -206,7 +206,7 @@ type PostReceivePackResponse struct { ...@@ -206,7 +206,7 @@ type PostReceivePackResponse struct {
func (m *PostReceivePackResponse) Reset() { *m = PostReceivePackResponse{} } func (m *PostReceivePackResponse) Reset() { *m = PostReceivePackResponse{} }
func (m *PostReceivePackResponse) String() string { return proto.CompactTextString(m) } func (m *PostReceivePackResponse) String() string { return proto.CompactTextString(m) }
func (*PostReceivePackResponse) ProtoMessage() {} func (*PostReceivePackResponse) ProtoMessage() {}
func (*PostReceivePackResponse) Descriptor() ([]byte, []int) { return fileDescriptor13, []int{5} } func (*PostReceivePackResponse) Descriptor() ([]byte, []int) { return fileDescriptor12, []int{5} }
func (m *PostReceivePackResponse) GetData() []byte { func (m *PostReceivePackResponse) GetData() []byte {
if m != nil { if m != nil {
...@@ -521,9 +521,9 @@ var _SmartHTTPService_serviceDesc = grpc.ServiceDesc{ ...@@ -521,9 +521,9 @@ var _SmartHTTPService_serviceDesc = grpc.ServiceDesc{
Metadata: "smarthttp.proto", Metadata: "smarthttp.proto",
} }
func init() { proto.RegisterFile("smarthttp.proto", fileDescriptor13) } func init() { proto.RegisterFile("smarthttp.proto", fileDescriptor12) }
var fileDescriptor13 = []byte{ var fileDescriptor12 = []byte{
// 423 bytes of a gzipped FileDescriptorProto // 423 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x53, 0xd1, 0x8a, 0xd3, 0x40, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x53, 0xd1, 0x8a, 0xd3, 0x40,
0x14, 0x75, 0xd2, 0x6e, 0x65, 0x6f, 0xa3, 0x2d, 0x77, 0xd1, 0x0d, 0x01, 0xdd, 0x1a, 0x41, 0xf2, 0x14, 0x75, 0xd2, 0x6e, 0x65, 0x6f, 0xa3, 0x2d, 0x77, 0xd1, 0x0d, 0x01, 0xdd, 0x1a, 0x41, 0xf2,
......
...@@ -3,20 +3,19 @@ package client ...@@ -3,20 +3,19 @@ package client
import ( import (
"io" "io"
"gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
"gitlab.com/gitlab-org/gitaly/streamio" "gitlab.com/gitlab-org/gitaly/streamio"
pb "gitlab.com/gitlab-org/gitaly-proto/go"
"golang.org/x/net/context" "golang.org/x/net/context"
"google.golang.org/grpc" "google.golang.org/grpc"
) )
// ReceivePack proxies an SSH git-receive-pack (git push) session to Gitaly // ReceivePack proxies an SSH git-receive-pack (git push) session to Gitaly
func ReceivePack(ctx context.Context, conn *grpc.ClientConn, stdin io.Reader, stdout, stderr io.Writer, req *pb.SSHReceivePackRequest) (int32, error) { func ReceivePack(ctx context.Context, conn *grpc.ClientConn, stdin io.Reader, stdout, stderr io.Writer, req *gitalypb.SSHReceivePackRequest) (int32, error) {
ctx2, cancel := context.WithCancel(ctx) ctx2, cancel := context.WithCancel(ctx)
defer cancel() defer cancel()
ssh := pb.NewSSHServiceClient(conn) ssh := gitalypb.NewSSHServiceClient(conn)
stream, err := ssh.SSHReceivePack(ctx2) stream, err := ssh.SSHReceivePack(ctx2)
if err != nil { if err != nil {
return 0, err return 0, err
...@@ -27,7 +26,7 @@ func ReceivePack(ctx context.Context, conn *grpc.ClientConn, stdin io.Reader, st ...@@ -27,7 +26,7 @@ func ReceivePack(ctx context.Context, conn *grpc.ClientConn, stdin io.Reader, st
} }
inWriter := streamio.NewWriter(func(p []byte) error { inWriter := streamio.NewWriter(func(p []byte) error {
return stream.Send(&pb.SSHReceivePackRequest{Stdin: p}) return stream.Send(&gitalypb.SSHReceivePackRequest{Stdin: p})
}) })
return streamHandler(func() (stdoutStderrResponse, error) { return streamHandler(func() (stdoutStderrResponse, error) {
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment