summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-12-08 17:52:24 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-12-12 12:59:01 +0100
commit980009e6e85562c9ee8026878929d09905b2a0a9 (patch)
tree2388b1dd60a96e21e39c718bea20480ebca0dc67 /app
parentf0cd73bfadbe9fa27b25473dab61d8c566292392 (diff)
downloadgitlab-ce-980009e6e85562c9ee8026878929d09905b2a0a9.tar.gz
Fix auto loading of constants for Ci Statuses
Diffstat (limited to 'app')
-rw-r--r--app/models/ci/build.rb6
-rw-r--r--app/models/ci/pipeline.rb4
-rw-r--r--app/models/ci/stage.rb4
-rw-r--r--app/models/commit_status.rb4
-rw-r--r--app/views/ci/status/_icon_with_label.html.haml13
5 files changed, 16 insertions, 15 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index 73564dd2aa0..65ee327a8e5 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -100,8 +100,8 @@ module Ci
end
end
- def detailed_status
- Gitlab::Ci::Status::Build::Factory.new(self).fabricate!
+ def detailed_status(current_user)
+ Gitlab::Ci::Status::Build::Factory.new(self, current_user).fabricate!
end
def manual?
@@ -156,7 +156,7 @@ module Ci
end
def environment_action
- self.options.fetch(:environment, {}).fetch(:action, 'start')
+ self.options.fetch(:environment, {}).fetch(:action, 'start') if self.options
end
def outdated_deployment?
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index fda8228a1e9..1f33106d358 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -336,8 +336,8 @@ module Ci
.select { |merge_request| merge_request.head_pipeline.try(:id) == self.id }
end
- def detailed_status
- Gitlab::Ci::Status::Pipeline::Factory.new(self).fabricate!
+ def detailed_status(current_user)
+ Gitlab::Ci::Status::Pipeline::Factory.new(self, current_user).fabricate!
end
private
diff --git a/app/models/ci/stage.rb b/app/models/ci/stage.rb
index d2a37c0a827..be52cce20f1 100644
--- a/app/models/ci/stage.rb
+++ b/app/models/ci/stage.rb
@@ -22,8 +22,8 @@ module Ci
@status ||= statuses.latest.status
end
- def detailed_status
- Gitlab::Ci::Status::Stage::Factory.new(self).fabricate!
+ def detailed_status(current_user)
+ Gitlab::Ci::Status::Stage::Factory.new(self, current_user).fabricate!
end
def statuses
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb
index fce16174e22..6548a7dda2c 100644
--- a/app/models/commit_status.rb
+++ b/app/models/commit_status.rb
@@ -132,7 +132,7 @@ class CommitStatus < ActiveRecord::Base
false
end
- def detailed_status
- Gitlab::Ci::Status::Factory.new(self).fabricate!
+ def detailed_status(current_user)
+ Gitlab::Ci::Status::Factory.new(self, current_user).fabricate!
end
end
diff --git a/app/views/ci/status/_icon_with_label.html.haml b/app/views/ci/status/_icon_with_label.html.haml
index 65a74e88444..d3fe332cc78 100644
--- a/app/views/ci/status/_icon_with_label.html.haml
+++ b/app/views/ci/status/_icon_with_label.html.haml
@@ -1,10 +1,11 @@
-- details_path = subject.details_path if subject.has_details?(current_user)
-- klass = "ci-status ci-#{subject.status}"
+- detailed_status = subject.detailed_status(current_user)
+- details_path = detailed_status.details_path if detailed_status.has_details?
+- klass = "ci-status ci-#{detailed_status}"
- if details_path
= link_to details_path, class: klass do
- = custom_icon(status.icon)
- = status.text
+ = custom_icon(detailed_status.icon)
+ = detailed_status.text
- else
%span{ class: klass }
- = custom_icon(status.icon)
- = status.text
+ = custom_icon(detailed_status.icon)
+ = detailed_status.text