diff options
author | John Cai <jcai@gitlab.com> | 2020-01-14 03:09:52 +0300 |
---|---|---|
committer | John Cai <jcai@gitlab.com> | 2020-01-15 23:32:09 +0300 |
commit | a08660f7f12e82934c86a72534712147176c33f7 (patch) | |
tree | 2110e7b8e42fdc26a96b123ece3726a6f167d447 | |
parent | ee9319d9c9037f96555e1c8a8bfa411aa6770806 (diff) |
Add git push optionsjc-add-push-options-all
-rw-r--r-- | changelogs/unreleased/jc-add-push-options.yml | 5 | ||||
-rw-r--r-- | cmd/gitaly-hooks/hooks.go | 19 | ||||
-rw-r--r-- | cmd/gitaly-hooks/hooks_test.go | 33 | ||||
-rw-r--r-- | internal/git/hooks/hooks.go | 13 | ||||
-rw-r--r-- | internal/service/hooks/post_receive.go | 3 | ||||
-rw-r--r-- | internal/service/hooks/post_receive_test.go | 14 | ||||
-rwxr-xr-x | internal/service/hooks/testdata/gitlab-shell/hooks/post-receive | 2 | ||||
-rw-r--r-- | proto/go/gitalypb/hook.pb.go | 68 | ||||
-rw-r--r-- | proto/hook.proto | 1 | ||||
-rw-r--r-- | ruby/proto/gitaly/hook_pb.rb | 1 |
10 files changed, 118 insertions, 41 deletions
diff --git a/changelogs/unreleased/jc-add-push-options.yml b/changelogs/unreleased/jc-add-push-options.yml new file mode 100644 index 000000000..c830529ff --- /dev/null +++ b/changelogs/unreleased/jc-add-push-options.yml @@ -0,0 +1,5 @@ +--- +title: Add git push options +merge_request: 1756 +author: +type: changed diff --git a/cmd/gitaly-hooks/hooks.go b/cmd/gitaly-hooks/hooks.go index bff7fa45a..51d304215 100644 --- a/cmd/gitaly-hooks/hooks.go +++ b/cmd/gitaly-hooks/hooks.go @@ -7,6 +7,7 @@ import ( "io" "net/http" "os" + "strconv" "strings" gitalyauth "gitlab.com/gitlab-org/gitaly/auth" @@ -116,7 +117,8 @@ func main() { RelativePath: os.Getenv("GL_REPO_RELATIVE_PATH"), GlRepository: os.Getenv("GL_REPOSITORY"), }, - KeyId: os.Getenv("GL_ID"), + KeyId: os.Getenv("GL_ID"), + GitPushOptions: gitPushOptions(), }); err != nil { logger.Fatalf("error when sending request: %v", err) } @@ -157,6 +159,21 @@ func sendAndRecv(stream grpc.ClientStream, resp client.StdoutStderrResponse, sen }, sender, stdout, stderr) } +func gitPushOptions() []string { + gitPushOptionCount, err := strconv.Atoi(os.Getenv("GIT_PUSH_OPTION_COUNT")) + if err != nil { + return []string{} + } + + var gitPushOptions []string + + for i := 0; i < gitPushOptionCount; i++ { + gitPushOptions = append(gitPushOptions, os.Getenv(fmt.Sprintf("GIT_PUSH_OPTION_%d", i))) + } + + return gitPushOptions +} + // GitlabShellConfig contains a subset of gitlabshell's config.yml type GitlabShellConfig struct { GitlabURL string `yaml:"gitlab_url"` diff --git a/cmd/gitaly-hooks/hooks_test.go b/cmd/gitaly-hooks/hooks_test.go index 4fd39c7f0..a448ef830 100644 --- a/cmd/gitaly-hooks/hooks_test.go +++ b/cmd/gitaly-hooks/hooks_test.go @@ -21,6 +21,7 @@ import ( "github.com/stretchr/testify/require" "gitlab.com/gitlab-org/gitaly/internal/command" "gitlab.com/gitlab-org/gitaly/internal/config" + "gitlab.com/gitlab-org/gitaly/internal/git/hooks" serverPkg "gitlab.com/gitlab-org/gitaly/internal/server" "gitlab.com/gitlab-org/gitaly/internal/testhelper" "google.golang.org/grpc" @@ -59,7 +60,9 @@ func TestHooksPrePostReceive(t *testing.T) { config.Config.GitlabShell.Dir = tempGitlabShellDir - ts := gitlabTestServer(t, "", "", secretToken, key, glRepository, changes, true) + gitPushOptions := []string{"gitpushoption1", "gitpushoption2"} + + ts := gitlabTestServer(t, "", "", secretToken, key, glRepository, changes, true, gitPushOptions...) defer ts.Close() writeTemporaryConfigFile(t, tempGitlabShellDir, GitlabShellConfig{GitlabURL: ts.URL}) @@ -76,7 +79,16 @@ func TestHooksPrePostReceive(t *testing.T) { cmd.Stderr = &stderr cmd.Stdout = &stdout cmd.Stdin = stdin - cmd.Env = env(t, glRepository, tempGitlabShellDir, testRepo.GetStorageName(), testRepo.GetRelativePath(), socket, key) + cmd.Env = env( + t, + glRepository, + tempGitlabShellDir, + testRepo.GetStorageName(), + testRepo.GetRelativePath(), + socket, + key, + gitPushOptions..., + ) require.NoError(t, cmd.Run()) require.Empty(t, stderr.String()) @@ -319,7 +331,7 @@ func handlePreReceive(t *testing.T, secretToken, glRepository string) func(w htt } } -func handlePostReceive(t *testing.T, secretToken string, key int, glRepository, changes string, counterDecreased bool) func(w http.ResponseWriter, r *http.Request) { +func handlePostReceive(t *testing.T, secretToken string, key int, glRepository, changes string, counterDecreased bool, gitPushOptions ...string) func(w http.ResponseWriter, r *http.Request) { return func(w http.ResponseWriter, r *http.Request) { require.NoError(t, r.ParseForm()) require.Equal(t, http.MethodPost, r.Method) @@ -329,6 +341,10 @@ func handlePostReceive(t *testing.T, secretToken string, key int, glRepository, require.Equal(t, fmt.Sprintf("key-%d", key), r.Form.Get("identifier")) require.Equal(t, changes, r.Form.Get("changes")) + if len(gitPushOptions) > 0 { + require.Equal(t, gitPushOptions, r.Form["push_options[]"]) + } + w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusOK) w.Write([]byte(fmt.Sprintf(`{"reference_counter_decreased": %v}`, counterDecreased))) @@ -361,11 +377,12 @@ func gitlabTestServer(t *testing.T, key int, glRepository, changes string, - postReceiveCounterDecreased bool) *httptest.Server { + postReceiveCounterDecreased bool, + gitPushOptions ...string) *httptest.Server { mux := http.NewServeMux() mux.Handle("/api/v4/internal/allowed", http.HandlerFunc(handleAllowed(t, secretToken, key, glRepository, changes))) mux.Handle("/api/v4/internal/pre_receive", http.HandlerFunc(handlePreReceive(t, secretToken, glRepository))) - mux.Handle("/api/v4/internal/post_receive", http.HandlerFunc(handlePostReceive(t, secretToken, key, glRepository, changes, postReceiveCounterDecreased))) + mux.Handle("/api/v4/internal/post_receive", http.HandlerFunc(handlePostReceive(t, secretToken, key, glRepository, changes, postReceiveCounterDecreased, gitPushOptions...))) mux.Handle("/api/v4/internal/check", http.HandlerFunc(handleCheck(t, user, password))) return httptest.NewServer(mux) @@ -389,13 +406,13 @@ func writeTemporaryConfigFile(t *testing.T, dir string, config GitlabShellConfig return path } -func env(t *testing.T, glRepo, gitlabShellDir, glStorage, glRelativePath, gitalySocket string, key int) []string { - return append(oldEnv(t, glRepo, gitlabShellDir, key), []string{ +func env(t *testing.T, glRepo, gitlabShellDir, glStorage, glRelativePath, gitalySocket string, key int, gitPushOptions ...string) []string { + return append(append(oldEnv(t, glRepo, gitlabShellDir, key), []string{ "GITALY_BIN_DIR=testdata/gitaly-libexec", fmt.Sprintf("GL_REPO_STORAGE=%s", glStorage), fmt.Sprintf("GL_REPO_RELATIVE_PATH=%s", glRelativePath), fmt.Sprintf("GITALY_SOCKET=%s", gitalySocket), - }...) + }...), hooks.GitPushOptions(gitPushOptions)...) } func oldEnv(t *testing.T, glRepo, gitlabShellDir string, key int) []string { diff --git a/internal/git/hooks/hooks.go b/internal/git/hooks/hooks.go index c77c3ed1e..0bc02103a 100644 --- a/internal/git/hooks/hooks.go +++ b/internal/git/hooks/hooks.go @@ -1,6 +1,7 @@ package hooks import ( + "fmt" "os" "path" @@ -25,3 +26,15 @@ func Path() string { return path.Join(config.Config.Ruby.Dir, "git-hooks") } + +// GitPushOptions turns a slice of git push option values into a GIT_PUSH_OPTION_COUNT and individual +// GIT_PUSH_OPTION_0, GIT_PUSH_OPTION_1 etc. +func GitPushOptions(options []string) []string { + envVars := []string{fmt.Sprintf("GIT_PUSH_OPTION_COUNT=%d", len(options))} + + for i, pushOption := range options { + envVars = append(envVars, fmt.Sprintf("GIT_PUSH_OPTION_%d=%s", i, pushOption)) + } + + return envVars +} diff --git a/internal/service/hooks/post_receive.go b/internal/service/hooks/post_receive.go index 726317370..55ec0323f 100644 --- a/internal/service/hooks/post_receive.go +++ b/internal/service/hooks/post_receive.go @@ -4,6 +4,7 @@ import ( "errors" "os/exec" + "gitlab.com/gitlab-org/gitaly/internal/git/hooks" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/streamio" @@ -24,6 +25,8 @@ func (s *server) PostReceiveHook(stream gitalypb.HookService_PostReceiveHookServ return helper.ErrInternal(err) } + hookEnv = append(hookEnv, hooks.GitPushOptions(firstRequest.GetGitPushOptions())...) + stdin := streamio.NewReader(func() ([]byte, error) { req, err := stream.Recv() return req.GetStdin(), err diff --git a/internal/service/hooks/post_receive_test.go b/internal/service/hooks/post_receive_test.go index cb5bd1c58..1dfee6948 100644 --- a/internal/service/hooks/post_receive_test.go +++ b/internal/service/hooks/post_receive_test.go @@ -65,7 +65,7 @@ func TestPostReceive(t *testing.T) { { desc: "valid stdin", stdin: bytes.NewBufferString("a\nb\nc\nd\ne\nf\ng"), - req: gitalypb.PostReceiveHookRequest{Repository: testRepo, KeyId: "key_id"}, + req: gitalypb.PostReceiveHookRequest{Repository: testRepo, KeyId: "key_id", GitPushOptions: []string{"option0", "option1"}}, status: 0, stdout: "OK", stderr: "", @@ -73,7 +73,7 @@ func TestPostReceive(t *testing.T) { { desc: "missing stdin", stdin: bytes.NewBuffer(nil), - req: gitalypb.PostReceiveHookRequest{Repository: testRepo, KeyId: "key_id"}, + req: gitalypb.PostReceiveHookRequest{Repository: testRepo, KeyId: "key_id", GitPushOptions: []string{"option0"}}, status: 1, stdout: "", stderr: "FAIL", @@ -81,7 +81,15 @@ func TestPostReceive(t *testing.T) { { desc: "missing key_id", stdin: bytes.NewBuffer(nil), - req: gitalypb.PostReceiveHookRequest{Repository: testRepo}, + req: gitalypb.PostReceiveHookRequest{Repository: testRepo, GitPushOptions: []string{"option0"}}, + status: 1, + stdout: "", + stderr: "FAIL", + }, + { + desc: "missing git push option", + stdin: bytes.NewBuffer(nil), + req: gitalypb.PostReceiveHookRequest{Repository: testRepo, KeyId: "key_id"}, status: 1, stdout: "", stderr: "FAIL", diff --git a/internal/service/hooks/testdata/gitlab-shell/hooks/post-receive b/internal/service/hooks/testdata/gitlab-shell/hooks/post-receive index 6f0207819..aa0b008de 100755 --- a/internal/service/hooks/testdata/gitlab-shell/hooks/post-receive +++ b/internal/service/hooks/testdata/gitlab-shell/hooks/post-receive @@ -4,5 +4,7 @@ abort("FAIL") if $stdin.read.empty? abort("FAIL") if %w[GL_ID GL_REPOSITORY].any? { |k| ENV[k].empty? } +# git push options are not required. This is only for the sake of testing the values get through +abort("FAIL") if %w[GIT_PUSH_OPTION_COUNT GIT_PUSH_OPTION_0].any? { |k| ENV[k].empty? } puts "OK" diff --git a/proto/go/gitalypb/hook.pb.go b/proto/go/gitalypb/hook.pb.go index 5da3a4414..291aff7d2 100644 --- a/proto/go/gitalypb/hook.pb.go +++ b/proto/go/gitalypb/hook.pb.go @@ -146,6 +146,7 @@ type PostReceiveHookRequest struct { Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` KeyId string `protobuf:"bytes,2,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"` Stdin []byte `protobuf:"bytes,3,opt,name=stdin,proto3" json:"stdin,omitempty"` + GitPushOptions []string `protobuf:"bytes,4,rep,name=git_push_options,json=gitPushOptions,proto3" json:"git_push_options,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -197,6 +198,13 @@ func (m *PostReceiveHookRequest) GetStdin() []byte { return nil } +func (m *PostReceiveHookRequest) GetGitPushOptions() []string { + if m != nil { + return m.GitPushOptions + } + return nil +} + 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"` @@ -390,35 +398,37 @@ func init() { func init() { proto.RegisterFile("hook.proto", fileDescriptor_3eef30da1c11ee1b) } var fileDescriptor_3eef30da1c11ee1b = []byte{ - // 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, 0x2b, 0x38, 0x70, 0xa0, 0x4a, 0xeb, 0xa1, - 0x6b, 0x35, 0x74, 0x82, 0xed, 0x76, 0x37, 0x07, 0x78, 0x0a, 0x24, 0xee, 0x1c, 0x79, 0x44, 0x4e, - 0x28, 0x76, 0x36, 0x1b, 0xb6, 0xd9, 0xe3, 0xf6, 0xe6, 0x99, 0x9f, 0x3d, 0xdf, 0x7c, 0xa3, 0x49, - 0x00, 0xce, 0x89, 0x36, 0xe3, 0x54, 0x93, 0x25, 0xde, 0x5e, 0x2b, 0x1b, 0x27, 0x59, 0xd0, 0x37, - 0xe7, 0xb1, 0x46, 0xe9, 0xb3, 0xe1, 0x4f, 0x06, 0x27, 0x73, 0x8d, 0x02, 0x57, 0xa8, 0xf6, 0xf8, - 0x8e, 0x68, 0x23, 0xf0, 0xdb, 0x0e, 0x8d, 0xe5, 0x33, 0x00, 0x8d, 0x29, 0x19, 0x65, 0x49, 0x67, - 0x43, 0x36, 0x62, 0x51, 0x6f, 0xc6, 0xc7, 0xbe, 0xc8, 0x58, 0x94, 0x44, 0x54, 0x6e, 0xf1, 0x13, - 0x68, 0x6f, 0x30, 0x5b, 0x28, 0x39, 0x6c, 0x8c, 0x58, 0xd4, 0x15, 0xad, 0x0d, 0x66, 0xef, 0x25, - 0x0f, 0xa0, 0xe3, 0xd4, 0x56, 0x94, 0x0c, 0x9b, 0x0e, 0x94, 0x31, 0x7f, 0x0c, 0x2d, 0x63, 0xa5, - 0xda, 0x0e, 0xef, 0x8d, 0x58, 0xd4, 0x17, 0x3e, 0x08, 0xbf, 0xc3, 0xe0, 0x66, 0x57, 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, 0x80, 0xeb, 0x69, 0xf2, 0xa7, 0x57, 0xaf, 0x0f, 0xb6, 0x21, 0x08, 0xea, - 0xd0, 0x41, 0xcd, 0x29, 0x7b, 0x33, 0xfd, 0x94, 0xdf, 0x4c, 0xe2, 0xe5, 0x78, 0x45, 0x5f, 0x27, - 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, + // 467 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x94, 0x4f, 0x6f, 0xd3, 0x4c, + 0x10, 0xc6, 0xb5, 0x49, 0x13, 0xc5, 0x93, 0xa8, 0x6f, 0xdf, 0x15, 0x0d, 0xc6, 0x08, 0x88, 0x7c, + 0xf2, 0x85, 0x24, 0xa4, 0xdf, 0x00, 0x09, 0x09, 0x4e, 0x44, 0x5b, 0xc1, 0x81, 0x03, 0x96, 0x13, + 0x0f, 0xce, 0x2a, 0xc6, 0x63, 0x76, 0xd7, 0x69, 0x7d, 0x80, 0x4f, 0x81, 0xc4, 0x1d, 0x6e, 0x7c, + 0x44, 0x4e, 0xc8, 0x6b, 0x37, 0x0d, 0x4d, 0x7a, 0x6c, 0x6f, 0x3b, 0xf3, 0xdb, 0x9d, 0x3f, 0x8f, + 0x1e, 0x1b, 0x60, 0x45, 0xb4, 0x1e, 0xe7, 0x8a, 0x0c, 0xf1, 0x6e, 0x22, 0x4d, 0x94, 0x96, 0xde, + 0x40, 0xaf, 0x22, 0x85, 0x71, 0x9d, 0xf5, 0xbf, 0x33, 0x38, 0x9d, 0x2b, 0x14, 0xb8, 0x44, 0xb9, + 0xc1, 0xd7, 0x44, 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 0x57, 0x02, 0x9d, 0x40, 0x5b, 0xe1, + 0xa7, 0x46, 0x9e, 0xea, 0xc8, 0x1f, 0x83, 0x43, 0x69, 0x1c, 0x6e, 0xa2, 0xb4, 0x40, 0xeb, 0x18, + 0x47, 0xf4, 0x28, 0x8d, 0xdf, 0x57, 0x71, 0x05, 0x33, 0xbc, 0x68, 0x60, 0xa7, 0x86, 0x19, 0x5e, + 0x58, 0xe8, 0x97, 0xc0, 0x77, 0x67, 0xbd, 0x47, 0x9d, 0x66, 0x3f, 0x5b, 0xd0, 0xaf, 0xba, 0x9e, + 0xa3, 0xda, 0xc8, 0x25, 0xf2, 0x8f, 0x70, 0xfc, 0xaf, 0xb9, 0xf9, 0x93, 0xab, 0x0a, 0x07, 0x3f, + 0x45, 0xef, 0xe9, 0x6d, 0xb8, 0xde, 0xc2, 0x77, 0xfe, 0xfc, 0x08, 0x3a, 0xbd, 0x96, 0xc7, 0x5e, + 0x04, 0x6c, 0xca, 0x78, 0x04, 0xff, 0xdd, 0xf0, 0x05, 0xbf, 0xae, 0x70, 0xd0, 0xd5, 0xde, 0xb3, + 0x5b, 0xf9, 0xe1, 0x16, 0x73, 0x80, 0x6b, 0x35, 0xf9, 0xa3, 0xab, 0xd7, 0x7b, 0x6e, 0xf0, 0xbc, + 0x43, 0x68, 0xaf, 0xe6, 0x94, 0xbd, 0x9c, 0x7e, 0xa8, 0x6e, 0xa6, 0xd1, 0x62, 0xbc, 0xa4, 0xcf, + 0x93, 0xfa, 0xf8, 0x9c, 0x54, 0x32, 0xa9, 0xdf, 0x4f, 0xec, 0x0f, 0x63, 0x92, 0x50, 0x13, 0xe7, + 0x8b, 0x45, 0xd7, 0xa6, 0xce, 0xfe, 0x06, 0x00, 0x00, 0xff, 0xff, 0x75, 0x25, 0x33, 0xf6, 0xe5, + 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 194036689..1c78842e7 100644 --- a/proto/hook.proto +++ b/proto/hook.proto @@ -44,6 +44,7 @@ message PostReceiveHookRequest { Repository repository = 1; string key_id = 2; bytes stdin = 3; + repeated string git_push_options = 4; } message PostReceiveHookResponse{ diff --git a/ruby/proto/gitaly/hook_pb.rb b/ruby/proto/gitaly/hook_pb.rb index 3f0b91b89..a20dddf5e 100644 --- a/ruby/proto/gitaly/hook_pb.rb +++ b/ruby/proto/gitaly/hook_pb.rb @@ -20,6 +20,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do optional :repository, :message, 1, "gitaly.Repository" optional :key_id, :string, 2 optional :stdin, :bytes, 3 + repeated :git_push_options, :string, 4 end add_message "gitaly.PostReceiveHookResponse" do optional :stdout, :bytes, 1 |