Skip to content

Change signature of hook RPCs

John Cai requested to merge jc-change-hooks into master

client/std_stream.go has some nice methods that we can use with the hook rpcs. For instance, the interface

type stdoutStderrResponse interface {
	GetExitStatus() *gitalypb.ExitStatus
	GetStderr() []byte
	GetStdout() []byte
}

Is essentially what the hook responses are. Except in the hook responses we use a success boolean instead of the exit status.

In order to use these RPCs with the client/std_stream.go methods, the success field needs to change to exit_status. That way, we can use the existing logic of https://gitlab.com/gitlab-org/gitaly/blob/master/client/std_stream.go#L16 to stream back stdout and stderr.

This is the first step. In another MR, we will export stdoutStderrResponse and streamHandler so we can call them from the gitaly-hooks package.

Since nothing is calling these RPCs yet, we can safely change the contract.

Edited by GitLab Release Tools Bot

Merge request reports

Loading