Commit 980009e6 authored by Kamil Trzcinski's avatar Kamil Trzcinski Committed by Grzegorz Bizon

Fix auto loading of constants for Ci Statuses

parent f0cd73bf
...@@ -100,8 +100,8 @@ module Ci ...@@ -100,8 +100,8 @@ module Ci
end end
end end
def detailed_status def detailed_status(current_user)
Gitlab::Ci::Status::Build::Factory.new(self).fabricate! Gitlab::Ci::Status::Build::Factory.new(self, current_user).fabricate!
end end
def manual? def manual?
...@@ -156,7 +156,7 @@ module Ci ...@@ -156,7 +156,7 @@ module Ci
end end
def environment_action def environment_action
self.options.fetch(:environment, {}).fetch(:action, 'start') self.options.fetch(:environment, {}).fetch(:action, 'start') if self.options
end end
def outdated_deployment? def outdated_deployment?
......
...@@ -336,8 +336,8 @@ module Ci ...@@ -336,8 +336,8 @@ module Ci
.select { |merge_request| merge_request.head_pipeline.try(:id) == self.id } .select { |merge_request| merge_request.head_pipeline.try(:id) == self.id }
end end
def detailed_status def detailed_status(current_user)
Gitlab::Ci::Status::Pipeline::Factory.new(self).fabricate! Gitlab::Ci::Status::Pipeline::Factory.new(self, current_user).fabricate!
end end
private private
......
...@@ -22,8 +22,8 @@ module Ci ...@@ -22,8 +22,8 @@ module Ci
@status ||= statuses.latest.status @status ||= statuses.latest.status
end end
def detailed_status def detailed_status(current_user)
Gitlab::Ci::Status::Stage::Factory.new(self).fabricate! Gitlab::Ci::Status::Stage::Factory.new(self, current_user).fabricate!
end end
def statuses def statuses
......
...@@ -132,7 +132,7 @@ class CommitStatus < ActiveRecord::Base ...@@ -132,7 +132,7 @@ class CommitStatus < ActiveRecord::Base
false false
end end
def detailed_status def detailed_status(current_user)
Gitlab::Ci::Status::Factory.new(self).fabricate! Gitlab::Ci::Status::Factory.new(self, current_user).fabricate!
end end
end end
- details_path = subject.details_path if subject.has_details?(current_user) - detailed_status = subject.detailed_status(current_user)
- klass = "ci-status ci-#{subject.status}" - details_path = detailed_status.details_path if detailed_status.has_details?
- klass = "ci-status ci-#{detailed_status}"
- if details_path - if details_path
= link_to details_path, class: klass do = link_to details_path, class: klass do
= custom_icon(status.icon) = custom_icon(detailed_status.icon)
= status.text = detailed_status.text
- else - else
%span{ class: klass } %span{ class: klass }
= custom_icon(status.icon) = custom_icon(detailed_status.icon)
= status.text = detailed_status.text
module Gitlab module Gitlab
module Ci module Ci
module Status module Status
module Status module Build
class Cancelable < SimpleDelegator class Cancelable < SimpleDelegator
include Status::Extended include Status::Extended
......
module Gitlab module Gitlab
module Ci module Ci
module Status module Status
module Status module Build
class Play < SimpleDelegator class Play < SimpleDelegator
include Status::Extended include Status::Extended
......
module Gitlab module Gitlab
module Ci module Ci
module Status module Status
module Status module Build
class Retryable < SimpleDelegator class Retryable < SimpleDelegator
include Status::Extended include Status::Extended
......
module Gitlab module Gitlab
module Ci module Ci
module Status module Status
module Status module Build
class Play < SimpleDelegator class Stop < SimpleDelegator
include Status::Extended include Status::Extended
def text def text
......
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