diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-06-11 21:09:23 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-06-11 21:09:23 +0000 |
commit | 9fd6c3d591fb56e50a9cdbbaac557383e3ef86a7 (patch) | |
tree | 4fd09317c3e515756b9db39f18eee8f8ad4c76c1 | |
parent | 7edbee6c187460f656134199d8145b7f781f2c09 (diff) | |
parent | 61c2a2d39a3a73761e862818b73940510eb80b80 (diff) | |
download | gitlab-ce-9fd6c3d591fb56e50a9cdbbaac557383e3ef86a7.tar.gz |
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
-rw-r--r-- | CHANGELOG | 7 | ||||
-rw-r--r-- | Gemfile | 2 | ||||
-rw-r--r-- | Gemfile.lock | 4 | ||||
-rw-r--r-- | app/controllers/projects/commit_controller.rb | 7 | ||||
-rw-r--r-- | app/helpers/application_helper.rb | 7 | ||||
-rw-r--r-- | app/models/repository.rb | 2 | ||||
-rw-r--r-- | app/views/projects/network/show.html.haml | 2 | ||||
-rw-r--r-- | config/unicorn.rb.example | 14 | ||||
-rw-r--r-- | lib/gitlab/satellite/files/file_action.rb | 2 |
9 files changed, 37 insertions, 10 deletions
diff --git a/CHANGELOG b/CHANGELOG index 900c7a11031..e5c1e324e69 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -26,6 +26,11 @@ v 7.0.0 - UI improvements for mobile devices - Improve diff rendering performance - 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 - Revert the commit that broke the LDAP user filter @@ -790,4 +795,4 @@ v 0.8.0 - stability - security fixes - increased test coverage - - email notification
\ No newline at end of file + - email notification @@ -30,7 +30,7 @@ gem 'omniauth-github' # Extracting information from a git repository # Provide access to Gitlab::Git library -gem "gitlab_git", '~> 5.8' +gem "gitlab_git", '~> 6.0' # Ruby/Rack Git Smart-HTTP Server Handler gem 'gitlab-grack', '~> 2.0.0.pre', require: 'grack' diff --git a/Gemfile.lock b/Gemfile.lock index 3fcea78e1e9..133fc693f08 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -175,7 +175,7 @@ GEM mime-types (~> 1.19) gitlab_emoji (0.0.1.1) emoji (~> 1.0.1) - gitlab_git (5.9.0) + gitlab_git (6.0.0) activesupport (~> 4.0) charlock_holmes (~> 0.6) gitlab-grit (~> 2.6) @@ -601,7 +601,7 @@ DEPENDENCIES gitlab-grack (~> 2.0.0.pre) gitlab-linguist (~> 3.0.0) gitlab_emoji (~> 0.0.1.1) - gitlab_git (~> 5.8) + gitlab_git (~> 6.0) gitlab_meta (= 6.0) gitlab_omniauth-ldap (= 1.0.4) gollum-lib (~> 3.0.0) diff --git a/app/controllers/projects/commit_controller.rb b/app/controllers/projects/commit_controller.rb index c56df65dcba..860ab408299 100644 --- a/app/controllers/projects/commit_controller.rb +++ b/app/controllers/projects/commit_controller.rb @@ -12,7 +12,12 @@ class Projects::CommitController < Projects::ApplicationController return git_not_found! unless @commit @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 @suppress_diff = true if commit.diff_suppress? && !params[:force_show_diff] diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 32010701e46..13120d2e581 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -226,8 +226,11 @@ module ApplicationHelper GitHub::Markup.render(file_name, file_content).html_safe end - def spinner(text = nil) - content_tag :div, class: 'loading hide' do + def spinner(text = nil, visible = false) + 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 end end diff --git a/app/models/repository.rb b/app/models/repository.rb index f6e44a52485..00a1032b6c4 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -106,7 +106,7 @@ class Repository def commit_count Rails.cache.fetch(cache_key(:commit_count)) do begin - raw_repository.raw.commit_count(self.root_ref) + raw_repository.commit_count(self.root_ref) rescue 0 end diff --git a/app/views/projects/network/show.html.haml b/app/views/projects/network/show.html.haml index da0cfa84c2d..37bc0a4c6b8 100644 --- a/app/views/projects/network/show.html.haml +++ b/app/views/projects/network/show.html.haml @@ -3,7 +3,7 @@ .tip You can move around the graph by using the arrow keys. .network-graph - = spinner + = spinner nil, true :javascript new Network({ diff --git a/config/unicorn.rb.example b/config/unicorn.rb.example index f6c0f09b51d..e88a4522338 100644 --- a/config/unicorn.rb.example +++ b/config/unicorn.rb.example @@ -34,6 +34,20 @@ listen "/home/git/gitlab/tmp/sockets/gitlab.socket", :backlog => 64 listen "127.0.0.1:8080", :tcp_nopush => true # 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 # feel free to point this anywhere accessible on the filesystem diff --git a/lib/gitlab/satellite/files/file_action.rb b/lib/gitlab/satellite/files/file_action.rb index 7701a6d5d60..6446b14568a 100644 --- a/lib/gitlab/satellite/files/file_action.rb +++ b/lib/gitlab/satellite/files/file_action.rb @@ -4,7 +4,7 @@ module Gitlab attr_accessor :file_path, :ref def initialize(user, project, ref, file_path) - super user, project, git_timeout: 10.seconds + super user, project @file_path = file_path @ref = ref end |