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
- Export and import avatar as part of project import/export
- Fix migration corrupting import data for old version upgrades
- Show tooltip on GitLab export link in new project page
- Add GitLab Workhorse version to admin dashboard (Katarzyna Kobierska)
v 8.9.6
- Fix importing of events under notes for GitLab projects. !5154
......
......@@ -79,6 +79,10 @@
GitLab Shell
%span.pull-right
= Gitlab::Shell.new.version
%p
GitLab Workhorse
%span.pull-right
= Gitlab::Workhorse.version
%p
GitLab API
%span.pull-right
......
......@@ -4,6 +4,7 @@ require 'json'
module Gitlab
class Workhorse
SEND_DATA_HEADER = 'Gitlab-Workhorse-Send-Data'
VERSION_FILE = 'GITLAB_WORKHORSE_VERSION'
class << self
def git_http_ok(repository, user)
......@@ -75,6 +76,12 @@ module Gitlab
]
end
def version
if File.readable?(File.join(Rails.root, VERSION_FILE))
File.read(File.join(Rails.root, VERSION_FILE))
end
end
protected
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