diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c44ef13501ff276cceeb24a22a4f6c56d585f50..e1f8a49b146103d6ec163251aca7b2a7d1ba6052 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ UNRELEASED - CommitDiff: Parse a typechange diff correctly https://gitlab.com/gitlab-org/gitaly/merge_requests/136 +- CommitDiff: Implement CommitDelta RPC + https://gitlab.com/gitlab-org/gitaly/merge_requests/139 v0.9.0 diff --git a/internal/service/diff/commit.go b/internal/service/diff/commit.go index 351f7e2f262f5bfa27178c650077725717e739b7..99986519d56a9d798a78425b5c2d5130e75e7e4b 100644 --- a/internal/service/diff/commit.go +++ b/internal/service/diff/commit.go @@ -1,6 +1,7 @@ package diff import ( + "fmt" "log" pb "gitlab.com/gitlab-org/gitaly-proto/go" @@ -11,9 +12,14 @@ import ( "google.golang.org/grpc/codes" ) +type requestWithLeftRightCommitIds interface { + GetLeftCommitId() string + GetRightCommitId() string +} + func (s *server) CommitDiff(in *pb.CommitDiffRequest, stream pb.Diff_CommitDiffServer) error { if err := validateRequest(in); err != nil { - return err + return grpc.Errorf(codes.InvalidArgument, "CommitDiff: %v", err) } repoPath, err := helper.GetRepoPath(in.Repository) @@ -54,17 +60,8 @@ func (s *server) CommitDiff(in *pb.CommitDiffRequest, stream pb.Diff_CommitDiffS } } - cmd, err := helper.GitCommandReader(cmdArgs...) - if err != nil { - return grpc.Errorf(codes.Internal, "CommitDiff: cmd: %v", err) - } - defer cmd.Kill() - - diffParser := diff.NewDiffParser(cmd) - - for diffParser.Parse() { - diff := diffParser.Diff() - err = stream.Send(&pb.CommitDiffResponse{ + err = eachDiff("CommitDiff", cmdArgs, func(diff *diff.Diff) error { + err := stream.Send(&pb.CommitDiffResponse{ FromPath: diff.FromPath, ToPath: diff.ToPath, FromId: diff.FromID, @@ -78,27 +75,140 @@ func (s *server) CommitDiff(in *pb.CommitDiffRequest, stream pb.Diff_CommitDiffS if err != nil { return grpc.Errorf(codes.Unavailable, "CommitDiff: send: %v", err) } + + return nil + }) + + return err +} + +func (s *server) CommitDelta(in *pb.CommitDeltaRequest, stream pb.Diff_CommitDeltaServer) error { + if err := validateRequest(in); err != nil { + return grpc.Errorf(codes.InvalidArgument, "CommitDelta: %v", err) } - if err := diffParser.Err(); err != nil { - log.Printf("CommitDiff: Parsing diff in repo %q between %q and %q failed: %v", repoPath, leftSha, rightSha, err) - return grpc.Errorf(codes.Internal, "CommitDiff: parse failure: %v", err) + repoPath, err := helper.GetRepoPath(in.Repository) + if err != nil { + return err } + leftSha := in.LeftCommitId + rightSha := in.RightCommitId + paths := in.GetPaths() - if err := cmd.Wait(); err != nil { - return grpc.Errorf(codes.Unavailable, "CommitDiff: cmd wait for %v: %v", cmd.Args, err) + log.Printf( + "CommitDelta: RepoPath=%q LeftCommitId=%q RightCommitId=%q Paths=%s", + repoPath, + leftSha, + rightSha, + paths, + ) + + cmdArgs := []string{ + "--git-dir", repoPath, + "diff", + "--raw", + "--abbrev=40", + "--full-index", + "--find-renames", + leftSha, + rightSha, + } + if len(paths) > 0 { + cmdArgs = append(cmdArgs, "--") + for _, path := range paths { + cmdArgs = append(cmdArgs, string(path)) + } + } + + var batch []*pb.CommitDelta + var batchSize int + + flushFunc := func() error { + if len(batch) == 0 { + return nil + } + + if err := stream.Send(&pb.CommitDeltaResponse{Deltas: batch}); err != nil { + return grpc.Errorf(codes.Unavailable, "CommitDelta: send: %v", err) + } + + return nil + } + + err = eachDiff("CommitDelta", cmdArgs, func(diff *diff.Diff) error { + delta := &pb.CommitDelta{ + FromPath: diff.FromPath, + ToPath: diff.ToPath, + FromId: diff.FromID, + ToId: diff.ToID, + OldMode: diff.OldMode, + NewMode: diff.NewMode, + } + + batch = append(batch, delta) + batchSize += deltaSize(diff) + + if batchSize > s.MsgSizeThreshold { + if err := flushFunc(); err != nil { + return err + } + + batch = nil + batchSize = 0 + } + + return nil + }) + + if err != nil { + return err + } + + return flushFunc() +} + +func validateRequest(in requestWithLeftRightCommitIds) error { + if in.GetLeftCommitId() == "" { + return fmt.Errorf("empty LeftCommitId") + } + if in.GetRightCommitId() == "" { + return fmt.Errorf("empty RightCommitId") } return nil } -func validateRequest(in *pb.CommitDiffRequest) error { - if in.LeftCommitId == "" { - return grpc.Errorf(codes.InvalidArgument, "CommitDiff: empty LeftCommitId") +func eachDiff(rpc string, cmdArgs []string, callback func(*diff.Diff) error) error { + cmd, err := helper.GitCommandReader(cmdArgs...) + if err != nil { + return grpc.Errorf(codes.Internal, "%s: cmd: %v", rpc, err) } - if in.RightCommitId == "" { - return grpc.Errorf(codes.InvalidArgument, "CommitDiff: empty RightCommitId") + defer cmd.Kill() + + diffParser := diff.NewDiffParser(cmd) + + for diffParser.Parse() { + if err := callback(diffParser.Diff()); err != nil { + return err + } + } + + if err := diffParser.Err(); err != nil { + log.Printf("%s: Failed parsing diff for args %s: %v", rpc, cmd.Args) + return grpc.Errorf(codes.Internal, "%s: parse failure: %v", rpc, err) + } + + if err := cmd.Wait(); err != nil { + return grpc.Errorf(codes.Unavailable, "%s: cmd wait for %v: %v", rpc, cmd.Args, err) } return nil } + +func deltaSize(diff *diff.Diff) int { + size := len(diff.FromID) + len(diff.ToID) + + 4 + 4 + // OldMode and NewMode are int32 = 32/8 = 4 bytes + len(diff.FromPath) + len(diff.ToPath) + + return size +} diff --git a/internal/service/diff/commit_test.go b/internal/service/diff/commit_test.go index bc1c3692289fb653eec82d381a0dc19e919bf895..24f573e5f4350d11db8c14568cc0a73e446ab0a8 100644 --- a/internal/service/diff/commit_test.go +++ b/internal/service/diff/commit_test.go @@ -475,6 +475,233 @@ func TestFailedCommitDiffRequestWithNonExistentCommit(t *testing.T) { testhelper.AssertGrpcError(t, err, codes.Unavailable, "") } +func TestSuccessfulCommitDeltaRequest(t *testing.T) { + server := runDiffServer(t) + defer server.Stop() + + client := newDiffClient(t) + repo := &pb.Repository{Path: testRepoPath} + rightCommit := "742518b2be68fc750bb4c357c0df821a88113286" + leftCommit := "8a0f2ee90d940bfb0ba1e14e8214b0649056e4ab" + rpcRequest := &pb.CommitDeltaRequest{Repository: repo, RightCommitId: rightCommit, LeftCommitId: leftCommit} + + c, err := client.CommitDelta(context.Background(), rpcRequest) + if err != nil { + t.Fatal(err) + } + + expectedDeltas := []diff.Diff{ + { + FromID: "faaf198af3a36dbf41961466703cc1d47c61d051", + ToID: "877cee6ab11f9094e1bcdb7f1fd9c0001b572185", + OldMode: 0100644, + NewMode: 0100644, + FromPath: []byte("README.md"), + ToPath: []byte("README.md"), + }, + { + FromID: "bdea48ee65c869eb0b86b1283069d76cce0a7254", + ToID: "0000000000000000000000000000000000000000", + OldMode: 0100644, + NewMode: 0, + FromPath: []byte("gitaly/deleted-file"), + ToPath: []byte("gitaly/deleted-file"), + }, + { + FromID: "aa408b4556e594f7974390ad6b86210617fbda6e", + ToID: "1c69c4d2a65ad05c24ac3b6780b5748b97ffd3aa", + OldMode: 0100644, + NewMode: 0100644, + FromPath: []byte("gitaly/file-with-multiple-chunks"), + ToPath: []byte("gitaly/file-with-multiple-chunks"), + }, + { + FromID: "0000000000000000000000000000000000000000", + ToID: "bc2ef601a538d69ef99d5bdafa605e63f902e8e4", + OldMode: 0, + NewMode: 0100644, + FromPath: []byte("gitaly/logo-white.png"), + ToPath: []byte("gitaly/logo-white.png"), + }, + { + FromID: "ead5a0eee1391308803cfebd8a2a8530495645eb", + ToID: "ead5a0eee1391308803cfebd8a2a8530495645eb", + OldMode: 0100644, + NewMode: 0100755, + FromPath: []byte("gitaly/mode-file"), + ToPath: []byte("gitaly/mode-file"), + }, + { + FromID: "357406f3075a57708d0163752905cc1576fceacc", + ToID: "8e5177d718c561d36efde08bad36b43687ee6bf0", + OldMode: 0100644, + NewMode: 0100755, + FromPath: []byte("gitaly/mode-file-with-mods"), + ToPath: []byte("gitaly/mode-file-with-mods"), + }, + { + FromID: "43d24af4e22580f36b1ca52647c1aff75a766a33", + ToID: "0000000000000000000000000000000000000000", + OldMode: 0100644, + NewMode: 0, + FromPath: []byte("gitaly/named-file-with-mods"), + ToPath: []byte("gitaly/named-file-with-mods"), + }, + { + FromID: "0000000000000000000000000000000000000000", + ToID: "b464dff7a75ccc92fbd920fd9ae66a84b9d2bf94", + OldMode: 0, + NewMode: 0100644, + FromPath: []byte("gitaly/no-newline-at-the-end"), + ToPath: []byte("gitaly/no-newline-at-the-end"), + }, + { + FromID: "4e76e90b3c7e52390de9311a23c0a77575aed8a8", + ToID: "4e76e90b3c7e52390de9311a23c0a77575aed8a8", + OldMode: 0100644, + NewMode: 0100644, + FromPath: []byte("gitaly/named-file"), + ToPath: []byte("gitaly/renamed-file"), + }, + { + FromID: "0000000000000000000000000000000000000000", + ToID: "3856c00e9450a51a62096327167fc43d3be62eef", + OldMode: 0, + NewMode: 0100644, + FromPath: []byte("gitaly/renamed-file-with-mods"), + ToPath: []byte("gitaly/renamed-file-with-mods"), + }, + { + FromID: "0000000000000000000000000000000000000000", + ToID: "a135e3e0d4af177a902ca57dcc4c7fc6f30858b1", + OldMode: 0, + NewMode: 0100644, + FromPath: []byte("gitaly/tab\tnewline\n file"), + ToPath: []byte("gitaly/tab\tnewline\n file"), + }, + { + FromID: "0000000000000000000000000000000000000000", + ToID: "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", + OldMode: 0, + NewMode: 0100755, + FromPath: []byte("gitaly/テスト.txt"), + ToPath: []byte("gitaly/テスト.txt"), + }, + } + + assertExactReceivedDeltas(t, c, expectedDeltas) +} + +func TestSuccessfulCommitDeltaRequestWithPaths(t *testing.T) { + server := runDiffServer(t) + defer server.Stop() + + client := newDiffClient(t) + repo := &pb.Repository{Path: testRepoPath} + rightCommit := "e4003da16c1c2c3fc4567700121b17bf8e591c6c" + leftCommit := "8a0f2ee90d940bfb0ba1e14e8214b0649056e4ab" + rpcRequest := &pb.CommitDeltaRequest{ + Repository: repo, + RightCommitId: rightCommit, + LeftCommitId: leftCommit, + Paths: [][]byte{ + []byte("CONTRIBUTING.md"), + []byte("README.md"), + []byte("gitaly/named-file-with-mods"), + []byte("gitaly/mode-file-with-mods"), + }, + } + + c, err := client.CommitDelta(context.Background(), rpcRequest) + if err != nil { + t.Fatal(err) + } + + expectedDeltas := []diff.Diff{ + { + FromID: "c1788657b95998a2f177a4f86d68a60f2a80117f", + ToID: "b87f61fe2d7b2e208b340a1f3cafea916bd27f75", + OldMode: 0100644, + NewMode: 0100644, + FromPath: []byte("CONTRIBUTING.md"), + ToPath: []byte("CONTRIBUTING.md"), + }, + { + FromID: "faaf198af3a36dbf41961466703cc1d47c61d051", + ToID: "877cee6ab11f9094e1bcdb7f1fd9c0001b572185", + OldMode: 0100644, + NewMode: 0100644, + FromPath: []byte("README.md"), + ToPath: []byte("README.md"), + }, + { + FromID: "357406f3075a57708d0163752905cc1576fceacc", + ToID: "8e5177d718c561d36efde08bad36b43687ee6bf0", + OldMode: 0100644, + NewMode: 0100755, + FromPath: []byte("gitaly/mode-file-with-mods"), + ToPath: []byte("gitaly/mode-file-with-mods"), + }, + { + FromID: "43d24af4e22580f36b1ca52647c1aff75a766a33", + ToID: "0000000000000000000000000000000000000000", + OldMode: 0100644, + NewMode: 0, + FromPath: []byte("gitaly/named-file-with-mods"), + ToPath: []byte("gitaly/named-file-with-mods"), + }, + } + + assertExactReceivedDeltas(t, c, expectedDeltas) +} + +func TestFailedCommitDeltaRequestDueToValidationError(t *testing.T) { + server := runDiffServer(t) + defer server.Stop() + + client := newDiffClient(t) + rightCommit := "d42783470dc29fde2cf459eb3199ee1d7e3f3a72" + leftCommit := rightCommit + "~" // Parent of rightCommit + + rpcRequests := []pb.CommitDeltaRequest{ + {Repository: &pb.Repository{Path: ""}, RightCommitId: rightCommit, LeftCommitId: leftCommit}, // Repository.Path is empty + {Repository: nil, RightCommitId: rightCommit, LeftCommitId: leftCommit}, // Repository is nil + {Repository: &pb.Repository{Path: testRepoPath}, RightCommitId: "", LeftCommitId: leftCommit}, // RightCommitId is empty + {Repository: &pb.Repository{Path: testRepoPath}, RightCommitId: rightCommit, LeftCommitId: ""}, // LeftCommitId is empty + } + + for _, rpcRequest := range rpcRequests { + t.Logf("test case: %v", rpcRequest) + + c, err := client.CommitDelta(context.Background(), &rpcRequest) + if err != nil { + t.Fatal(err) + } + + err = drainCommitDeltaResponse(c) + testhelper.AssertGrpcError(t, err, codes.InvalidArgument, "") + } +} + +func TestFailedCommitDeltaRequestWithNonExistentCommit(t *testing.T) { + server := runDiffServer(t) + defer server.Stop() + + client := newDiffClient(t) + repo := &pb.Repository{Path: testRepoPath} + nonExistentCommitID := "deadfacedeadfacedeadfacedeadfacedeadface" + leftCommit := nonExistentCommitID + "~" // Parent of rightCommit + rpcRequest := &pb.CommitDeltaRequest{Repository: repo, RightCommitId: nonExistentCommitID, LeftCommitId: leftCommit} + + c, err := client.CommitDelta(context.Background(), rpcRequest) + if err != nil { + t.Fatal(err) + } + + err = drainCommitDeltaResponse(c) + testhelper.AssertGrpcError(t, err, codes.Unavailable, "") +} + func runDiffServer(t *testing.T) *grpc.Server { server := grpc.NewServer() listener, err := net.Listen("unix", serverSocketPath) @@ -516,6 +743,17 @@ func drainCommitDiffResponse(c pb.Diff_CommitDiffClient) error { return nil } +func drainCommitDeltaResponse(c pb.Diff_CommitDeltaClient) error { + for { + _, err := c.Recv() + if err != nil { + return err + } + } + + return nil +} + func assertExactReceivedDiffs(t *testing.T, client pb.Diff_CommitDiffClient, expectedDiffs []expectedDiff) { i := 0 for { @@ -550,11 +788,11 @@ func assertExactReceivedDiffs(t *testing.T, client pb.Diff_CommitDiffClient, exp } if !bytes.Equal(expectedDiff.FromPath, fetchedDiff.FromPath) { - t.Errorf("Expected diff #%d FromPath to equal = %s, got %s", i, expectedDiff.FromPath, fetchedDiff.FromPath) + t.Errorf("Expected diff #%d FromPath to equal = %q, got %q", i, expectedDiff.FromPath, fetchedDiff.FromPath) } if !bytes.Equal(expectedDiff.ToPath, fetchedDiff.ToPath) { - t.Errorf("Expected diff #%d ToPath to equal = %s, got %s", i, expectedDiff.ToPath, fetchedDiff.ToPath) + t.Errorf("Expected diff #%d ToPath to equal = %q, got %q", i, expectedDiff.ToPath, fetchedDiff.ToPath) } if expectedDiff.Binary != fetchedDiff.Binary { @@ -573,3 +811,54 @@ func assertExactReceivedDiffs(t *testing.T, client pb.Diff_CommitDiffClient, exp t.Errorf("Expected number of diffs to be %d, got %d", len(expectedDiffs), i) } } + +func assertExactReceivedDeltas(t *testing.T, client pb.Diff_CommitDeltaClient, expectedDeltas []diff.Diff) { + i := 0 + for { + fetchedDeltas, err := client.Recv() + if err == io.EOF { + break + } else if err != nil { + t.Fatal(err) + } + + for _, fetchedDelta := range fetchedDeltas.GetDeltas() { + if i >= len(expectedDeltas) { + t.Errorf("Unexpected delta #%d received: %v", i, fetchedDelta) + break + } + + expectedDelta := expectedDeltas[i] + + if expectedDelta.FromID != fetchedDelta.FromId { + t.Errorf("Expected delta #%d FromID to equal = %q, got %q", i, expectedDelta.FromID, fetchedDelta.FromId) + } + + if expectedDelta.ToID != fetchedDelta.ToId { + t.Errorf("Expected delta #%d ToID to equal = %q, got %q", i, expectedDelta.ToID, fetchedDelta.ToId) + } + + if expectedDelta.OldMode != fetchedDelta.OldMode { + t.Errorf("Expected delta #%d OldMode to equal = %o, got %o", i, expectedDelta.OldMode, fetchedDelta.OldMode) + } + + if expectedDelta.NewMode != fetchedDelta.NewMode { + t.Errorf("Expected delta #%d NewMode to equal = %o, got %o", i, expectedDelta.NewMode, fetchedDelta.NewMode) + } + + if !bytes.Equal(expectedDelta.FromPath, fetchedDelta.FromPath) { + t.Errorf("Expected delta #%d FromPath to equal = %q, got %q", i, expectedDelta.FromPath, fetchedDelta.FromPath) + } + + if !bytes.Equal(expectedDelta.ToPath, fetchedDelta.ToPath) { + t.Errorf("Expected delta #%d ToPath to equal = %q, got %q", i, expectedDelta.ToPath, fetchedDelta.ToPath) + } + + i++ + } + } + + if len(expectedDeltas) != i { + t.Errorf("Expected number of deltas to be %d, got %d", len(expectedDeltas), i) + } +} diff --git a/internal/service/diff/server.go b/internal/service/diff/server.go index 945c66a1f4d6196f7d64d3a0ba46a9ace232d962..e75cbd3865f45641bbdc7e75d18f4f0841c9ea40 100644 --- a/internal/service/diff/server.go +++ b/internal/service/diff/server.go @@ -4,9 +4,13 @@ import ( pb "gitlab.com/gitlab-org/gitaly-proto/go" ) -type server struct{} +const msgSizeThreshold = 1024 + +type server struct { + MsgSizeThreshold int +} // NewServer creates a new instance of a gRPC DiffServer func NewServer() pb.DiffServer { - return &server{} + return &server{MsgSizeThreshold: msgSizeThreshold} } diff --git a/vendor/gitlab.com/gitlab-org/gitaly-proto/go/VERSION b/vendor/gitlab.com/gitlab-org/gitaly-proto/go/VERSION index a918a2aa18d5bec6a8bb93891a7a63c243111796..faef31a4357c48d6e4c55e84c8be8e3bc9055e20 100644 --- a/vendor/gitlab.com/gitlab-org/gitaly-proto/go/VERSION +++ b/vendor/gitlab.com/gitlab-org/gitaly-proto/go/VERSION @@ -1 +1 @@ -0.6.0 +0.7.0 diff --git a/vendor/gitlab.com/gitlab-org/gitaly-proto/go/commit.pb.go b/vendor/gitlab.com/gitlab-org/gitaly-proto/go/commit.pb.go index 9d984bee4ab25be6bc02738c21e45c3be8ff4d9d..756c122cfa65f1bede126071ad864bc3d8063adf 100644 --- a/vendor/gitlab.com/gitlab-org/gitaly-proto/go/commit.pb.go +++ b/vendor/gitlab.com/gitlab-org/gitaly-proto/go/commit.pb.go @@ -19,6 +19,9 @@ It has these top-level messages: CommitIsAncestorResponse CommitDiffRequest CommitDiffResponse + CommitDeltaRequest + CommitDelta + CommitDeltaResponse PostReceiveRequest PostReceiveResponse FindDefaultBranchNameRequest diff --git a/vendor/gitlab.com/gitlab-org/gitaly-proto/go/diff.pb.go b/vendor/gitlab.com/gitlab-org/gitaly-proto/go/diff.pb.go index 9e1f0bcd2b3db42ff77e6d1dbd1b2e72b74c9b30..30a7292858e9d4047c6c5d4a34c10a8a098c8b4b 100644 --- a/vendor/gitlab.com/gitlab-org/gitaly-proto/go/diff.pb.go +++ b/vendor/gitlab.com/gitlab-org/gitaly-proto/go/diff.pb.go @@ -140,9 +140,125 @@ func (m *CommitDiffResponse) GetRawChunks() [][]byte { return nil } +type CommitDeltaRequest struct { + Repository *Repository `protobuf:"bytes,1,opt,name=repository" json:"repository,omitempty"` + LeftCommitId string `protobuf:"bytes,2,opt,name=left_commit_id,json=leftCommitId" json:"left_commit_id,omitempty"` + RightCommitId string `protobuf:"bytes,3,opt,name=right_commit_id,json=rightCommitId" json:"right_commit_id,omitempty"` + Paths [][]byte `protobuf:"bytes,4,rep,name=paths,proto3" json:"paths,omitempty"` +} + +func (m *CommitDeltaRequest) Reset() { *m = CommitDeltaRequest{} } +func (m *CommitDeltaRequest) String() string { return proto.CompactTextString(m) } +func (*CommitDeltaRequest) ProtoMessage() {} +func (*CommitDeltaRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} } + +func (m *CommitDeltaRequest) GetRepository() *Repository { + if m != nil { + return m.Repository + } + return nil +} + +func (m *CommitDeltaRequest) GetLeftCommitId() string { + if m != nil { + return m.LeftCommitId + } + return "" +} + +func (m *CommitDeltaRequest) GetRightCommitId() string { + if m != nil { + return m.RightCommitId + } + return "" +} + +func (m *CommitDeltaRequest) GetPaths() [][]byte { + if m != nil { + return m.Paths + } + return nil +} + +type CommitDelta struct { + FromPath []byte `protobuf:"bytes,1,opt,name=from_path,json=fromPath,proto3" json:"from_path,omitempty"` + ToPath []byte `protobuf:"bytes,2,opt,name=to_path,json=toPath,proto3" json:"to_path,omitempty"` + // Blob ID as returned via `git diff --full-index` + FromId string `protobuf:"bytes,3,opt,name=from_id,json=fromId" json:"from_id,omitempty"` + ToId string `protobuf:"bytes,4,opt,name=to_id,json=toId" json:"to_id,omitempty"` + OldMode int32 `protobuf:"varint,5,opt,name=old_mode,json=oldMode" json:"old_mode,omitempty"` + NewMode int32 `protobuf:"varint,6,opt,name=new_mode,json=newMode" json:"new_mode,omitempty"` +} + +func (m *CommitDelta) Reset() { *m = CommitDelta{} } +func (m *CommitDelta) String() string { return proto.CompactTextString(m) } +func (*CommitDelta) ProtoMessage() {} +func (*CommitDelta) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3} } + +func (m *CommitDelta) GetFromPath() []byte { + if m != nil { + return m.FromPath + } + return nil +} + +func (m *CommitDelta) GetToPath() []byte { + if m != nil { + return m.ToPath + } + return nil +} + +func (m *CommitDelta) GetFromId() string { + if m != nil { + return m.FromId + } + return "" +} + +func (m *CommitDelta) GetToId() string { + if m != nil { + return m.ToId + } + return "" +} + +func (m *CommitDelta) GetOldMode() int32 { + if m != nil { + return m.OldMode + } + return 0 +} + +func (m *CommitDelta) GetNewMode() int32 { + if m != nil { + return m.NewMode + } + return 0 +} + +type CommitDeltaResponse struct { + Deltas []*CommitDelta `protobuf:"bytes,1,rep,name=deltas" json:"deltas,omitempty"` +} + +func (m *CommitDeltaResponse) Reset() { *m = CommitDeltaResponse{} } +func (m *CommitDeltaResponse) String() string { return proto.CompactTextString(m) } +func (*CommitDeltaResponse) ProtoMessage() {} +func (*CommitDeltaResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{4} } + +func (m *CommitDeltaResponse) GetDeltas() []*CommitDelta { + if m != nil { + return m.Deltas + } + return nil +} + func init() { proto.RegisterType((*CommitDiffRequest)(nil), "gitaly.CommitDiffRequest") proto.RegisterType((*CommitDiffResponse)(nil), "gitaly.CommitDiffResponse") + proto.RegisterType((*CommitDeltaRequest)(nil), "gitaly.CommitDeltaRequest") + proto.RegisterType((*CommitDelta)(nil), "gitaly.CommitDelta") + proto.RegisterType((*CommitDeltaResponse)(nil), "gitaly.CommitDeltaResponse") } // Reference imports to suppress errors if they are not otherwise used. @@ -158,6 +274,8 @@ const _ = grpc.SupportPackageIsVersion4 type DiffClient interface { // Returns stream of CommitDiffResponse: 1 per changed file CommitDiff(ctx context.Context, in *CommitDiffRequest, opts ...grpc.CallOption) (Diff_CommitDiffClient, error) + // Return a stream so we can divide the response in chunks of deltas + CommitDelta(ctx context.Context, in *CommitDeltaRequest, opts ...grpc.CallOption) (Diff_CommitDeltaClient, error) } type diffClient struct { @@ -200,11 +318,45 @@ func (x *diffCommitDiffClient) Recv() (*CommitDiffResponse, error) { return m, nil } +func (c *diffClient) CommitDelta(ctx context.Context, in *CommitDeltaRequest, opts ...grpc.CallOption) (Diff_CommitDeltaClient, error) { + stream, err := grpc.NewClientStream(ctx, &_Diff_serviceDesc.Streams[1], c.cc, "/gitaly.Diff/CommitDelta", opts...) + if err != nil { + return nil, err + } + x := &diffCommitDeltaClient{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 Diff_CommitDeltaClient interface { + Recv() (*CommitDeltaResponse, error) + grpc.ClientStream +} + +type diffCommitDeltaClient struct { + grpc.ClientStream +} + +func (x *diffCommitDeltaClient) Recv() (*CommitDeltaResponse, error) { + m := new(CommitDeltaResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + // Server API for Diff service type DiffServer interface { // Returns stream of CommitDiffResponse: 1 per changed file CommitDiff(*CommitDiffRequest, Diff_CommitDiffServer) error + // Return a stream so we can divide the response in chunks of deltas + CommitDelta(*CommitDeltaRequest, Diff_CommitDeltaServer) error } func RegisterDiffServer(s *grpc.Server, srv DiffServer) { @@ -232,6 +384,27 @@ func (x *diffCommitDiffServer) Send(m *CommitDiffResponse) error { return x.ServerStream.SendMsg(m) } +func _Diff_CommitDelta_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(CommitDeltaRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(DiffServer).CommitDelta(m, &diffCommitDeltaServer{stream}) +} + +type Diff_CommitDeltaServer interface { + Send(*CommitDeltaResponse) error + grpc.ServerStream +} + +type diffCommitDeltaServer struct { + grpc.ServerStream +} + +func (x *diffCommitDeltaServer) Send(m *CommitDeltaResponse) error { + return x.ServerStream.SendMsg(m) +} + var _Diff_serviceDesc = grpc.ServiceDesc{ ServiceName: "gitaly.Diff", HandlerType: (*DiffServer)(nil), @@ -242,6 +415,11 @@ var _Diff_serviceDesc = grpc.ServiceDesc{ Handler: _Diff_CommitDiff_Handler, ServerStreams: true, }, + { + StreamName: "CommitDelta", + Handler: _Diff_CommitDelta_Handler, + ServerStreams: true, + }, }, Metadata: "diff.proto", } @@ -249,29 +427,33 @@ var _Diff_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("diff.proto", fileDescriptor1) } var fileDescriptor1 = []byte{ - // 369 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xc1, 0xae, 0x94, 0x30, - 0x14, 0x86, 0xe5, 0x5e, 0x60, 0x98, 0x23, 0x6a, 0xac, 0xe6, 0xda, 0x3b, 0xc6, 0x84, 0xdc, 0x18, - 0xc3, 0x6a, 0x62, 0xc6, 0x8d, 0xfb, 0x31, 0x31, 0xb3, 0x30, 0x9a, 0x6e, 0x5c, 0x92, 0x0e, 0x2d, - 0xd0, 0x08, 0x1c, 0x6c, 0x3b, 0x21, 0xf3, 0xc0, 0xbe, 0x87, 0x69, 0xeb, 0xe0, 0x24, 0xba, 0x3c, - 0xff, 0xf7, 0x53, 0xf8, 0x38, 0x05, 0x10, 0xaa, 0x69, 0xb6, 0x93, 0x46, 0x8b, 0x24, 0x6d, 0x95, - 0xe5, 0xfd, 0x79, 0x93, 0x9b, 0x8e, 0x6b, 0x29, 0x42, 0xfa, 0xf0, 0x2b, 0x82, 0xe7, 0x7b, 0x1c, - 0x06, 0x65, 0x3f, 0xa9, 0xa6, 0x61, 0xf2, 0xe7, 0x49, 0x1a, 0x4b, 0x76, 0x00, 0x5a, 0x4e, 0x68, - 0x94, 0x45, 0x7d, 0xa6, 0x51, 0x11, 0x95, 0x8f, 0x77, 0x64, 0x1b, 0x0e, 0xd8, 0xb2, 0x85, 0xb0, - 0xab, 0x16, 0x79, 0x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8, 0xc3, 0xd0, 0xcc, 0x3b, 0xae, 0x35, - 0x9f, 0xf7, 0x3e, 0xd8, 0x7d, 0x85, 0xd8, 0x09, 0x92, 0xcf, 0x00, 0x7f, 0x75, 0xc9, 0xfd, 0x65, - 0x77, 0xff, 0xac, 0x7a, 0xb3, 0xf9, 0x1f, 0x0a, 0x7f, 0xe7, 0xe1, 0xd1, 0xfb, 0xe8, 0x98, 0xfa, - 0x7b, 0xf2, 0xe1, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x22, 0x00, 0x91, 0x7d, 0x4b, 0x02, 0x00, - 0x00, + // 446 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x94, 0xd1, 0x8a, 0x13, 0x31, + 0x14, 0x86, 0xcd, 0x76, 0x66, 0xda, 0x9e, 0x56, 0xc5, 0x54, 0xd6, 0x6c, 0x17, 0x61, 0x28, 0x22, + 0x03, 0x42, 0x91, 0x7a, 0xe3, 0xb5, 0x15, 0xa4, 0x82, 0x20, 0xb9, 0xf1, 0x72, 0xc8, 0x36, 0x99, + 0x4e, 0x70, 0x3a, 0x19, 0x93, 0x2c, 0x43, 0x9f, 0xc5, 0x07, 0xf0, 0xc6, 0xd7, 0xf2, 0x3d, 0x24, + 0x49, 0x77, 0x3a, 0xbb, 0xf4, 0x01, 0xf6, 0x32, 0xff, 0xf7, 0xe7, 0x24, 0x7f, 0xce, 0x99, 0x01, + 0xe0, 0xb2, 0x28, 0x96, 0x8d, 0x56, 0x56, 0xe1, 0x64, 0x27, 0x2d, 0xab, 0x0e, 0xf3, 0xa9, 0x29, + 0x99, 0x16, 0x3c, 0xa8, 0x8b, 0x7f, 0x08, 0x5e, 0xac, 0xd5, 0x7e, 0x2f, 0xed, 0x67, 0x59, 0x14, + 0x54, 0xfc, 0xba, 0x15, 0xc6, 0xe2, 0x15, 0x80, 0x16, 0x8d, 0x32, 0xd2, 0x2a,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 0xe8, 0x12, 0x92, 0x1b, 0x59, 0x33, 0x7d, 0x20, 0x43, 0x1f, 0xf7, 0xb8, 0xc2, 0xaf, 0x01, + 0x34, 0x6b, 0xf3, 0x6d, 0x79, 0x5b, 0xff, 0x34, 0x64, 0xe4, 0x33, 0x8e, 0x35, 0x6b, 0xd7, 0x5e, + 0x58, 0xfc, 0x3d, 0xe5, 0x14, 0x95, 0x65, 0x8f, 0xa7, 0xa1, 0x5d, 0x5b, 0xa2, 0x7e, 0x5b, 0xfe, + 0x20, 0x98, 0xf4, 0xae, 0xfb, 0x78, 0xfb, 0xb1, 0xf8, 0x04, 0xb3, 0x7b, 0xef, 0x7a, 0x1c, 0xa0, + 0x77, 0x90, 0x70, 0x27, 0x18, 0x82, 0xd2, 0x41, 0x36, 0x59, 0xcd, 0xee, 0x1e, 0xb5, 0x6f, 0x3e, + 0x5a, 0x56, 0xbf, 0x11, 0x44, 0x6e, 0xfc, 0xf0, 0x17, 0x80, 0xd3, 0x30, 0xe2, 0xab, 0x07, 0x7b, + 0x4e, 0x1f, 0xe2, 0x7c, 0x7e, 0x0e, 0x85, 0xa3, 0x17, 0x4f, 0xde, 0x23, 0xfc, 0xf5, 0xfe, 0xf3, + 0xcd, 0xcf, 0x9d, 0x7e, 0x2c, 0x75, 0x7d, 0x96, 0x9d, 0x6a, 0xdd, 0x24, 0xfe, 0x8f, 0xf0, 0xe1, + 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa2, 0xc7, 0x4a, 0x51, 0x35, 0x04, 0x00, 0x00, } diff --git a/vendor/gitlab.com/gitlab-org/gitaly-proto/go/smarthttp.pb.go b/vendor/gitlab.com/gitlab-org/gitaly-proto/go/smarthttp.pb.go index 494118d6a05a9220d74326eb839d46c42aefd37c..07fec06538dcbed4c3a91354edde3f8374ef559f 100644 --- a/vendor/gitlab.com/gitlab-org/gitaly-proto/go/smarthttp.pb.go +++ b/vendor/gitlab.com/gitlab-org/gitaly-proto/go/smarthttp.pb.go @@ -98,9 +98,10 @@ type PostReceivePackRequest struct { Repository *Repository `protobuf:"bytes,1,opt,name=repository" json:"repository,omitempty"` // Raw data to be copied to stdin of 'git receive-pack' Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - // gl_id becomes env variable GL_ID, used by the Git {pre,post}-receive - // hooks. Should only be present in the first message of the stream. - GlId string `protobuf:"bytes,3,opt,name=gl_id,json=glId" json:"gl_id,omitempty"` + // gl_id and gl_repository becomes env variables, used by the Git {pre,post}-receive + // hooks. They should only be present in the first message of the stream. + GlId string `protobuf:"bytes,3,opt,name=gl_id,json=glId" json:"gl_id,omitempty"` + GlRepository string `protobuf:"bytes,4,opt,name=gl_repository,json=glRepository" json:"gl_repository,omitempty"` } func (m *PostReceivePackRequest) Reset() { *m = PostReceivePackRequest{} } @@ -129,6 +130,13 @@ func (m *PostReceivePackRequest) GetGlId() string { return "" } +func (m *PostReceivePackRequest) GetGlRepository() string { + if m != nil { + return m.GlRepository + } + return "" +} + type PostReceivePackResponse struct { // Raw data from stdout of 'git receive-pack' Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` @@ -455,24 +463,26 @@ var _SmartHTTP_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("smarthttp.proto", fileDescriptor5) } var fileDescriptor5 = []byte{ - // 304 bytes of a gzipped FileDescriptorProto + // 321 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x53, 0x4d, 0x4b, 0xc3, 0x40, - 0x14, 0x74, 0x6b, 0x2d, 0xf4, 0x59, 0xac, 0xbc, 0xa2, 0x0d, 0x01, 0xb5, 0xe4, 0x20, 0x39, 0x68, - 0x28, 0xf1, 0x37, 0x08, 0x16, 0x3d, 0x84, 0xb5, 0x05, 0x6f, 0x65, 0x6d, 0xb6, 0x69, 0x30, 0x76, - 0xe3, 0xee, 0x56, 0xe8, 0x2f, 0xf5,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0x4c, 0x33, 0x8a, 0x1a, 0x53, 0x03, 0x00, + 0x00, } diff --git a/vendor/gitlab.com/gitlab-org/gitaly-proto/go/ssh.pb.go b/vendor/gitlab.com/gitlab-org/gitaly-proto/go/ssh.pb.go index 842b88e5f1047597dca10d8598e6b904ce1eadeb..2fe41d0272bb324dd83bf89a1802c94df50c719a 100644 --- a/vendor/gitlab.com/gitlab-org/gitaly-proto/go/ssh.pb.go +++ b/vendor/gitlab.com/gitlab-org/gitaly-proto/go/ssh.pb.go @@ -85,8 +85,10 @@ type SSHReceivePackRequest struct { Repository *Repository `protobuf:"bytes,1,opt,name=repository" json:"repository,omitempty"` // A chunk of raw data to be copied to 'git upload-pack' standard input Stdin []byte `protobuf:"bytes,2,opt,name=stdin,proto3" json:"stdin,omitempty"` - // Contents of GL_ID environment variable for 'git receive-pack' - GlId string `protobuf:"bytes,3,opt,name=gl_id,json=glId" json:"gl_id,omitempty"` + // Contents of GL_ID and GL_REPOSITORY environment variables for + // 'git receive-pack' + GlId string `protobuf:"bytes,3,opt,name=gl_id,json=glId" json:"gl_id,omitempty"` + GlRepository string `protobuf:"bytes,4,opt,name=gl_repository,json=glRepository" json:"gl_repository,omitempty"` } func (m *SSHReceivePackRequest) Reset() { *m = SSHReceivePackRequest{} } @@ -115,6 +117,13 @@ func (m *SSHReceivePackRequest) GetGlId() string { return "" } +func (m *SSHReceivePackRequest) GetGlRepository() string { + if m != nil { + return m.GlRepository + } + return "" +} + type SSHReceivePackResponse struct { // A chunk of raw data from 'git receive-pack' standard output Stdout []byte `protobuf:"bytes,1,opt,name=stdout,proto3" json:"stdout,omitempty"` @@ -334,23 +343,24 @@ var _SSH_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("ssh.proto", fileDescriptor6) } var fileDescriptor6 = []byte{ - // 284 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x52, 0xcd, 0x4a, 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a8, 0x7f, 0x09, 0xc8, 0xaf, 0xa1, 0x9f, 0xe5, 0x0b, 0x2d, 0x2b, - 0x47, 0x03, 0x71, 0x91, 0xe5, 0x4f, 0x32, 0xf8, 0x84, 0xf1, 0xa1, 0xee, 0x09, 0x63, 0xc7, 0x5f, - 0x0c, 0x7a, 0x49, 0x32, 0xe3, 0x02, 0x2e, 0x3b, 0xcb, 0xe7, 0xb7, 0x3f, 0x83, 0x7f, 0xbd, 0xba, - 0x7f, 0x77, 0x04, 0xad, 0xad, 0x07, 0x67, 0x21, 0x7b, 0x60, 0x7c, 0x0e, 0x57, 0xdd, 0x68, 0xbc, - 0x3d, 0xf6, 0x7b, 0xd5, 0xfe, 0xfd, 0x31, 0xb8, 0x4d, 0xfb, 0xea, 0x54, 0x1f, 0x72, 0xfa, 0x1d, - 0x00, 0x00, 0xff, 0xff, 0x71, 0xde, 0xae, 0x4f, 0xb3, 0x02, 0x00, 0x00, + // 304 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x52, 0xcd, 0x4e, 0xf3, 0x30, + 0x10, 0xfc, 0xfc, 0xf5, 0x47, 0xea, 0x36, 0xe5, 0xb0, 0x94, 0xaa, 0x8a, 0x00, 0x55, 0xe1, 0x92, + 0x53, 0x84, 0xd2, 0x67, 0x40, 0x2a, 0x37, 0xe4, 0xa8, 0xe7, 0x10, 0x6a, 0x2b, 0xb5, 0xb0, 0xea, + 0x60, 0x3b, 0xa8, 0x95, 0xe0, 0x49, 0x78, 0x09, 0x1e, 0x11, 0xc9, 0x09, 0x25, 0x29, 0xf4, 0x08, + 0xb7, 0xcc, 0x4e, 0x76, 0x66, 0xd6, 0xbb, 0x30, 0x30, 0x66, 0x1d, 0x15, 0x5a, 0x59, 0x85, 0xfd, + 0x5c, 0xd8, 0x4c, 0xee, 0x7c, 0xcf, 0xac, 0x33, 0xcd, 0x59, 0x55, 0x0d, 0xee, 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 0x36, 0xdb, 0xbe, 0xef, 0xc3, 0xbf, 0x3c, 0x46, 0x37, 0x65, 0x1f, 0xfa, 0xee, + 0x6c, 0xe7, 0x1f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xa3, 0x3d, 0xb9, 0xce, 0xd9, 0x02, 0x00, 0x00, } diff --git a/vendor/vendor.json b/vendor/vendor.json index 181c38ef9db3c78346dc24813778c39686be8742..1fe7449b24c13ef15237d37e790f0b952d28e5db 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -117,20 +117,20 @@ "revisionTime": "2017-01-30T11:31:45Z" }, { - "checksumSHA1": "aHVxlXMV5xCeI9Tnhg2TfMJtDmE=", + "checksumSHA1": "xoChRi6dWPR0Bt78+zius0y/ur4=", "path": "gitlab.com/gitlab-org/gitaly-proto/go", - "revision": "1ec5c4d277421304d15f8a1b96365d67c30602c0", - "revisionTime": "2017-04-26T12:18:56Z", - "version": "v0.6.0", - "versionExact": "v0.6.0" + "revision": "8967f31f8d73482228a357acba0f1ce3744ceae2", + "revisionTime": "2017-05-05T12:14:06Z", + "version": "v0.7.0", + "versionExact": "v0.7.0" }, { "checksumSHA1": "GkeSZfXVbtAkBZOrswot19GJZqQ=", "path": "gitlab.com/gitlab-org/gitaly-proto/go/helper", - "revision": "1ec5c4d277421304d15f8a1b96365d67c30602c0", - "revisionTime": "2017-04-26T12:18:56Z", - "version": "v0.6.0", - "versionExact": "v0.6.0" + "revision": "8967f31f8d73482228a357acba0f1ce3744ceae2", + "revisionTime": "2017-05-05T12:14:06Z", + "version": "v0.7.0", + "versionExact": "v0.7.0" }, { "checksumSHA1": "9jjO5GjLa0XF/nfWihF02RoH4qc=",