Merge branch '21664-incorrect-workhorse-version-number-displayed' into 'master'
Use the Gitlab Workhorse HTTP header in the admin dashboard Fixes issue #21664 where the GitLab Workhorse version displayed within the Admin Area was not correct for installations from source. See merge request !7332
This commit is contained in:
commit
e934043d61
4 changed files with 35 additions and 1 deletions
9
app/helpers/components_helper.rb
Normal file
9
app/helpers/components_helper.rb
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
module ComponentsHelper
|
||||||
|
def gitlab_workhorse_version
|
||||||
|
if request.headers['Gitlab-Workhorse'].present?
|
||||||
|
request.headers['Gitlab-Workhorse'].split('-').first
|
||||||
|
else
|
||||||
|
Gitlab::Workhorse.version
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -87,7 +87,7 @@
|
||||||
%p
|
%p
|
||||||
GitLab Workhorse
|
GitLab Workhorse
|
||||||
%span.pull-right
|
%span.pull-right
|
||||||
= Gitlab::Workhorse.version
|
= gitlab_workhorse_version
|
||||||
%p
|
%p
|
||||||
GitLab API
|
GitLab API
|
||||||
%span.pull-right
|
%span.pull-right
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
title: Use the Gitlab Workhorse HTTP header in the admin dashboard
|
||||||
|
merge_request:
|
||||||
|
author: Chris Wright
|
21
spec/helpers/components_helper_spec.rb
Normal file
21
spec/helpers/components_helper_spec.rb
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe ComponentsHelper do
|
||||||
|
describe '#gitlab_workhorse_version' do
|
||||||
|
context 'without a Gitlab-Workhorse header' do
|
||||||
|
it 'shows the version from Gitlab::Workhorse.version' do
|
||||||
|
expect(helper.gitlab_workhorse_version).to eq Gitlab::Workhorse.version
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'with a Gitlab-Workhorse header' do
|
||||||
|
before do
|
||||||
|
helper.request.headers['Gitlab-Workhorse'] = '42.42.0-rc3'
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'shows the actual GitLab Workhorse version currently in use' do
|
||||||
|
expect(helper.gitlab_workhorse_version).to eq '42.42.0'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue