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

Fix failures

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