From e740a00ed659221929a79e580634424423690514 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 11 Jun 2014 22:08:39 +0300 Subject: [PATCH 1/6] Prevent commit page error if cant collect branches where commit exists Signed-off-by: Dmitriy Zaporozhets --- app/controllers/projects/commit_controller.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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] From afa4a075e463103cd7148bc97db21421a0718a8a Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 11 Jun 2014 22:22:58 +0300 Subject: [PATCH 2/6] Show spinner on network graph while it loading Signed-off-by: Dmitriy Zaporozhets --- app/helpers/application_helper.rb | 7 +++++-- app/views/projects/network/show.html.haml | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) 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/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({ From 5b2193555b69f82f2efdadaf62ada1e9c3c2d77a Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 11 Jun 2014 22:53:42 +0300 Subject: [PATCH 3/6] Describe unicorn timeout value in git over http Signed-off-by: Dmitriy Zaporozhets --- config/unicorn.rb.example | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 From 7ed935b6765ed1e9de810cfdf8ac9f6eb3fb741d Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 11 Jun 2014 23:13:31 +0300 Subject: [PATCH 4/6] Use gitlab_git to get commit_count in repo. It allows get commits count for git repos with 100k+ commits Signed-off-by: Dmitriy Zaporozhets --- Gemfile | 2 +- Gemfile.lock | 4 ++-- app/models/repository.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 719d65a2eb9..6ef2a48018a 100644 --- a/Gemfile +++ b/Gemfile @@ -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/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 From 56f0f6aba399d85c6e99e69c57a18a040bad4cf3 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 11 Jun 2014 23:37:21 +0300 Subject: [PATCH 5/6] Use same 30 seconds satellite timeout for all actions Signed-off-by: Dmitriy Zaporozhets --- lib/gitlab/satellite/files/file_action.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 61c2a2d39a3a73761e862818b73940510eb80b80 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 11 Jun 2014 23:43:05 +0300 Subject: [PATCH 6/6] More items in CHANGELOG Signed-off-by: Dmitriy Zaporozhets --- CHANGELOG | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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