diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-07-30 17:31:02 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-08-01 13:25:19 +0300 |
commit | 8ce03988b9a29d34016052be2dd8641fa7b9efbe (patch) | |
tree | 73567fbf41c8c1475d85adcd292066bc709a542e /app/models/ci | |
parent | c0abcc68decea2eeb91cd7a15b605562b6c81c25 (diff) |
Fix current spec failures
Diffstat (limited to 'app/models/ci')
-rw-r--r-- | app/models/ci/build.rb | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 9f0e156471f..91a4bc8d2f8 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -8,8 +8,6 @@ module Ci include Importable include Gitlab::Utils::StrongMemoize - MissingDependenciesError = Class.new(StandardError) - belongs_to :project, inverse_of: :builds belongs_to :runner belongs_to :trigger_request @@ -581,15 +579,13 @@ module Ci options[:dependencies]&.empty? end - def valid_build_dependencies? - return unless Feature.enabled?('ci_disable_validates_dependencies') + def has_valid_build_dependencies? + return true unless Feature.enabled?('ci_disable_validates_dependencies') - dependencies.each do |dependency| - raise MissingDependenciesError unless dependency.valid_dependency? - end + dependencies.all?(&:is_valid_dependency?) end - def valid_dependency? + def is_valid_dependency? return false if artifacts_expired? return false if erased? |