Commit b8003a78 authored by Kamil Trzciński's avatar Kamil Trzciński

Fix status bugs

parent 3011d182
......@@ -393,6 +393,7 @@ module Ci
Gitlab::Ci::Status::GroupedStatuses
.new(statuses.latest, :stage, :stage_idx)
.group(:stage, :stage_idx)
.sort_by { |stage| stage[:stage_idx] }
.map do |stage|
Ci::LegacyStage.new(self,
name: stage[:stage],
......
......@@ -35,8 +35,8 @@ module Gitlab
when include?(:preparing)
:preparing
when include?(:created)
:created
when include?
:running
else
:failed
end
end
......@@ -48,12 +48,11 @@ module Gitlab
private
def include?(*names)
names.all? { |name| @status_set.include?(name) }
names.any? { |name| @status_set.include?(name) }
end
def only?(*names)
@status_set.size == names.size &&
names.all? { |name| @status_set.include?(name) }
matching = names.count { |name| @status_set.include?(name) } == @status_set.size
end
def build_status_set(all_statuses)
......
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