diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-10-05 14:15:15 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-10-05 14:15:15 +0200 |
commit | 0367dbf04392a200b5a2e0fcbab6269ff283fa54 (patch) | |
tree | 9c0df482583bde7fc5c56096fc151819fe6aa096 /app/models/ci/commit.rb | |
parent | 5064c9038c1ae2fa6c48bc46c58f49c72ff1963a (diff) | |
download | gitlab-ce-0367dbf04392a200b5a2e0fcbab6269ff283fa54.tar.gz |
Fix build pipelining
Diffstat (limited to 'app/models/ci/commit.rb')
-rw-r--r-- | app/models/ci/commit.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/models/ci/commit.rb b/app/models/ci/commit.rb index 31da7e8f2b6..c77921979a6 100644 --- a/app/models/ci/commit.rb +++ b/app/models/ci/commit.rb @@ -224,6 +224,16 @@ module Ci update!(committed_at: DateTime.now) end + def should_create_next_builds?(build) + # don't create other builds if this one is retried + other_builds = builds.similar(build).latest + return false unless other_builds.include?(build) + + other_builds.all? do |build| + build.success? || build.ignored? + end + end + private def save_yaml_error(error) |