Commit 10d9df28 authored by Katarzyna Kobierska's avatar Katarzyna Kobierska

Add gitlab-workhorse version to admin dashboard

Test for showing GitLab Workhorse version on Admin Dashboard

Refactoring
parent 46a17ffd
...@@ -164,6 +164,7 @@ v 8.10.0 ...@@ -164,6 +164,7 @@ v 8.10.0
- Export and import avatar as part of project import/export - Export and import avatar as part of project import/export
- Fix migration corrupting import data for old version upgrades - Fix migration corrupting import data for old version upgrades
- Show tooltip on GitLab export link in new project page - Show tooltip on GitLab export link in new project page
- Add GitLab Workhorse version to admin dashboard (Katarzyna Kobierska)
v 8.9.6 v 8.9.6
- Fix importing of events under notes for GitLab projects. !5154 - Fix importing of events under notes for GitLab projects. !5154
......
...@@ -79,6 +79,10 @@ ...@@ -79,6 +79,10 @@
GitLab Shell GitLab Shell
%span.pull-right %span.pull-right
= Gitlab::Shell.new.version = Gitlab::Shell.new.version
%p
GitLab Workhorse
%span.pull-right
= Gitlab::Workhorse.version
%p %p
GitLab API GitLab API
%span.pull-right %span.pull-right
......
...@@ -4,6 +4,7 @@ require 'json' ...@@ -4,6 +4,7 @@ require 'json'
module Gitlab module Gitlab
class Workhorse class Workhorse
SEND_DATA_HEADER = 'Gitlab-Workhorse-Send-Data' SEND_DATA_HEADER = 'Gitlab-Workhorse-Send-Data'
VERSION_FILE = 'GITLAB_WORKHORSE_VERSION'
class << self class << self
def git_http_ok(repository, user) def git_http_ok(repository, user)
...@@ -75,6 +76,12 @@ module Gitlab ...@@ -75,6 +76,12 @@ module Gitlab
] ]
end end
def version
if File.readable?(File.join(Rails.root, VERSION_FILE))
File.read(File.join(Rails.root, VERSION_FILE))
end
end
protected protected
def encode(hash) def encode(hash)
......
require 'spec_helper'
describe 'admin/dashboard/index.html.haml' do
include Devise::TestHelpers
before do
assign(:projects, create_list(:empty_project, 1))
assign(:users, create_list(:user, 1))
assign(:groups, create_list(:group, 1))
allow(view).to receive(:admin?).and_return(true)
end
it "shows version of GitLab Workhorse" do
render
expect(rendered).to have_content 'GitLab Workhorse'
expect(rendered).to have_content Gitlab::Workhorse.version
end
end
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