summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG4
-rw-r--r--app/assets/stylesheets/framework/avatar.scss20
-rw-r--r--app/assets/stylesheets/pages/dashboard.scss4
-rw-r--r--app/models/note.rb14
-rw-r--r--app/models/project.rb11
-rw-r--r--app/views/admin/dashboard/index.html.haml4
-rw-r--r--app/views/groups/show.html.haml2
-rw-r--r--app/views/projects/_home_panel.html.haml2
-rw-r--r--db/migrate/20160722221922_nullify_blank_type_on_notes.rb9
-rw-r--r--lib/gitlab/workhorse.rb6
-rw-r--r--spec/views/admin/dashboard/index.html.haml_spec.rb20
11 files changed, 75 insertions, 21 deletions
diff --git a/CHANGELOG b/CHANGELOG
index fa272755033..971a709e4c1 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -5,6 +5,10 @@ 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.1 (unreleased)
+ - Fix bug where replies to commit notes displayed in the MR discussion tab wouldn't show up on the commit page
v 8.10.0
- Fix profile activity heatmap to show correct day name (eanplatter)
diff --git a/app/assets/stylesheets/framework/avatar.scss b/app/assets/stylesheets/framework/avatar.scss
index 8b6ddf8ba18..c79b22d4d21 100644
--- a/app/assets/stylesheets/framework/avatar.scss
+++ b/app/assets/stylesheets/framework/avatar.scss
@@ -5,6 +5,7 @@
height: 40px;
padding: 0;
@include border-radius($avatar_radius);
+ border: 1px solid rgba(0, 0, 0, .1);
&.avatar-inline {
float: none;
@@ -15,8 +16,9 @@
&.s24 { margin-right: 4px; }
}
- &.group-avatar, &.project-avatar, &.avatar-tile {
+ &.avatar-tile {
@include border-radius(0);
+ border: none;
}
&.s16 { width: 16px; height: 16px; margin-right: 6px; }
@@ -43,12 +45,12 @@
&.s16 { font-size: 12px; line-height: 1.33; }
&.s24 { font-size: 14px; line-height: 1.8; }
&.s26 { font-size: 20px; line-height: 1.33; }
- &.s32 { font-size: 20px; line-height: 32px; }
- &.s40 { font-size: 16px; line-height: 40px; }
- &.s60 { font-size: 32px; line-height: 60px; }
- &.s70 { font-size: 34px; line-height: 70px; }
- &.s90 { font-size: 36px; line-height: 90px; }
- &.s110 { font-size: 40px; line-height: 112px; font-weight: 300; }
- &.s140 { font-size: 72px; line-height: 140px; }
- &.s160 { font-size: 96px; line-height: 160px; }
+ &.s32 { font-size: 20px; line-height: 30px; }
+ &.s40 { font-size: 16px; line-height: 38px; }
+ &.s60 { font-size: 32px; line-height: 58px; }
+ &.s70 { font-size: 34px; line-height: 68px; }
+ &.s90 { font-size: 36px; line-height: 88px; }
+ &.s110 { font-size: 40px; line-height: 108px; font-weight: 300; }
+ &.s140 { font-size: 72px; line-height: 138px; }
+ &.s160 { font-size: 96px; line-height: 158px; }
}
diff --git a/app/assets/stylesheets/pages/dashboard.scss b/app/assets/stylesheets/pages/dashboard.scss
index cf7567513ec..42928ee279c 100644
--- a/app/assets/stylesheets/pages/dashboard.scss
+++ b/app/assets/stylesheets/pages/dashboard.scss
@@ -36,10 +36,6 @@
.dash-project-avatar {
float: left;
-
- .avatar {
- @include border-radius(50%);
- }
}
.dash-project-access-icon {
diff --git a/app/models/note.rb b/app/models/note.rb
index 9b0a7211b4e..b6b2ac6aa42 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -69,7 +69,7 @@ class Note < ActiveRecord::Base
project: [:project_members, { group: [:group_members] }])
end
- before_validation :clear_blank_line_code!
+ before_validation :nullify_blank_type, :nullify_blank_line_code
after_save :keep_around_commit
class << self
@@ -217,10 +217,6 @@ class Note < ActiveRecord::Base
!system?
end
- def clear_blank_line_code!
- self.line_code = nil if self.line_code.blank?
- end
-
def can_be_award_emoji?
noteable.is_a?(Awardable)
end
@@ -238,4 +234,12 @@ class Note < ActiveRecord::Base
def keep_around_commit
project.repository.keep_around(self.commit_id)
end
+
+ def nullify_blank_type
+ self.type = nil if self.type.blank?
+ end
+
+ def nullify_blank_line_code
+ self.line_code = nil if self.line_code.blank?
+ end
end
diff --git a/app/models/project.rb b/app/models/project.rb
index 5452d9f768f..023b1dc3725 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -882,9 +882,13 @@ class Project < ActiveRecord::Base
old_path_with_namespace = File.join(namespace_dir, path_was)
new_path_with_namespace = File.join(namespace_dir, path)
+ Rails.logger.error "Attempting to rename #{old_path_with_namespace} -> #{new_path_with_namespace}"
+
expire_caches_before_rename(old_path_with_namespace)
if has_container_registry_tags?
+ Rails.logger.error "Project #{old_path_with_namespace} cannot be renamed because container registry tags are present"
+
# we currently doesn't support renaming repository if it contains tags in container registry
raise Exception.new('Project cannot be renamed, because tags are present in its container registry')
end
@@ -903,17 +907,22 @@ class Project < ActiveRecord::Base
SystemHooksService.new.execute_hooks_for(self, :rename)
@repository = nil
- rescue
+ rescue => e
+ Rails.logger.error "Exception renaming #{old_path_with_namespace} -> #{new_path_with_namespace}: #{e}"
# Returning false does not rollback after_* transaction but gives
# us information about failing some of tasks
false
end
else
+ Rails.logger.error "Repository could not be renamed: #{old_path_with_namespace} -> #{new_path_with_namespace}"
+
# if we cannot move namespace directory we should rollback
# db changes in order to prevent out of sync between db and fs
raise Exception.new('repository cannot be renamed')
end
+ Gitlab::AppLogger.info "Project was renamed: #{old_path_with_namespace} -> #{new_path_with_namespace}"
+
Gitlab::UploadsTransfer.new.rename_project(path_was, path, namespace.path)
end
diff --git a/app/views/admin/dashboard/index.html.haml b/app/views/admin/dashboard/index.html.haml
index a2ac407c159..452fc25ab07 100644
--- a/app/views/admin/dashboard/index.html.haml
+++ b/app/views/admin/dashboard/index.html.haml
@@ -80,6 +80,10 @@
%span.pull-right
= Gitlab::Shell.new.version
%p
+ GitLab Workhorse
+ %span.pull-right
+ = Gitlab::Workhorse.version
+ %p
GitLab API
%span.pull-right
= API::API::version
diff --git a/app/views/groups/show.html.haml b/app/views/groups/show.html.haml
index eddeae98bc4..53ed4fa991d 100644
--- a/app/views/groups/show.html.haml
+++ b/app/views/groups/show.html.haml
@@ -6,7 +6,7 @@
.cover-block.groups-cover-block
%div{ class: container_class }
- = image_tag group_icon(@group), class: "avatar group-avatar s70"
+ = image_tag group_icon(@group), class: "avatar group-avatar s70 avatar-tile"
.group-info
.cover-title
%h1
diff --git a/app/views/projects/_home_panel.html.haml b/app/views/projects/_home_panel.html.haml
index cf11723dc8e..51f74f3b7ce 100644
--- a/app/views/projects/_home_panel.html.haml
+++ b/app/views/projects/_home_panel.html.haml
@@ -1,7 +1,7 @@
- empty_repo = @project.empty_repo?
.project-home-panel.text-center{ class: ("empty-project" if empty_repo) }
%div{ class: container_class }
- = project_icon(@project, alt: @project.name, class: 'project-avatar avatar s70')
+ = project_icon(@project, alt: @project.name, class: 'project-avatar avatar s70 avatar-tile')
%h1.project-title
= @project.name
%span.visibility-icon.has-tooltip{data: { container: 'body' }, title: visibility_icon_description(@project)}
diff --git a/db/migrate/20160722221922_nullify_blank_type_on_notes.rb b/db/migrate/20160722221922_nullify_blank_type_on_notes.rb
new file mode 100644
index 00000000000..c4b78e8e15c
--- /dev/null
+++ b/db/migrate/20160722221922_nullify_blank_type_on_notes.rb
@@ -0,0 +1,9 @@
+class NullifyBlankTypeOnNotes < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ def up
+ execute "UPDATE notes SET type = NULL WHERE type = ''"
+ end
+end
diff --git a/lib/gitlab/workhorse.rb b/lib/gitlab/workhorse.rb
index 6aeb49c0219..c6826a09bd2 100644
--- a/lib/gitlab/workhorse.rb
+++ b/lib/gitlab/workhorse.rb
@@ -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)
diff --git a/spec/views/admin/dashboard/index.html.haml_spec.rb b/spec/views/admin/dashboard/index.html.haml_spec.rb
new file mode 100644
index 00000000000..dae858a52f6
--- /dev/null
+++ b/spec/views/admin/dashboard/index.html.haml_spec.rb
@@ -0,0 +1,20 @@
+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