mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-11 13:46:11 +10:00
Fix CI builds scheduler when first build in stage is allowed to fail This fixes an edge case in CI builds scheduler when first build in stage was marked as allowed to fail. Closes #3192 See merge request !2869
20 lines
448 B
Ruby
20 lines
448 B
Ruby
module Ci
|
|
class Status
|
|
def self.get_status(statuses)
|
|
if statuses.none?
|
|
'skipped'
|
|
elsif statuses.all? { |status| status.success? || status.ignored? }
|
|
'success'
|
|
elsif statuses.all?(&:pending?)
|
|
'pending'
|
|
elsif statuses.any?(&:running?) || statuses.any?(&:pending?)
|
|
'running'
|
|
elsif statuses.all?(&:canceled?)
|
|
'canceled'
|
|
else
|
|
'failed'
|
|
end
|
|
end
|
|
end
|
|
end
|