summaryrefslogtreecommitdiff
path: root/app/models/ci
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2017-09-03 23:35:37 +0900
committerShinya Maeda <shinya@gitlab.com>2017-12-06 15:53:59 +0900
commit67c7e0fc5d50e2c8fc7aa773b98d32922132be47 (patch)
treecf7c88cad9f600eb7c597cac477b2f9b2d6dfafa /app/models/ci
parentf92292815868a67db53059cbe8e7607cc4891f47 (diff)
downloadgitlab-ce-67c7e0fc5d50e2c8fc7aa773b98d32922132be47.tar.gz
Fail jobs if its dependency is missing
Diffstat (limited to 'app/models/ci')
-rw-r--r--app/models/ci/build.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index d2402b55184..119c6fd7b45 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -139,6 +139,12 @@ module Ci
Ci::Build.retry(build, build.user)
end
end
+
+ before_transition any => [:running] do |build|
+ if !build.empty_dependencies? && build.dependencies.empty?
+ raise Gitlab::Ci::Error::MissingDependencies
+ end
+ end
end
def detailed_status(current_user)