Commit ffc9fe49 authored by Vladimir Shushlin's avatar Vladimir Shushlin

Fix empty labels for `pages:deploy` job

Use description of GenericCommitStatus as label if provided
Fallback to core status labels if not
parent 93a93174
---
title: Fix empty labels of CI builds for gitlab-pages on pipeline page
merge_request: 24451
author:
type: fixed
...@@ -6,7 +6,7 @@ module Gitlab ...@@ -6,7 +6,7 @@ module Gitlab
module External module External
module Common module Common
def label def label
subject.description subject.description || super
end end
def has_details? def has_details?
......
...@@ -11,7 +11,7 @@ describe Gitlab::Ci::Status::External::Common do ...@@ -11,7 +11,7 @@ describe Gitlab::Ci::Status::External::Common do
end end
subject do subject do
Gitlab::Ci::Status::Core Gitlab::Ci::Status::Success
.new(external_status, user) .new(external_status, user)
.extend(described_class) .extend(described_class)
end end
...@@ -20,6 +20,14 @@ describe Gitlab::Ci::Status::External::Common do ...@@ -20,6 +20,14 @@ describe Gitlab::Ci::Status::External::Common do
it 'returns description' do it 'returns description' do
expect(subject.label).to eq external_description expect(subject.label).to eq external_description
end 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 end
describe '#has_action?' do describe '#has_action?' do
......
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