diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-06-28 14:24:43 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-06-30 11:06:19 +0200 |
commit | f9c5f18d448de3fefced3149550263adc83af1bf (patch) | |
tree | ee5f5b467ff1c53ec91c5c6003e77243a281b8af /app | |
parent | 94cec500c534ac8b35d7d7d9c807646faa800fec (diff) | |
download | gitlab-ce-f9c5f18d448de3fefced3149550263adc83af1bf.tar.gz |
Improve method that tells if build is retryable
This method now should return false if build is not completed. If build
is running then it is not retryable, therefore `Ci::Build#retryable?`
returned wrong value. This commit changes this behavior
Diffstat (limited to 'app')
-rw-r--r-- | app/models/ci/build.rb | 2 | ||||
-rw-r--r-- | app/views/projects/builds/_sidebar.html.haml | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 2b0bec33131..c11f8e6884d 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -90,7 +90,7 @@ module Ci end def retryable? - project.builds_enabled? && commands.present? + project.builds_enabled? && commands.present? && complete? end def retried? diff --git a/app/views/projects/builds/_sidebar.html.haml b/app/views/projects/builds/_sidebar.html.haml index a1dc79aaf5e..cab21f0cf19 100644 --- a/app/views/projects/builds/_sidebar.html.haml +++ b/app/views/projects/builds/_sidebar.html.haml @@ -40,7 +40,7 @@ .block{ class: ("block-first" if !@build.coverage && !(can?(current_user, :read_build, @project) && (@build.artifacts? || @build.artifacts_expired?))) } .title Build details - - if @build.retryable? && !@build.active? + - if @build.retryable? = link_to "Retry", retry_namespace_project_build_path(@project.namespace, @project, @build), class: 'pull-right', method: :post - if @build.merge_request %p.build-detail-row |