gitlab-org--gitlab-foss/lib/ci/status.rb

20 lines
448 B
Ruby
Raw Normal View History

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
2015-10-15 19:44:15 -04:00
end