diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2019-02-12 18:41:32 +0000 |
---|---|---|
committer | GitLab Release Tools Bot <robert+release-tools@gitlab.com> | 2019-02-13 16:49:32 +0000 |
commit | 1e5acff8ca4ed0d2b24ae6e0cf85bd0d1506f406 (patch) | |
tree | 45f7ac0173a00083e024a225eadc9889db99d44c | |
parent | f015a063eb332d360b852eebaa6c4c5873dc8b44 (diff) | |
download | gitlab-ce-1e5acff8ca4ed0d2b24ae6e0cf85bd0d1506f406.tar.gz |
Merge branch '57426-review-apps-some-merge-related-tests-fail-in-review-qa-jobs-but-not-in-package-and-qa' into 'master'
Fix a Ruby 2.4 incompatibility in Ci::CreatePipelineService
Closes #57426
See merge request gitlab-org/gitlab-ce!25168
(cherry picked from commit d663c9269e4c2e14be071eb2bc8c2fee81160d86)
55e488d6 Fix a Ruby 2.4 incompatibility in Ci::CreatePipelineService
-rw-r--r-- | app/services/ci/create_pipeline_service.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/services/ci/create_pipeline_service.rb b/app/services/ci/create_pipeline_service.rb index 699b3e8555e..354e53a367c 100644 --- a/app/services/ci/create_pipeline_service.rb +++ b/app/services/ci/create_pipeline_service.rb @@ -36,7 +36,7 @@ module Ci project: project, current_user: current_user, push_options: params[:push_options], - **extra_options(**options)) + **extra_options(options)) sequence = Gitlab::Ci::Pipeline::Chain::Sequence .new(pipeline, command, SEQUENCE) @@ -108,7 +108,12 @@ module Ci end # rubocop: enable CodeReuse/ActiveRecord - def extra_options + def extra_options(options = {}) + # In Ruby 2.4, even when options is empty, f(**options) doesn't work when f + # doesn't have any parameters. We reproduce the Ruby 2.5 behavior by + # checking explicitely that no arguments are given. + raise ArgumentError if options.any? + {} # overriden in EE end end |