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

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Cai <jcai@gitlab.com>2020-01-08 22:58:40 +0300
committerJohn Cai <jcai@gitlab.com>2020-01-09 19:22:50 +0300
commit7e5b688b80be9899ba3a3d818aa3d79e44017b52 (patch)
treed314edcaf1e1c5128bf4730e5021db56953949a9
parent4fb323c51c38d1ef26a4e40bd49f3442794232c8 (diff)
Change signature of hook RPCs
In order to use these RPCs with the client/std_stream.go methods, the success field needs to change to exit_status.
-rw-r--r--changelogs/unreleased/jc-change-hooks.yml5
-rw-r--r--internal/service/hooks/post_receive.go4
-rw-r--r--internal/service/hooks/post_receive_test.go57
-rw-r--r--internal/service/hooks/pre_receive.go4
-rw-r--r--internal/service/hooks/pre_receive_test.go56
-rw-r--r--internal/service/hooks/stream_command.go13
-rw-r--r--internal/service/hooks/update.go4
-rw-r--r--internal/service/hooks/update_test.go38
-rw-r--r--proto/go/gitalypb/hook.pb.go111
-rw-r--r--proto/hook.proto6
-rw-r--r--ruby/proto/gitaly/hook_pb.rb6
11 files changed, 153 insertions, 151 deletions
diff --git a/changelogs/unreleased/jc-change-hooks.yml b/changelogs/unreleased/jc-change-hooks.yml
new file mode 100644
index 000000000..3f298bb25
--- /dev/null
+++ b/changelogs/unreleased/jc-change-hooks.yml
@@ -0,0 +1,5 @@
+---
+title: Change signature of hook RPCs
+merge_request: 1741
+author:
+type: other
diff --git a/internal/service/hooks/post_receive.go b/internal/service/hooks/post_receive.go
index bfe6e628a..1cf2a6a69 100644
--- a/internal/service/hooks/post_receive.go
+++ b/internal/service/hooks/post_receive.go
@@ -40,7 +40,7 @@ func (s *server) PostReceiveHook(stream gitalypb.HookService_PostReceiveHookServ
c := exec.Command(gitlabShellHook("post-receive"))
c.Dir = repoPath
- success, err := streamCommandResponse(
+ status, err := streamCommandResponse(
stream.Context(),
stdin,
stdout, stderr,
@@ -53,7 +53,7 @@ func (s *server) PostReceiveHook(stream gitalypb.HookService_PostReceiveHookServ
}
if err := stream.SendMsg(&gitalypb.PostReceiveHookResponse{
- Success: success,
+ ExitStatus: &gitalypb.ExitStatus{Value: status},
}); err != nil {
return helper.ErrInternal(err)
}
diff --git a/internal/service/hooks/post_receive_test.go b/internal/service/hooks/post_receive_test.go
index bf9adf0fa..9be1c2099 100644
--- a/internal/service/hooks/post_receive_test.go
+++ b/internal/service/hooks/post_receive_test.go
@@ -58,36 +58,36 @@ func TestPostReceive(t *testing.T) {
defer conn.Close()
testCases := []struct {
- desc string
- stdin io.Reader
- req gitalypb.PostReceiveHookRequest
- success bool
- stdout string
- stderr string
+ desc string
+ stdin io.Reader
+ req gitalypb.PostReceiveHookRequest
+ status int32
+ stdout string
+ stderr string
}{
{
- desc: "valid stdin",
- stdin: bytes.NewBufferString("a\nb\nc\nd\ne\nf\ng"),
- req: gitalypb.PostReceiveHookRequest{Repository: testRepo, KeyId: "key_id"},
- success: true,
- stdout: "OK",
- stderr: "",
+ desc: "valid stdin",
+ stdin: bytes.NewBufferString("a\nb\nc\nd\ne\nf\ng"),
+ req: gitalypb.PostReceiveHookRequest{Repository: testRepo, KeyId: "key_id"},
+ status: 0,
+ stdout: "OK",
+ stderr: "",
},
{
- desc: "missing stdin",
- stdin: bytes.NewBuffer(nil),
- req: gitalypb.PostReceiveHookRequest{Repository: testRepo, KeyId: "key_id"},
- success: false,
- stdout: "",
- stderr: "FAIL",
+ desc: "missing stdin",
+ stdin: bytes.NewBuffer(nil),
+ req: gitalypb.PostReceiveHookRequest{Repository: testRepo, KeyId: "key_id"},
+ status: 1,
+ stdout: "",
+ stderr: "FAIL",
},
{
- desc: "missing key_id",
- stdin: bytes.NewBuffer(nil),
- req: gitalypb.PostReceiveHookRequest{Repository: testRepo},
- success: false,
- stdout: "",
- stderr: "FAIL",
+ desc: "missing key_id",
+ stdin: bytes.NewBuffer(nil),
+ req: gitalypb.PostReceiveHookRequest{Repository: testRepo},
+ status: 1,
+ stdout: "",
+ stderr: "FAIL",
},
}
@@ -109,7 +109,7 @@ func TestPostReceive(t *testing.T) {
require.NoError(t, stream.CloseSend(), "close send")
}()
- var success bool
+ var status int32
var stdout, stderr bytes.Buffer
for {
resp, err := stream.Recv()
@@ -120,13 +120,10 @@ func TestPostReceive(t *testing.T) {
_, err = stdout.Write(resp.GetStdout())
require.NoError(t, err)
stderr.Write(resp.GetStderr())
- require.NoError(t, err)
-
- success = resp.GetSuccess()
- require.NoError(t, err)
+ status = resp.GetExitStatus().GetValue()
}
- require.Equal(t, tc.success, success)
+ require.Equal(t, tc.status, status)
assert.Equal(t, tc.stderr, text.ChompBytes(stderr.Bytes()), "hook stderr")
assert.Equal(t, tc.stdout, text.ChompBytes(stdout.Bytes()), "hook stdout")
})
diff --git a/internal/service/hooks/pre_receive.go b/internal/service/hooks/pre_receive.go
index 63ff2db90..86eb9877c 100644
--- a/internal/service/hooks/pre_receive.go
+++ b/internal/service/hooks/pre_receive.go
@@ -61,7 +61,7 @@ func (s *server) PreReceiveHook(stream gitalypb.HookService_PreReceiveHookServer
c := exec.Command(gitlabShellHook("pre-receive"))
c.Dir = repoPath
- success, err := streamCommandResponse(
+ status, err := streamCommandResponse(
stream.Context(),
stdin,
stdout, stderr,
@@ -74,7 +74,7 @@ func (s *server) PreReceiveHook(stream gitalypb.HookService_PreReceiveHookServer
}
if err := stream.SendMsg(&gitalypb.PreReceiveHookResponse{
- Success: success,
+ ExitStatus: &gitalypb.ExitStatus{Value: status},
}); err != nil {
return helper.ErrInternal(err)
}
diff --git a/internal/service/hooks/pre_receive_test.go b/internal/service/hooks/pre_receive_test.go
index 52ce8ec7b..1b7e52d6d 100644
--- a/internal/service/hooks/pre_receive_test.go
+++ b/internal/service/hooks/pre_receive_test.go
@@ -65,40 +65,40 @@ func TestPreReceive(t *testing.T) {
desc string
stdin io.Reader
req gitalypb.PreReceiveHookRequest
- success bool
+ status int32
stdout, stderr string
}{
{
- desc: "valid stdin",
- stdin: bytes.NewBufferString("a\nb\nc\nd\ne\nf\ng"),
- req: gitalypb.PreReceiveHookRequest{Repository: testRepo, KeyId: "key_id", Protocol: "protocol"},
- success: true,
- stdout: "OK",
- stderr: "",
+ desc: "valid stdin",
+ stdin: bytes.NewBufferString("a\nb\nc\nd\ne\nf\ng"),
+ req: gitalypb.PreReceiveHookRequest{Repository: testRepo, KeyId: "key_id", Protocol: "protocol"},
+ status: 0,
+ stdout: "OK",
+ stderr: "",
},
{
- desc: "missing stdin",
- stdin: bytes.NewBuffer(nil),
- req: gitalypb.PreReceiveHookRequest{Repository: testRepo, KeyId: "key_id", Protocol: "protocol"},
- success: false,
- stdout: "",
- stderr: "FAIL",
+ desc: "missing stdin",
+ stdin: bytes.NewBuffer(nil),
+ req: gitalypb.PreReceiveHookRequest{Repository: testRepo, KeyId: "key_id", Protocol: "protocol"},
+ status: 1,
+ stdout: "",
+ stderr: "FAIL",
},
{
- desc: "missing protocol",
- stdin: bytes.NewBufferString("a\nb\nc\nd\ne\nf\ng"),
- req: gitalypb.PreReceiveHookRequest{Repository: testRepo, KeyId: "key_id"},
- success: false,
- stdout: "",
- stderr: "FAIL",
+ desc: "missing protocol",
+ stdin: bytes.NewBufferString("a\nb\nc\nd\ne\nf\ng"),
+ req: gitalypb.PreReceiveHookRequest{Repository: testRepo, KeyId: "key_id"},
+ status: 1,
+ stdout: "",
+ stderr: "FAIL",
},
{
- desc: "missing key_id",
- stdin: bytes.NewBufferString("a\nb\nc\nd\ne\nf\ng"),
- req: gitalypb.PreReceiveHookRequest{Repository: testRepo, Protocol: "protocol"},
- success: false,
- stdout: "",
- stderr: "FAIL",
+ desc: "missing key_id",
+ stdin: bytes.NewBufferString("a\nb\nc\nd\ne\nf\ng"),
+ req: gitalypb.PreReceiveHookRequest{Repository: testRepo, Protocol: "protocol"},
+ status: 1,
+ stdout: "",
+ stderr: "FAIL",
},
}
@@ -117,7 +117,7 @@ func TestPreReceive(t *testing.T) {
require.NoError(t, stream.CloseSend(), "close send")
}()
- var success bool
+ var status int32
var stdout, stderr bytes.Buffer
for {
resp, err := stream.Recv()
@@ -133,11 +133,11 @@ func TestPreReceive(t *testing.T) {
_, err = stderr.Write(resp.GetStderr())
require.NoError(t, err)
- success = resp.GetSuccess()
+ status = resp.GetExitStatus().GetValue()
require.NoError(t, err)
}
- require.Equal(t, tc.success, success)
+ require.Equal(t, tc.status, status)
assert.Equal(t, tc.stderr, text.ChompBytes(stderr.Bytes()), "hook stderr")
assert.Equal(t, tc.stdout, text.ChompBytes(stdout.Bytes()), "hook stdout")
})
diff --git a/internal/service/hooks/stream_command.go b/internal/service/hooks/stream_command.go
index 30d8003bf..2893dd5a8 100644
--- a/internal/service/hooks/stream_command.go
+++ b/internal/service/hooks/stream_command.go
@@ -15,21 +15,20 @@ func streamCommandResponse(
stdout, stderr io.Writer,
c *exec.Cmd,
env []string,
-) (bool, error) {
+) (int32, error) {
cmd, err := command.New(ctx, c, stdin, stdout, stderr, env...)
if err != nil {
- return false, helper.ErrInternal(err)
+ return 1, helper.ErrInternal(err)
}
err = cmd.Wait()
if err == nil {
- return true, nil
+ return 0, nil
}
- code, ok := command.ExitStatus(err)
- if ok && code != 0 {
- return false, nil
+ if code, ok := command.ExitStatus(err); ok {
+ return int32(code), nil
}
- return false, err
+ return 1, err
}
diff --git a/internal/service/hooks/update.go b/internal/service/hooks/update.go
index 6cfad6093..59d5597e6 100644
--- a/internal/service/hooks/update.go
+++ b/internal/service/hooks/update.go
@@ -31,7 +31,7 @@ func (s *server) UpdateHook(in *gitalypb.UpdateHookRequest, stream gitalypb.Hook
c := exec.Command(gitlabShellHook("update"), string(in.GetRef()), in.GetOldValue(), in.GetNewValue())
c.Dir = repoPath
- success, err := streamCommandResponse(
+ status, err := streamCommandResponse(
stream.Context(),
nil,
stdout, stderr,
@@ -44,7 +44,7 @@ func (s *server) UpdateHook(in *gitalypb.UpdateHookRequest, stream gitalypb.Hook
}
if err := stream.SendMsg(&gitalypb.PreReceiveHookResponse{
- Success: success,
+ ExitStatus: &gitalypb.ExitStatus{Value: status},
}); err != nil {
return helper.ErrInternal(err)
}
diff --git a/internal/service/hooks/update_test.go b/internal/service/hooks/update_test.go
index 07b64a28c..bfd30821d 100644
--- a/internal/service/hooks/update_test.go
+++ b/internal/service/hooks/update_test.go
@@ -60,7 +60,7 @@ func TestUpdate(t *testing.T) {
testCases := []struct {
desc string
req gitalypb.UpdateHookRequest
- success bool
+ status int32
stdout, stderr string
}{
{
@@ -72,9 +72,9 @@ func TestUpdate(t *testing.T) {
NewValue: "b",
KeyId: "key",
},
- success: true,
- stdout: "OK",
- stderr: "",
+ status: 0,
+ stdout: "OK",
+ stderr: "",
},
{
desc: "missing ref",
@@ -85,9 +85,9 @@ func TestUpdate(t *testing.T) {
NewValue: "b",
KeyId: "key",
},
- success: false,
- stdout: "",
- stderr: "FAIL",
+ status: 1,
+ stdout: "",
+ stderr: "FAIL",
},
{
desc: "missing old value",
@@ -98,9 +98,9 @@ func TestUpdate(t *testing.T) {
NewValue: "b",
KeyId: "key",
},
- success: false,
- stdout: "",
- stderr: "FAIL",
+ status: 1,
+ stdout: "",
+ stderr: "FAIL",
},
{
desc: "missing new value",
@@ -111,9 +111,9 @@ func TestUpdate(t *testing.T) {
NewValue: "",
KeyId: "key",
},
- success: false,
- stdout: "",
- stderr: "FAIL",
+ status: 1,
+ stdout: "",
+ stderr: "FAIL",
},
{
desc: "missing key_id value",
@@ -124,9 +124,9 @@ func TestUpdate(t *testing.T) {
NewValue: "b",
KeyId: "",
},
- success: false,
- stdout: "",
- stderr: "FAIL",
+ status: 1,
+ stdout: "",
+ stderr: "FAIL",
},
}
@@ -135,7 +135,7 @@ func TestUpdate(t *testing.T) {
stream, err := client.UpdateHook(ctx, &tc.req)
require.NoError(t, err)
- var success bool
+ var status int32
var stderr, stdout bytes.Buffer
for {
resp, err := stream.Recv()
@@ -150,11 +150,11 @@ func TestUpdate(t *testing.T) {
t.Errorf("error when receiving stream: %v", err)
}
- success = resp.GetSuccess()
+ status = resp.GetExitStatus().GetValue()
require.NoError(t, err)
}
- require.Equal(t, tc.success, success)
+ require.Equal(t, tc.status, status)
assert.Equal(t, tc.stderr, text.ChompBytes(stderr.Bytes()), "hook stderr")
assert.Equal(t, tc.stdout, text.ChompBytes(stdout.Bytes()), "hook stdout")
})
diff --git a/proto/go/gitalypb/hook.pb.go b/proto/go/gitalypb/hook.pb.go
index 160519b49..5da3a4414 100644
--- a/proto/go/gitalypb/hook.pb.go
+++ b/proto/go/gitalypb/hook.pb.go
@@ -88,12 +88,12 @@ func (m *PreReceiveHookRequest) GetStdin() []byte {
}
type PreReceiveHookResponse struct {
- Stdout []byte `protobuf:"bytes,1,opt,name=stdout,proto3" json:"stdout,omitempty"`
- Stderr []byte `protobuf:"bytes,2,opt,name=stderr,proto3" json:"stderr,omitempty"`
- Success bool `protobuf:"varint,3,opt,name=success,proto3" json:"success,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
+ Stdout []byte `protobuf:"bytes,1,opt,name=stdout,proto3" json:"stdout,omitempty"`
+ Stderr []byte `protobuf:"bytes,2,opt,name=stderr,proto3" json:"stderr,omitempty"`
+ ExitStatus *ExitStatus `protobuf:"bytes,3,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
}
func (m *PreReceiveHookResponse) Reset() { *m = PreReceiveHookResponse{} }
@@ -135,11 +135,11 @@ func (m *PreReceiveHookResponse) GetStderr() []byte {
return nil
}
-func (m *PreReceiveHookResponse) GetSuccess() bool {
+func (m *PreReceiveHookResponse) GetExitStatus() *ExitStatus {
if m != nil {
- return m.Success
+ return m.ExitStatus
}
- return false
+ return nil
}
type PostReceiveHookRequest struct {
@@ -198,12 +198,12 @@ func (m *PostReceiveHookRequest) GetStdin() []byte {
}
type PostReceiveHookResponse struct {
- Stdout []byte `protobuf:"bytes,1,opt,name=stdout,proto3" json:"stdout,omitempty"`
- Stderr []byte `protobuf:"bytes,2,opt,name=stderr,proto3" json:"stderr,omitempty"`
- Success bool `protobuf:"varint,3,opt,name=success,proto3" json:"success,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
+ Stdout []byte `protobuf:"bytes,1,opt,name=stdout,proto3" json:"stdout,omitempty"`
+ Stderr []byte `protobuf:"bytes,2,opt,name=stderr,proto3" json:"stderr,omitempty"`
+ ExitStatus *ExitStatus `protobuf:"bytes,3,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
}
func (m *PostReceiveHookResponse) Reset() { *m = PostReceiveHookResponse{} }
@@ -245,11 +245,11 @@ func (m *PostReceiveHookResponse) GetStderr() []byte {
return nil
}
-func (m *PostReceiveHookResponse) GetSuccess() bool {
+func (m *PostReceiveHookResponse) GetExitStatus() *ExitStatus {
if m != nil {
- return m.Success
+ return m.ExitStatus
}
- return false
+ return nil
}
type UpdateHookRequest struct {
@@ -324,12 +324,12 @@ func (m *UpdateHookRequest) GetNewValue() string {
}
type UpdateHookResponse struct {
- Stdout []byte `protobuf:"bytes,1,opt,name=stdout,proto3" json:"stdout,omitempty"`
- Stderr []byte `protobuf:"bytes,2,opt,name=stderr,proto3" json:"stderr,omitempty"`
- Success bool `protobuf:"varint,3,opt,name=success,proto3" json:"success,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
+ Stdout []byte `protobuf:"bytes,1,opt,name=stdout,proto3" json:"stdout,omitempty"`
+ Stderr []byte `protobuf:"bytes,2,opt,name=stderr,proto3" json:"stderr,omitempty"`
+ ExitStatus *ExitStatus `protobuf:"bytes,3,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
}
func (m *UpdateHookResponse) Reset() { *m = UpdateHookResponse{} }
@@ -371,11 +371,11 @@ func (m *UpdateHookResponse) GetStderr() []byte {
return nil
}
-func (m *UpdateHookResponse) GetSuccess() bool {
+func (m *UpdateHookResponse) GetExitStatus() *ExitStatus {
if m != nil {
- return m.Success
+ return m.ExitStatus
}
- return false
+ return nil
}
func init() {
@@ -390,34 +390,35 @@ func init() {
func init() { proto.RegisterFile("hook.proto", fileDescriptor_3eef30da1c11ee1b) }
var fileDescriptor_3eef30da1c11ee1b = []byte{
- // 419 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x53, 0x4d, 0x8f, 0xd3, 0x30,
- 0x10, 0x95, 0x5b, 0x5a, 0xda, 0xd9, 0x8a, 0x0f, 0x8b, 0x2d, 0x21, 0x08, 0xa8, 0x72, 0xca, 0x85,
- 0xb6, 0x94, 0x7f, 0xc0, 0x09, 0x6e, 0x95, 0x11, 0x1c, 0x38, 0xec, 0x2a, 0x89, 0x87, 0x6e, 0x94,
- 0x90, 0x09, 0xb6, 0xd3, 0x55, 0xfe, 0x07, 0x12, 0x77, 0x8e, 0xfc, 0x44, 0x4e, 0x28, 0x76, 0xda,
- 0xed, 0x6e, 0xb3, 0xb7, 0xdd, 0x9b, 0xdf, 0x3c, 0x7b, 0xde, 0xbc, 0x19, 0x0f, 0xc0, 0x05, 0x51,
- 0x36, 0x2f, 0x15, 0x19, 0xe2, 0xc3, 0x4d, 0x6a, 0xa2, 0xbc, 0xf6, 0x27, 0xfa, 0x22, 0x52, 0x28,
- 0x5d, 0x34, 0xf8, 0xc5, 0xe0,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x39, 0x70, 0x64, 0x81, 0x97,
- 0x96, 0x0c, 0xce, 0x80, 0x1f, 0xd6, 0x7a, 0xd7, 0xcd, 0x58, 0xfd, 0xe9, 0xc1, 0x49, 0x93, 0xfa,
- 0x33, 0xaa, 0x6d, 0x9a, 0x20, 0x3f, 0x83, 0x47, 0xd7, 0x3f, 0x18, 0x7f, 0xb5, 0x6b, 0x42, 0xe7,
- 0x3a, 0xf8, 0xaf, 0x6f, 0xa3, 0x5d, 0xa9, 0xc1, 0xf8, 0xdf, 0xef, 0x70, 0x30, 0xea, 0xf9, 0xec,
- 0x5d, 0xc8, 0x96, 0x8c, 0x47, 0xf0, 0xf8, 0xc6, 0x84, 0xf9, 0x55, 0x86, 0xce, 0x5f, 0xe7, 0xbf,
- 0xb9, 0x95, 0xef, 0x96, 0x58, 0x03, 0x5c, 0xb5, 0x8c, 0xbf, 0xd8, 0xbd, 0x3e, 0x1a, 0xb9, 0xef,
- 0x77, 0x51, 0x47, 0x39, 0x97, 0xec, 0xc3, 0xf2, 0x5b, 0x73, 0x33, 0x8f, 0xe2, 0x79, 0x42, 0x3f,
- 0x16, 0xee, 0xf8, 0x96, 0xd4, 0x66, 0xe1, 0xde, 0x2f, 0xec, 0xd2, 0x2e, 0x36, 0xd4, 0xe2, 0x32,
- 0x8e, 0x87, 0x36, 0xf4, 0xfe, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa5, 0xca, 0x64, 0xd9, 0x69,
- 0x04, 0x00, 0x00,
+ // 434 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x94, 0xcf, 0x8e, 0xd3, 0x30,
+ 0x10, 0xc6, 0xe5, 0x96, 0x56, 0xed, 0xb4, 0xe2, 0x8f, 0xc5, 0x96, 0x12, 0x04, 0x54, 0x39, 0xe5,
+ 0x42, 0x5b, 0xba, 0x6f, 0x80, 0x84, 0x04, 0xb7, 0xca, 0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x27,
+ 0xfe, 0xf8, 0x8a, 0xf4, 0x7a, 0xe2, 0xdf, 0x4f, 0xdc, 0x5f, 0x60, 0xb2, 0xa6, 0x22, 0x4e, 0x97,
+ 0xcb, 0xb6, 0x4b, 0x9d, 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x90, 0x69, 0xbd, 0x6b, 0xba, 0x04,
+ 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
diff --git a/proto/hook.proto b/proto/hook.proto
index 487692d1e..194036689 100644
--- a/proto/hook.proto
+++ b/proto/hook.proto
@@ -37,7 +37,7 @@ message PreReceiveHookRequest {
message PreReceiveHookResponse{
bytes stdout = 1;
bytes stderr = 2;
- bool success = 3;
+ ExitStatus exit_status = 3;
}
message PostReceiveHookRequest {
@@ -49,7 +49,7 @@ message PostReceiveHookRequest {
message PostReceiveHookResponse{
bytes stdout = 1;
bytes stderr = 2;
- bool success = 3;
+ ExitStatus exit_status = 3;
}
message UpdateHookRequest {
@@ -63,5 +63,5 @@ message UpdateHookRequest {
message UpdateHookResponse{
bytes stdout = 1;
bytes stderr = 2;
- bool success = 3;
+ ExitStatus exit_status = 3;
}
diff --git a/ruby/proto/gitaly/hook_pb.rb b/ruby/proto/gitaly/hook_pb.rb
index b354bbf98..3f0b91b89 100644
--- a/ruby/proto/gitaly/hook_pb.rb
+++ b/ruby/proto/gitaly/hook_pb.rb
@@ -14,7 +14,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
add_message "gitaly.PreReceiveHookResponse" do
optional :stdout, :bytes, 1
optional :stderr, :bytes, 2
- optional :success, :bool, 3
+ optional :exit_status, :message, 3, "gitaly.ExitStatus"
end
add_message "gitaly.PostReceiveHookRequest" do
optional :repository, :message, 1, "gitaly.Repository"
@@ -24,7 +24,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
add_message "gitaly.PostReceiveHookResponse" do
optional :stdout, :bytes, 1
optional :stderr, :bytes, 2
- optional :success, :bool, 3
+ optional :exit_status, :message, 3, "gitaly.ExitStatus"
end
add_message "gitaly.UpdateHookRequest" do
optional :repository, :message, 1, "gitaly.Repository"
@@ -36,7 +36,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
add_message "gitaly.UpdateHookResponse" do
optional :stdout, :bytes, 1
optional :stderr, :bytes, 2
- optional :success, :bool, 3
+ optional :exit_status, :message, 3, "gitaly.ExitStatus"
end
end