diff options
author | Shinya Maeda <shinya@gitlab.com> | 2017-09-03 23:35:37 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2017-12-06 15:53:59 +0900 |
commit | 67c7e0fc5d50e2c8fc7aa773b98d32922132be47 (patch) | |
tree | cf7c88cad9f600eb7c597cac477b2f9b2d6dfafa /app/models/ci | |
parent | f92292815868a67db53059cbe8e7607cc4891f47 (diff) | |
download | gitlab-ce-67c7e0fc5d50e2c8fc7aa773b98d32922132be47.tar.gz |
Fail jobs if its dependency is missing
Diffstat (limited to 'app/models/ci')
-rw-r--r-- | app/models/ci/build.rb | 6 |
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) |