Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-08-31 15:02:52 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-08-31 15:02:52 +0300
commit92673c2c63c5928279fdb1985357fa8596c97397 (patch)
tree9fad84a29dec0dac27eb49aa219d79095a36b481 /lib/gitlab/ci
parent5623cb9a6eb0075306b1cecfd336c2b5ce997f19 (diff)
parentaacc611090c0ae1bdb703e675e9e3283d8609f70 (diff)
Merge branch 'master' into feature/gb/kubernetes-only-pipeline-jobs
* master: (275 commits) Decrease Metrics/PerceivedComplexity threshold to 17 Upgrade mail and nokogiri gems due to security issues Link out to stackoverflow answer on setting swappiness Document swappiness recomendations in the requirements doc Fix invalid attribute used for time-ago-tooltip component Update latest artifacts doc Add changelog entry for flipping verify_certificates Default LDAP config verify_certificates to true Update share project with groups docs remove accidental console.log from karma tests update specs to match reorganized monitoring components Remove tooltips from new sidebar Use `git update-ref --stdin -z` to delete refs Don't use public_send in destroy_conditionally! helper Remove unused expressions policy from ci/cd config Simplify code for appending strategies in CI/CD config Raise exception when simplifiable ci entry incomplete Add changelog entry Fix MySQL failure for emoji autocomplete max-width for lazy-loaded images (this was removed in the original MR through merge resolution most probably) ... Conflicts: lib/gitlab/ci/config/entry/policy.rb
Diffstat (limited to 'lib/gitlab/ci')
-rw-r--r--lib/gitlab/ci/config/entry/simplifiable.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/gitlab/ci/config/entry/simplifiable.rb b/lib/gitlab/ci/config/entry/simplifiable.rb
index c26576fcbcd..12764629686 100644
--- a/lib/gitlab/ci/config/entry/simplifiable.rb
+++ b/lib/gitlab/ci/config/entry/simplifiable.rb
@@ -6,6 +6,10 @@ module Gitlab
EntryStrategy = Struct.new(:name, :condition)
def initialize(config, **metadata)
+ unless self.class.const_defined?(:UnknownStrategy)
+ raise ArgumentError, 'UndefinedStrategy not available!'
+ end
+
strategy = self.class.strategies.find do |variant|
variant.condition.call(config)
end
@@ -17,12 +21,12 @@ module Gitlab
def self.strategy(name, **opts)
EntryStrategy.new(name, opts.fetch(:if)).tap do |strategy|
- (@strategies ||= []).append(strategy)
+ strategies.append(strategy)
end
end
def self.strategies
- @strategies.to_a
+ @strategies ||= []
end
def self.entry_class(strategy)