diff options
-rw-r--r-- | changelogs/unreleased/40997-gitlab-pages-deploy-jobs-have-a-null-status.yml | 5 | ||||
-rw-r--r-- | lib/gitlab/ci/status/external/common.rb | 2 | ||||
-rw-r--r-- | spec/lib/gitlab/ci/status/external/common_spec.rb | 10 |
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 |