summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2019-01-25 10:51:47 +0000
committerGrzegorz Bizon <grzegorz@gitlab.com>2019-01-25 10:51:47 +0000
commit552f80328351b11ce9845448110f2db3afc09a2b (patch)
tree1badb2273702b94c3827774f57305cb586b2af83
parentca52a1254edc89fdb195f5d10fbf7cbd233644a9 (diff)
parent7f6e0c84f8b9beb1875e28aca982c0ada79d4242 (diff)
downloadgitlab-ce-552f80328351b11ce9845448110f2db3afc09a2b.tar.gz
Merge branch '40997-gitlab-pages-deploy-jobs-have-a-null-status' into 'master'
Fix empty labels for `pages:deploy` job Closes #40997 See merge request gitlab-org/gitlab-ce!24451
-rw-r--r--changelogs/unreleased/40997-gitlab-pages-deploy-jobs-have-a-null-status.yml5
-rw-r--r--lib/gitlab/ci/status/external/common.rb2
-rw-r--r--spec/lib/gitlab/ci/status/external/common_spec.rb18
3 files changed, 23 insertions, 2 deletions
diff --git a/changelogs/unreleased/40997-gitlab-pages-deploy-jobs-have-a-null-status.yml b/changelogs/unreleased/40997-gitlab-pages-deploy-jobs-have-a-null-status.yml
new file mode 100644
index 00000000000..01036253151
--- /dev/null
+++ b/changelogs/unreleased/40997-gitlab-pages-deploy-jobs-have-a-null-status.yml
@@ -0,0 +1,5 @@
+---
+title: Fix empty labels of CI builds for gitlab-pages on pipeline page
+merge_request: 24451
+author:
+type: fixed
diff --git a/lib/gitlab/ci/status/external/common.rb b/lib/gitlab/ci/status/external/common.rb
index 4169f5b3210..cd772819293 100644
--- a/lib/gitlab/ci/status/external/common.rb
+++ b/lib/gitlab/ci/status/external/common.rb
@@ -6,7 +6,7 @@ module Gitlab
module External
module Common
def label
- subject.description
+ subject.description.presence || super
end
def has_details?
diff --git a/spec/lib/gitlab/ci/status/external/common_spec.rb b/spec/lib/gitlab/ci/status/external/common_spec.rb
index 40871f86568..0d02c371a92 100644
--- a/spec/lib/gitlab/ci/status/external/common_spec.rb
+++ b/spec/lib/gitlab/ci/status/external/common_spec.rb
@@ -11,7 +11,7 @@ describe Gitlab::Ci::Status::External::Common do
end
subject do
- Gitlab::Ci::Status::Core
+ Gitlab::Ci::Status::Success
.new(external_status, user)
.extend(described_class)
end
@@ -20,6 +20,22 @@ describe Gitlab::Ci::Status::External::Common do
it 'returns description' do
expect(subject.label).to eq external_description
end
+
+ context 'when description is nil' do
+ let(:external_description) { nil }
+
+ it 'uses core status label' do
+ expect(subject.label).to eq('passed')
+ end
+ end
+
+ context 'when description is empty string' do
+ let(:external_description) { '' }
+
+ it 'uses core status label' do
+ expect(subject.label).to eq('passed')
+ end
+ end
end
describe '#has_action?' do