Commit f4513d5c authored by Grzegorz Bizon's avatar Grzegorz Bizon

Make it possible to retry build that was canceled

parent a9ec4ec0
...@@ -135,7 +135,7 @@ module Ci ...@@ -135,7 +135,7 @@ module Ci
def retryable? def retryable?
project.builds_enabled? && commands.present? && project.builds_enabled? && commands.present? &&
(success? || failed?) (success? || failed? || canceled?)
end end
def retried? def retried?
......
...@@ -918,6 +918,14 @@ describe Ci::Build, models: true do ...@@ -918,6 +918,14 @@ describe Ci::Build, models: true do
it { is_expected.to be_retryable } it { is_expected.to be_retryable }
end end
context 'when build is canceled' do
before do
build.cancel!
end
it { is_expected.to be_retryable }
end
end end
context 'when build is not retryable' do context 'when build is not retryable' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment