diff options
author | Jacob Vosmaer <jacob@gitlab.com> | 2020-01-16 20:46:00 +0300 |
---|---|---|
committer | Jacob Vosmaer <jacob@gitlab.com> | 2020-01-16 20:46:00 +0300 |
commit | 451b3d559e0b4969fbbe4784fdc1fc68082c4dea (patch) | |
tree | 376f08b11fc0d54935b75ff4caf3d6715a490d7e | |
parent | b9b01d4ca58c023e609de1f04efb868daadc2e63 (diff) | |
parent | 961f217f4d4add232096dcea3b649953a84a61de (diff) |
Merge branch 'pass-through-skip-ci-flag' into 'master'
Allow git_push_options to be passed to UserRebaseConfirmable RPC
See merge request gitlab-org/gitaly!1748
-rw-r--r-- | changelogs/unreleased/pass-through-skip-ci-flag.yml | 5 | ||||
-rw-r--r-- | internal/service/operations/rebase_test.go | 16 | ||||
-rw-r--r-- | proto/go/gitalypb/operations.pb.go | 276 | ||||
-rw-r--r-- | proto/operations.proto | 1 | ||||
-rw-r--r-- | ruby/lib/gitaly_server/operations_service.rb | 3 | ||||
-rw-r--r-- | ruby/lib/gitlab/git/hook.rb | 7 | ||||
-rw-r--r-- | ruby/lib/gitlab/git/hooks_service.rb | 11 | ||||
-rw-r--r-- | ruby/lib/gitlab/git/operation_service.rb | 14 | ||||
-rw-r--r-- | ruby/lib/gitlab/git/push_options.rb | 27 | ||||
-rw-r--r-- | ruby/lib/gitlab/git/repository.rb | 8 | ||||
-rw-r--r-- | ruby/proto/gitaly/operations_pb.rb | 1 | ||||
-rw-r--r-- | ruby/spec/lib/gitlab/git/hook_spec.rb | 52 | ||||
-rw-r--r-- | ruby/spec/lib/gitlab/git/push_options_spec.rb | 32 |
13 files changed, 296 insertions, 157 deletions
diff --git a/changelogs/unreleased/pass-through-skip-ci-flag.yml b/changelogs/unreleased/pass-through-skip-ci-flag.yml new file mode 100644 index 000000000..d63a86992 --- /dev/null +++ b/changelogs/unreleased/pass-through-skip-ci-flag.yml @@ -0,0 +1,5 @@ +--- +title: Allow git_push_options to be passed to UserRebaseConfirmable RPC +merge_request: 1748 +author: +type: added diff --git a/internal/service/operations/rebase_test.go b/internal/service/operations/rebase_test.go index ad8c3295e..b98dca223 100644 --- a/internal/service/operations/rebase_test.go +++ b/internal/service/operations/rebase_test.go @@ -5,6 +5,7 @@ package operations_test import ( "errors" "fmt" + "os" "strings" "testing" "time" @@ -29,6 +30,8 @@ var ( ) func TestSuccessfulUserRebaseConfirmableRequest(t *testing.T) { + pushOptions := []string{"ci.skip", "test=value"} + ctxOuter, cancel := testhelper.Context() defer cancel() @@ -52,7 +55,13 @@ func TestSuccessfulUserRebaseConfirmableRequest(t *testing.T) { rebaseStream, err := client.UserRebaseConfirmable(ctx) require.NoError(t, err) + preReceiveHookOutputPath := operations.WriteEnvToHook(t, testRepoPath, "pre-receive") + postReceiveHookOutputPath := operations.WriteEnvToHook(t, testRepoPath, "post-receive") + defer os.Remove(preReceiveHookOutputPath) + defer os.Remove(postReceiveHookOutputPath) + headerRequest := buildHeaderRequest(testRepo, rebaseUser, "1", branchName, branchSha, testRepoCopy, "master") + headerRequest.GetHeader().GitPushOptions = pushOptions require.NoError(t, rebaseStream.Send(headerRequest), "send header") firstResponse, err := rebaseStream.Recv() @@ -79,6 +88,13 @@ func TestSuccessfulUserRebaseConfirmableRequest(t *testing.T) { require.Equal(t, newBranchSha, firstResponse.GetRebaseSha()) require.True(t, secondResponse.GetRebaseApplied(), "the second rebase is applied") + + for _, outputPath := range []string{preReceiveHookOutputPath, postReceiveHookOutputPath} { + output := string(testhelper.MustReadFile(t, outputPath)) + require.Contains(t, output, "GIT_PUSH_OPTION_COUNT=2") + require.Contains(t, output, "GIT_PUSH_OPTION_0=ci.skip") + require.Contains(t, output, "GIT_PUSH_OPTION_1=test=value") + } } func TestFailedRebaseUserRebaseConfirmableRequestDueToInvalidHeader(t *testing.T) { diff --git a/proto/go/gitalypb/operations.pb.go b/proto/go/gitalypb/operations.pb.go index ac358ee14..886d071c1 100644 --- a/proto/go/gitalypb/operations.pb.go +++ b/proto/go/gitalypb/operations.pb.go @@ -2063,6 +2063,7 @@ type UserRebaseConfirmableRequest_Header struct { BranchSha string `protobuf:"bytes,5,opt,name=branch_sha,json=branchSha,proto3" json:"branch_sha,omitempty"` RemoteRepository *Repository `protobuf:"bytes,6,opt,name=remote_repository,json=remoteRepository,proto3" json:"remote_repository,omitempty"` RemoteBranch []byte `protobuf:"bytes,7,opt,name=remote_branch,json=remoteBranch,proto3" json:"remote_branch,omitempty"` + GitPushOptions []string `protobuf:"bytes,8,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:"-"` @@ -2142,6 +2143,13 @@ func (m *UserRebaseConfirmableRequest_Header) GetRemoteBranch() []byte { return nil } +func (m *UserRebaseConfirmableRequest_Header) GetGitPushOptions() []string { + if m != nil { + return m.GitPushOptions + } + return nil +} + type UserRebaseConfirmableResponse struct { // Types that are valid to be assigned to UserRebaseConfirmableResponsePayload: // *UserRebaseConfirmableResponse_RebaseSha @@ -2737,141 +2745,143 @@ func init() { func init() { proto.RegisterFile("operations.proto", fileDescriptor_1b4a5877375e491e) } var fileDescriptor_1b4a5877375e491e = []byte{ - // 2139 bytes of a gzipped FileDescriptorProto + // 2168 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x5a, 0xcd, 0x6f, 0x23, 0x49, 0x15, 0x4f, 0xdb, 0x8e, 0xe3, 0xbc, 0x38, 0x89, 0x53, 0xb3, 0x3b, 0xeb, 0xf5, 0x4c, 0x98, 0x6c, - 0x67, 0x86, 0xc9, 0x0c, 0xe0, 0xf9, 0x60, 0x05, 0x12, 0xd2, 0x82, 0x26, 0x8e, 0x43, 0x66, 0xb5, - 0xf9, 0xa0, 0xe3, 0x01, 0xb1, 0x42, 0x34, 0x1d, 0xbb, 0x6c, 0xb7, 0xb0, 0xdd, 0xde, 0xea, 0x76, - 0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 0xfe, 0x34, - 0xbf, 0x8b, 0x88, 0x44, 0x6c, 0x21, 0x44, 0xd6, 0x21, 0x1b, 0x38, 0x1d, 0xb2, 0x62, 0x29, 0xdc, - 0x5c, 0x72, 0x48, 0xba, 0x4c, 0x07, 0xfe, 0xdc, 0xf5, 0x03, 0x5f, 0x69, 0x5d, 0xb0, 0xe8, 0x57, - 0x3a, 0x90, 0xd9, 0x74, 0x20, 0xff, 0x6a, 0xc0, 0x75, 0xb9, 0xf9, 0x3e, 0x17, 0x9d, 0x2b, 0x88, - 0xf8, 0x10, 0xaf, 0xcc, 0x54, 0xbc, 0x6e, 0xc0, 0x62, 0xd3, 0xeb, 0xf7, 0xdd, 0xc0, 0x76, 0x5b, - 0xa4, 0x54, 0x01, 0x09, 0x4f, 0x5b, 0xd2, 0x22, 0xaa, 0x6f, 0x94, 0xf8, 0x54, 0xcf, 0xa6, 0x62, - 0xc7, 0x5e, 0x82, 0x79, 0x67, 0x38, 0xec, 0x9d, 0x95, 0xf3, 0x0a, 0x02, 0xfc, 0x61, 0xfe, 0x9a, - 0x12, 0x59, 0xb3, 0x8a, 0x40, 0xd5, 0x14, 0x30, 0x62, 0x0a, 0x6c, 0xc3, 0x32, 0x65, 0xec, 0x48, - 0x15, 0x13, 0x72, 0xfc, 0x7a, 0x68, 0xc8, 0x61, 0xd8, 0x77, 0x50, 0x28, 0x56, 0x1c, 0xab, 0x78, - 0x12, 0xf9, 0x95, 0x0e, 0x7f, 0x2e, 0x15, 0xfe, 0x37, 0x73, 0x85, 0x4c, 0x29, 0x6b, 0xbe, 0x9b, - 0xc1, 0x08, 0x50, 0xea, 0x36, 0x3c, 0x8b, 0xb7, 0x67, 0xeb, 0x83, 0x75, 0x00, 0xdf, 0x1b, 0x89, - 0x26, 0xb7, 0xfd, 0xae, 0x43, 0x4e, 0x58, 0x44, 0xca, 0x71, 0xd7, 0x99, 0xea, 0x85, 0x75, 0x80, - 0x71, 0xa8, 0xb7, 0xc9, 0x11, 0x8b, 0x61, 0x94, 0xb7, 0xa3, 0x4e, 0xca, 0xeb, 0x4e, 0xda, 0x82, - 0x52, 0xdb, 0x15, 0x7e, 0x60, 0x0f, 0x1d, 0xc1, 0x07, 0xf8, 0xf9, 0x02, 0x26, 0x89, 0xa2, 0x1f, - 0x29, 0xb2, 0xc5, 0xdb, 0xa6, 0x13, 0x89, 0x46, 0x02, 0xe2, 0x22, 0x6e, 0xbb, 0x4c, 0xbf, 0xfb, - 0x1e, 0xbc, 0x9c, 0xea, 0xc5, 0xf3, 0x77, 0x78, 0x0d, 0x8a, 0x12, 0x62, 0xbb, 0xa9, 0x92, 0xb4, - 0x45, 0x19, 0xb7, 0x24, 0x69, 0x98, 0xb7, 0x2d, 0x76, 0x07, 0x56, 0x28, 0x76, 0x42, 0xa6, 0xac, - 0x62, 0xa2, 0x88, 0x22, 0x36, 0xf3, 0xe7, 0x06, 0x5c, 0x93, 0x36, 0xee, 0xee, 0xbe, 0xa8, 0xe9, - 0x66, 0xfe, 0x90, 0xaa, 0xeb, 0x44, 0x45, 0x72, 0x42, 0x22, 0x3d, 0x8c, 0x2b, 0x4a, 0x8f, 0x29, - 0xbe, 0xfa, 0x03, 0x25, 0x46, 0xad, 0xcb, 0x85, 0x38, 0x3b, 0x72, 0x9b, 0xdf, 0x9e, 0x2d, 0x5a, - 0xf7, 0x20, 0x8f, 0xe0, 0x50, 0xde, 0xaf, 0x85, 0x3c, 0x5f, 0x76, 0x83, 0x9a, 0x5a, 0xb0, 0x88, - 0x21, 0xde, 0xdb, 0x73, 0x89, 0xde, 0x3e, 0xbd, 0x66, 0xdd, 0x87, 0x35, 0x1c, 0x01, 0xa3, 0x02, - 0x30, 0x65, 0x56, 0xd5, 0xc2, 0xf6, 0x44, 0xca, 0x1b, 0x50, 0x42, 0xde, 0x88, 0xb5, 0x0b, 0x53, - 0xad, 0xc5, 0xcf, 0x27, 0x04, 0xf3, 0x9f, 0x19, 0x4c, 0xa8, 0x28, 0x80, 0x57, 0xeb, 0x4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x4b, 0xe7, 0xae, 0x82, 0xf2, 0x58, + 0x73, 0xec, 0x89, 0x36, 0xaf, 0xce, 0xe3, 0xb1, 0x46, 0xfd, 0x90, 0x69, 0x84, 0x42, 0xe5, 0xd8, + 0x0e, 0x38, 0xcc, 0x29, 0xc2, 0x41, 0xcf, 0x31, 0x7f, 0x43, 0x27, 0xb9, 0xb4, 0xeb, 0xd8, 0x17, + 0x13, 0x41, 0x75, 0x7b, 0x4a, 0x50, 0x69, 0xae, 0x8e, 0x45, 0xd5, 0xe7, 0xc7, 0x65, 0x20, 0xa7, + 0x57, 0xdd, 0xec, 0xa0, 0x9c, 0x89, 0xf2, 0x7e, 0x63, 0x1d, 0x5e, 0x4b, 0x87, 0x9c, 0xc0, 0x5d, + 0xc6, 0x31, 0xf7, 0xcb, 0xe8, 0x92, 0x2e, 0xae, 0xc8, 0x25, 0x96, 0xfd, 0x5b, 0xb0, 0xe0, 0x0e, + 0x3b, 0xfc, 0xb9, 0x56, 0xf0, 0x41, 0x91, 0xce, 0x28, 0xe4, 0x53, 0xce, 0xcb, 0xbf, 0x18, 0xf7, + 0x76, 0x59, 0x78, 0xae, 0x7c, 0x76, 0x17, 0x6a, 0x9b, 0xd8, 0xec, 0x8e, 0x84, 0x33, 0x8e, 0xca, + 0xab, 0x40, 0x79, 0xa3, 0x82, 0x64, 0x16, 0xcf, 0x76, 0x48, 0x91, 0x67, 0xbb, 0x2f, 0xc1, 0x8a, + 0xe0, 0x03, 0x2f, 0xe4, 0xf1, 0xc0, 0x2c, 0x4e, 0x55, 0xb8, 0x82, 0xcc, 0xb1, 0xc8, 0x5c, 0x87, + 0x45, 0x12, 0x40, 0xdb, 0x63, 0x02, 0x94, 0x91, 0x88, 0x6e, 0xf8, 0x42, 0xae, 0x6a, 0x98, 0xdf, + 0x37, 0xa2, 0x46, 0x8e, 0x48, 0x8d, 0xef, 0x34, 0x80, 0x8c, 0x92, 0xfa, 0xe1, 0x31, 0x8b, 0xcc, + 0x94, 0xfa, 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0xa8, 0xa8, 0x48, 0x9f, 0xfd, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x4a, 0xa4, 0xe2, 0x74, 0xf2, 0x23, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/proto/operations.proto b/proto/operations.proto index 7504efe4b..b2d2d24e5 100644 --- a/proto/operations.proto +++ b/proto/operations.proto @@ -366,6 +366,7 @@ message UserRebaseConfirmableRequest { string branch_sha = 5; Repository remote_repository = 6; bytes remote_branch = 7; + repeated string git_push_options = 8; } oneof user_rebase_confirmable_request_payload { diff --git a/ruby/lib/gitaly_server/operations_service.rb b/ruby/lib/gitaly_server/operations_service.rb index 3079dda49..0d3cb43cd 100644 --- a/ruby/lib/gitaly_server/operations_service.rb +++ b/ruby/lib/gitaly_server/operations_service.rb @@ -222,7 +222,8 @@ module GitalyServer branch: header.branch, branch_sha: header.branch_sha, remote_repository: remote_repository, - remote_branch: header.remote_branch + remote_branch: header.remote_branch, + push_options: Gitlab::Git::PushOptions.new(header.git_push_options) ) do |rebase_sha| y << Gitaly::UserRebaseConfirmableResponse.new(rebase_sha: rebase_sha) diff --git a/ruby/lib/gitlab/git/hook.rb b/ruby/lib/gitlab/git/hook.rb index 61af0999a..7a5e15871 100644 --- a/ruby/lib/gitlab/git/hook.rb +++ b/ruby/lib/gitlab/git/hook.rb @@ -28,13 +28,13 @@ module Gitlab File.exist?(path) end - def trigger(gl_id, gl_username, oldrev, newrev, ref) + def trigger(gl_id, gl_username, oldrev, newrev, ref, push_options: nil) return [true, nil] unless exists? Bundler.with_clean_env do case name when "pre-receive", "post-receive" - call_receive_hook(gl_id, gl_username, oldrev, newrev, ref) + call_receive_hook(gl_id, gl_username, oldrev, newrev, ref, push_options) when "update" call_update_hook(gl_id, gl_username, oldrev, newrev, ref) end @@ -43,13 +43,14 @@ module Gitlab private - def call_receive_hook(gl_id, gl_username, oldrev, newrev, ref) + def call_receive_hook(gl_id, gl_username, oldrev, newrev, ref, push_options) changes = [oldrev, newrev, ref].join(" ") exit_status = false exit_message = nil vars = env_base_vars(gl_id, gl_username) + vars.merge!(push_options.env_data) if push_options options = { chdir: repo_path diff --git a/ruby/lib/gitlab/git/hooks_service.rb b/ruby/lib/gitlab/git/hooks_service.rb index d6a08a79c..30501d388 100644 --- a/ruby/lib/gitlab/git/hooks_service.rb +++ b/ruby/lib/gitlab/git/hooks_service.rb @@ -3,22 +3,25 @@ module Gitlab class HooksService attr_accessor :oldrev, :newrev, :ref - def execute(pusher, repository, oldrev, newrev, ref) + def execute(pusher, repository, oldrev, newrev, ref, push_options:) @repository = repository @gl_id = pusher.gl_id @gl_username = pusher.username @oldrev = oldrev @newrev = newrev @ref = ref + @push_options = push_options - %w(pre-receive update).each do |hook_name| + %w[pre-receive update].each do |hook_name| status, message = run_hook(hook_name) raise PreReceiveError, message unless status end yield(self).tap do - run_hook('post-receive') + status, message = run_hook('post-receive') + + Gitlab::GitLogger.error("post-receive hook: #{message}") unless status end end @@ -26,7 +29,7 @@ module Gitlab def run_hook(name) hook = Gitlab::Git::Hook.new(name, @repository) - hook.trigger(@gl_id, @gl_username, oldrev, newrev, ref) + hook.trigger(@gl_id, @gl_username, oldrev, newrev, ref, push_options: @push_options) end end end diff --git a/ruby/lib/gitlab/git/operation_service.rb b/ruby/lib/gitlab/git/operation_service.rb index 1235a1c01..8c62a13b7 100644 --- a/ruby/lib/gitlab/git/operation_service.rb +++ b/ruby/lib/gitlab/git/operation_service.rb @@ -96,9 +96,9 @@ module Gitlab end end - def update_branch(branch_name, newrev, oldrev) + def update_branch(branch_name, newrev, oldrev, push_options: nil) ref = Gitlab::Git::BRANCH_REF_PREFIX + branch_name - update_ref_in_hooks(ref, newrev, oldrev) + update_ref_in_hooks(ref, newrev, oldrev, push_options: push_options) end # Yields the given block (which should return a commit) and @@ -172,21 +172,21 @@ module Gitlab end end - def update_ref_in_hooks(ref, newrev, oldrev) - with_hooks(ref, newrev, oldrev) do + def update_ref_in_hooks(ref, newrev, oldrev, push_options: nil) + with_hooks(ref, newrev, oldrev, push_options: push_options) do update_ref(ref, newrev, oldrev) end end - def with_hooks(ref, newrev, oldrev) + def with_hooks(ref, newrev, oldrev, push_options: nil) Gitlab::Git::HooksService.new.execute( user, repository, oldrev, newrev, - ref + ref, + push_options: push_options ) do |service| - yield(service) end end diff --git a/ruby/lib/gitlab/git/push_options.rb b/ruby/lib/gitlab/git/push_options.rb new file mode 100644 index 000000000..f758529f7 --- /dev/null +++ b/ruby/lib/gitlab/git/push_options.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Gitlab + module Git + class PushOptions + attr_accessor :options + + def initialize(options = []) + @options = options + end + + def env_data + return {} if options.empty? + + data = { + 'GIT_PUSH_OPTION_COUNT' => options.count.to_s + } + + options.each_with_index do |opt, index| + data["GIT_PUSH_OPTION_#{index}"] = opt + end + + data + end + end + end +end diff --git a/ruby/lib/gitlab/git/repository.rb b/ruby/lib/gitlab/git/repository.rb index c3d3ab3a2..2566ce4df 100644 --- a/ruby/lib/gitlab/git/repository.rb +++ b/ruby/lib/gitlab/git/repository.rb @@ -242,8 +242,8 @@ module Gitlab raise TagExistsError end - def update_branch(branch_name, user:, newrev:, oldrev:) - OperationService.new(user, self).update_branch(branch_name, newrev, oldrev) + def update_branch(branch_name, user:, newrev:, oldrev:, push_options: nil) + OperationService.new(user, self).update_branch(branch_name, newrev, oldrev, push_options: push_options) end def rm_branch(branch_name, user:) @@ -347,7 +347,7 @@ module Gitlab rugged.diff(sha1, sha2).size.positive? end - def rebase(user, rebase_id, branch:, branch_sha:, remote_repository:, remote_branch:) + def rebase(user, rebase_id, branch:, branch_sha:, remote_repository:, remote_branch:, push_options: nil) worktree = Gitlab::Git::Worktree.new(path, REBASE_WORKTREE_PREFIX, rebase_id) env = git_env.merge(user.git_env) @@ -377,7 +377,7 @@ module Gitlab yield rebase_sha if block_given? - update_branch(branch, user: user, newrev: rebase_sha, oldrev: branch_sha) + update_branch(branch, user: user, newrev: rebase_sha, oldrev: branch_sha, push_options: push_options) rebase_sha end diff --git a/ruby/proto/gitaly/operations_pb.rb b/ruby/proto/gitaly/operations_pb.rb index 7383511f5..537adf5ad 100644 --- a/ruby/proto/gitaly/operations_pb.rb +++ b/ruby/proto/gitaly/operations_pb.rb @@ -209,6 +209,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do optional :branch_sha, :string, 5 optional :remote_repository, :message, 6, "gitaly.Repository" optional :remote_branch, :bytes, 7 + repeated :git_push_options, :string, 8 end add_message "gitaly.UserRebaseConfirmableResponse" do optional :pre_receive_error, :string, 3 diff --git a/ruby/spec/lib/gitlab/git/hook_spec.rb b/ruby/spec/lib/gitlab/git/hook_spec.rb index dd0fab005..6ebb1e9bf 100644 --- a/ruby/spec/lib/gitlab/git/hook_spec.rb +++ b/ruby/spec/lib/gitlab/git/hook_spec.rb @@ -13,6 +13,13 @@ describe Gitlab::Git::Hook do let(:tmp_dir) { Dir.mktmpdir } let(:hook_names) { %w[pre-receive post-receive update] } let(:repo) { gitlab_git_from_gitaly(test_repo_read_only) } + let(:push_options) do + Gitlab::Git::PushOptions.new(['ci.skip']) + end + + def trigger_with_stub_data(hook, push_options) + hook.trigger('user-1', 'admin', '0' * 40, 'a' * 40, 'master', push_options: push_options) + end before do hook_names.each do |f| @@ -60,7 +67,7 @@ describe Gitlab::Git::Hook do it 'returns true' do hook_names.each do |hook| trigger_result = described_class.new(hook, repo) - .trigger(vars['GL_ID'], vars['GL_USERNAME'], '0' * 40, 'a' * 40, 'master') + .trigger(vars['GL_ID'], vars['GL_USERNAME'], '0' * 40, 'a' * 40, 'master', push_options: push_options) expect(trigger_result.first).to be(true), "#{hook} failed: #{trigger_result.last}" end @@ -73,7 +80,7 @@ describe Gitlab::Git::Hook do it 'returns true' do hook_names.each do |hook| trigger_result = described_class.new(hook, repo) - .trigger('user-456', 'admin', '0' * 40, 'a' * 40, 'master') + .trigger('user-456', 'admin', '0' * 40, 'a' * 40, 'master', push_options: push_options) expect(trigger_result.first).to be(true) end @@ -84,9 +91,44 @@ describe Gitlab::Git::Hook do let(:script) { "#!/bin/sh\nexit 1\n" } it 'returns false' do - hook_names.each do |hook| - trigger_result = described_class.new(hook, repo) - .trigger('user-1', 'admin', '0' * 40, 'a' * 40, 'master') + hook_names.each do |name| + hook = described_class.new(name, repo) + trigger_result = trigger_with_stub_data(hook, push_options) + + expect(trigger_result.first).to be(false) + end + end + end + + context 'when push options are passed' do + let(:script) do + <<~HOOK + #!/usr/bin/env ruby + unless ENV['GIT_PUSH_OPTION_COUNT'] == '1' && ENV['GIT_PUSH_OPTION_0'] == 'ci.skip' + abort 'missing GIT_PUSH_OPTION env vars' + end + HOOK + end + + context 'for pre-receive and post-receive hooks' do + let(:hooks) do + %w[pre-receive post-receive].map { |name| described_class.new(name, repo) } + end + + it 'sets the push options environment variables' do + hooks.each do |hook| + trigger_result = trigger_with_stub_data(hook, push_options) + + expect(trigger_result.first).to be(true) + end + end + end + + context 'for update hook' do + let(:hook) { described_class.new('update', repo) } + + it 'does not set the push options environment variables' do + trigger_result = trigger_with_stub_data(hook, push_options) expect(trigger_result.first).to be(false) end diff --git a/ruby/spec/lib/gitlab/git/push_options_spec.rb b/ruby/spec/lib/gitlab/git/push_options_spec.rb new file mode 100644 index 000000000..d2c74f399 --- /dev/null +++ b/ruby/spec/lib/gitlab/git/push_options_spec.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe Gitlab::Git::PushOptions do + subject { described_class.new(options) } + + describe '#env_data' do + context 'when push options are set' do + let(:options) { ['ci.skip', 'test=value'] } + + it 'sets GIT_PUSH_OPTION environment variables' do + env_data = subject.env_data + + expect(env_data.count).to eq(3) + expect(env_data['GIT_PUSH_OPTION_COUNT']).to eq('2') + expect(env_data['GIT_PUSH_OPTION_0']).to eq('ci.skip') + expect(env_data['GIT_PUSH_OPTION_1']).to eq('test=value') + end + end + + context 'when push options are not set' do + let(:options) { [] } + + it 'does not set any variable' do + env_data = subject.env_data + + expect(env_data).to eq({}) + end + end + end +end |