diff options
author | Sean McGivern <sean@gitlab.com> | 2017-10-13 18:26:17 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2017-10-16 13:10:07 +0300 |
commit | 6247886405b5f15e05750049254f2d341b9de72d (patch) | |
tree | 5c816a506d88e0fc9e56796e5a66bed5b124a8f2 /app/services/ci | |
parent | 5e0fca33220708e16f3862aa93b49fade8d719a5 (diff) |
Don't create build failed todo when build is retried
When a build is retried automatically, we close any open todos. However, we do
that _before_ creating a new build failed todo.
To solve this, we check if the build is retried before creating the todo. We
also ensure that the build _instance_ has the correct attribute set, without
needing to reload it from the database.
Diffstat (limited to 'app/services/ci')
-rw-r--r-- | app/services/ci/retry_build_service.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/services/ci/retry_build_service.rb b/app/services/ci/retry_build_service.rb index d67b9f5cc56..c552193e66b 100644 --- a/app/services/ci/retry_build_service.rb +++ b/app/services/ci/retry_build_service.rb @@ -28,6 +28,8 @@ module Ci attributes.push([:user, current_user]) + build.retried = true + Ci::Build.transaction do # mark all other builds of that name as retried build.pipeline.builds.latest |