Commit 9fd6c3d5 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'huge-repo-improve' into 'master'

Better support for huge repositories

This MR contains next improvements to GitLab:
* You can see repo commits count even if it is > 100k commits
* Prevent 500 for commit page for large repos
* Add notice about huge push over http to unicorn config
* File action in satellites uses default 30 seconds timeout instead of old 10 seconds one
* Show spinner when loading data for network graph
parents 7edbee6c 61c2a2d3
...@@ -26,6 +26,11 @@ v 7.0.0 ...@@ -26,6 +26,11 @@ v 7.0.0
- UI improvements for mobile devices - UI improvements for mobile devices
- Improve diff rendering performance - Improve diff rendering performance
- Drag-n-drop for issues and merge requests between states at milestone page - Drag-n-drop for issues and merge requests between states at milestone page
- Fix '0 commits' message for huge repositories on project home page
- Prevent 500 error page when visit commit page from large repo
- Add notice about huge push over http to unicorn config
- File action in satellites uses default 30 seconds timeout instead of old 10 seconds one
- Overall performance improvements
v 6.9.2 v 6.9.2
- Revert the commit that broke the LDAP user filter - Revert the commit that broke the LDAP user filter
......
...@@ -30,7 +30,7 @@ gem 'omniauth-github' ...@@ -30,7 +30,7 @@ gem 'omniauth-github'
# Extracting information from a git repository # Extracting information from a git repository
# Provide access to Gitlab::Git library # Provide access to Gitlab::Git library
gem "gitlab_git", '~> 5.8' gem "gitlab_git", '~> 6.0'
# Ruby/Rack Git Smart-HTTP Server Handler # Ruby/Rack Git Smart-HTTP Server Handler
gem 'gitlab-grack', '~> 2.0.0.pre', require: 'grack' gem 'gitlab-grack', '~> 2.0.0.pre', require: 'grack'
......
...@@ -175,7 +175,7 @@ GEM ...@@ -175,7 +175,7 @@ GEM
mime-types (~> 1.19) mime-types (~> 1.19)
gitlab_emoji (0.0.1.1) gitlab_emoji (0.0.1.1)
emoji (~> 1.0.1) emoji (~> 1.0.1)
gitlab_git (5.9.0) gitlab_git (6.0.0)
activesupport (~> 4.0) activesupport (~> 4.0)
charlock_holmes (~> 0.6) charlock_holmes (~> 0.6)
gitlab-grit (~> 2.6) gitlab-grit (~> 2.6)
...@@ -601,7 +601,7 @@ DEPENDENCIES ...@@ -601,7 +601,7 @@ DEPENDENCIES
gitlab-grack (~> 2.0.0.pre) gitlab-grack (~> 2.0.0.pre)
gitlab-linguist (~> 3.0.0) gitlab-linguist (~> 3.0.0)
gitlab_emoji (~> 0.0.1.1) gitlab_emoji (~> 0.0.1.1)
gitlab_git (~> 5.8) gitlab_git (~> 6.0)
gitlab_meta (= 6.0) gitlab_meta (= 6.0)
gitlab_omniauth-ldap (= 1.0.4) gitlab_omniauth-ldap (= 1.0.4)
gollum-lib (~> 3.0.0) gollum-lib (~> 3.0.0)
......
...@@ -12,7 +12,12 @@ class Projects::CommitController < Projects::ApplicationController ...@@ -12,7 +12,12 @@ class Projects::CommitController < Projects::ApplicationController
return git_not_found! unless @commit return git_not_found! unless @commit
@line_notes = project.notes.for_commit_id(commit.id).inline @line_notes = project.notes.for_commit_id(commit.id).inline
@branches = project.repository.branch_names_contains(commit.id)
@branches = begin
project.repository.branch_names_contains(commit.id)
rescue Grit::Git::GitTimeout
[]
end
begin begin
@suppress_diff = true if commit.diff_suppress? && !params[:force_show_diff] @suppress_diff = true if commit.diff_suppress? && !params[:force_show_diff]
......
...@@ -226,8 +226,11 @@ module ApplicationHelper ...@@ -226,8 +226,11 @@ module ApplicationHelper
GitHub::Markup.render(file_name, file_content).html_safe GitHub::Markup.render(file_name, file_content).html_safe
end end
def spinner(text = nil) def spinner(text = nil, visible = false)
content_tag :div, class: 'loading hide' do css_class = "loading"
css_class << " hide" unless visible
content_tag :div, class: css_class do
content_tag(:i, nil, class: 'icon-spinner icon-spin') + text content_tag(:i, nil, class: 'icon-spinner icon-spin') + text
end end
end end
......
...@@ -106,7 +106,7 @@ class Repository ...@@ -106,7 +106,7 @@ class Repository
def commit_count def commit_count
Rails.cache.fetch(cache_key(:commit_count)) do Rails.cache.fetch(cache_key(:commit_count)) do
begin begin
raw_repository.raw.commit_count(self.root_ref) raw_repository.commit_count(self.root_ref)
rescue rescue
0 0
end end
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
.tip .tip
You can move around the graph by using the arrow keys. You can move around the graph by using the arrow keys.
.network-graph .network-graph
= spinner = spinner nil, true
:javascript :javascript
new Network({ new Network({
......
...@@ -34,6 +34,20 @@ listen "/home/git/gitlab/tmp/sockets/gitlab.socket", :backlog => 64 ...@@ -34,6 +34,20 @@ listen "/home/git/gitlab/tmp/sockets/gitlab.socket", :backlog => 64
listen "127.0.0.1:8080", :tcp_nopush => true listen "127.0.0.1:8080", :tcp_nopush => true
# nuke workers after 30 seconds instead of 60 seconds (the default) # nuke workers after 30 seconds instead of 60 seconds (the default)
#
# NOTICE: git push over http depends on this value.
# If you want be able to push huge amount of data to git repository over http
# you will have to increase this value too.
#
# Example of output if you try to push 1GB repo to GitLab over http.
# -> git push http://gitlab.... master
#
# error: RPC failed; result=18, HTTP code = 200
# fatal: The remote end hung up unexpectedly
# fatal: The remote end hung up unexpectedly
#
# For more information see http://stackoverflow.com/a/21682112/752049
#
timeout 30 timeout 30
# feel free to point this anywhere accessible on the filesystem # feel free to point this anywhere accessible on the filesystem
......
...@@ -4,7 +4,7 @@ module Gitlab ...@@ -4,7 +4,7 @@ module Gitlab
attr_accessor :file_path, :ref attr_accessor :file_path, :ref
def initialize(user, project, ref, file_path) def initialize(user, project, ref, file_path)
super user, project, git_timeout: 10.seconds super user, project
@file_path = file_path @file_path = file_path
@ref = ref @ref = ref
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