Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Shushlin <vshushlin@gitlab.com>2019-01-21 14:08:42 +0300
committerVladimir Shushlin <vshushlin@gitlab.com>2019-01-21 17:16:22 +0300
commitffc9fe49a15e68c8251082fa6ac75a57350640ed (patch)
treed82389770005ab329bc8b71fe918fababc39627c
parent93a93174c2978834d529f7ee5f1d62682ee5a536 (diff)
Fix empty labels for `pages:deploy` job
Use description of GenericCommitStatus as label if provided Fallback to core status labels if not
-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.rb10
3 files changed, 15 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..5471b0092ed 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 || 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..44e73eadc72 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,14 @@ describe Gitlab::Ci::Status::External::Common do
it 'returns description' do
expect(subject.label).to eq external_description
end
+
+ context 'when description is not set' do
+ let(:external_description) { nil }
+
+ it 'uses core status label' do
+ expect(subject.label).to eq('passed')
+ end
+ end
end
describe '#has_action?' do