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

Fix status bugs

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