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

Fix failures

parent 478a4137
......@@ -23,9 +23,7 @@ module Ci
def status
strong_memoize(:status) do
Gitlab::Ci::Status::GroupedStatuses
.new(@jobs)
.one[:status]
@jobs.slow_composite_status
end
end
......
......@@ -30,10 +30,7 @@ module Ci
end
def status
@status ||=
Gitlab::Ci::Status::GroupedStatuses
.new(statuses.latest)
.one[:status]
@status ||= statuses.latest.slow_composite_status
end
......
......@@ -390,16 +390,17 @@ module Ci
def legacy_stages
# TODO, this needs refactoring, see gitlab-foss#26481.
Gitlab::Ci::Status::GroupedStatuses
stages = 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],
status: stage[:status],
warnings: stage[:warnings])
end
stages.map do |stage|
Ci::LegacyStage.new(self,
name: stage[:stage],
status: stage[:status],
warnings: stage[:warnings])
end
end
def valid_commit_sha
......@@ -904,9 +905,7 @@ module Ci
def latest_builds_status
return 'failed' unless yaml_errors.blank?
Gitlab::Ci::Status::GroupedStatuses
.new(statuses.latest)
.one[:status] || 'skipped'
statuses.latest.slow_composite_status || 'skipped'
end
def keep_around_commits
......
......@@ -126,9 +126,7 @@ module Ci
end
def latest_stage_status
Gitlab::Ci::Status::GroupedStatuses
.new(statuses.latest)
.one[:status] || 'skipped'
statuses.latest.slow_composite_status || 'skipped'
end
end
end
......@@ -161,15 +161,11 @@ class CommitStatus < ApplicationRecord
end
def self.status_for_prior_stages(index)
Gitlab::Ci::Status::GroupedStatuses
.new(before_stage(index).latest)
.one[:status] || 'success'
before_stage(index).latest.slow_composite_status || 'success'
end
def self.status_for_names(names)
Gitlab::Ci::Status::GroupedStatuses
.new(where(name: names).latest)
.one[:status] || 'success'
where(name: names).latest.slow_composite_status || 'success'
end
def locking_enabled?
......
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