diff options
author | Luke Duncalfe <lduncalfe@eml.cc> | 2019-04-05 17:19:30 +1300 |
---|---|---|
committer | Luke Duncalfe <lduncalfe@eml.cc> | 2019-04-09 10:03:26 +1200 |
commit | 1883e320eafa02b332a16eec658f65c4a28def83 (patch) | |
tree | 6e231cba20ae8fda69f328e0ede27452fca9cf14 /app | |
parent | 867ac4d1f733254de1b4c44f314e585e6b2720e8 (diff) | |
download | gitlab-ce-1883e320eafa02b332a16eec658f65c4a28def83.tar.gz |
Use Gitlab::PushOptions for `ci.skip` push option
Previously the raw push option Array was sent to Pipeline::Chain::Skip.
This commit updates this class (and the chain of classes that pass the
push option parameters from the API internal `post_receive` endpoint to
that class) to treat push options as a Hash of options parsed by
GitLab::PushOptions.
The GitLab::PushOptions class takes options like this:
-o ci.skip -o merge_request.create -o merge_request.target=branch
and turns them into a Hash like this:
{
ci: {
skip: true
},
merge_request: {
create: true,
target: 'branch'
}
}
This now how Pipeline::Chain::Skip is determining if the `ci.skip` push
option was used.
Diffstat (limited to 'app')
-rw-r--r-- | app/services/ci/create_pipeline_service.rb | 2 | ||||
-rw-r--r-- | app/services/git/base_hooks_service.rb | 2 | ||||
-rw-r--r-- | app/workers/post_receive.rb | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/app/services/ci/create_pipeline_service.rb b/app/services/ci/create_pipeline_service.rb index 8973c5ffc9e..41dee4e5641 100644 --- a/app/services/ci/create_pipeline_service.rb +++ b/app/services/ci/create_pipeline_service.rb @@ -37,7 +37,7 @@ module Ci variables_attributes: params[:variables_attributes], project: project, current_user: current_user, - push_options: params[:push_options], + push_options: params[:push_options] || {}, chat_data: params[:chat_data], **extra_options(options)) diff --git a/app/services/git/base_hooks_service.rb b/app/services/git/base_hooks_service.rb index e0dccb8716a..fce4040e390 100644 --- a/app/services/git/base_hooks_service.rb +++ b/app/services/git/base_hooks_service.rb @@ -79,7 +79,7 @@ module Git limited_commits, event_message, commits_count: commits_count, - push_options: params[:push_options] || [] + push_options: params[:push_options] || {} ) # Dependent code may modify the push data, so return a duplicate each time diff --git a/app/workers/post_receive.rb b/app/workers/post_receive.rb index 396f44396a3..a5554f07699 100644 --- a/app/workers/post_receive.rb +++ b/app/workers/post_receive.rb @@ -3,7 +3,7 @@ class PostReceive include ApplicationWorker - def perform(gl_repository, identifier, changes, push_options = []) + def perform(gl_repository, identifier, changes, push_options = {}) project, repo_type = Gitlab::GlRepository.parse(gl_repository) if project.nil? |