Commit 63f39602 authored by Douwe Maan's avatar Douwe Maan

Merge branch 'add-gitlab-workhorse-version-to-admin-dashboard' into 'master'

Add gitlab-workhorse version to admin dashboard

## What does this MR do?
Add gitlab-workhorse version to admin dashboard.

## What are the relevant issue numbers?
Closes #15418 

## Screenshot
![Zrzut_ekranu_2016-07-20_o_23.20.55](/uploads/ba6761e2145d903ac87bc7198bc8b182/Zrzut_ekranu_2016-07-20_o_23.20.55.png)

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- Tests
  - [x] Add test - show Gitlab Workhorse version on Admin Dashboard
  - [x] All builds are passing
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)

cc @ubudzisz @yorickpeterse @grzesiek [@chastell](https://github.com/chastell) [@tomash](https://github.com/tomash)

See merge request !5321
parents 8d684d8f ab419b08
......@@ -5,6 +5,7 @@ v 8.11.0 (unreleased)
- Limit git rev-list output count to one in forced push check
- Retrieve rendered HTML from cache in one request
- Load project invited groups and members eagerly in ProjectTeam#fetch_members
- Add GitLab Workhorse version to admin dashboard (Katarzyna Kobierska Ula Budziszewska)
v 8.10.0
- Fix profile activity heatmap to show correct day name (eanplatter)
......
......@@ -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,11 @@ module Gitlab
]
end
def version
path = Rails.root.join(VERSION_FILE)
path.readable? ? path.read.chomp : 'unknown'
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