Merge branch 'mrchrisw-timeout' into 'master'

Add gitlab_shell_timeout option, set timeout for fetch/clone operations

See merge request !1482
This commit is contained in:
Marin Jankovski 2017-05-05 10:30:59 +00:00
commit 0289f50bbf
4 changed files with 23 additions and 0 deletions

View File

@ -268,6 +268,7 @@ external_url 'GENERATED_EXTERNAL_URL'
# gitlab_rails['gitlab_shell_ssh_port'] = 22
# gitlab_rails['git_max_size'] = 20971520
# gitlab_rails['git_timeout'] = 10
# gitlab_rails['gitlab_shell_git_timeout'] = 800
### Extra customization
# gitlab_rails['extra_google_analytics_id'] = '_your_tracking_id'

View File

@ -202,6 +202,7 @@ default['gitlab']['gitlab-rails']['gitlab_shell_hooks_path'] = "#{node['package'
default['gitlab']['gitlab-rails']['gitlab_shell_upload_pack'] = nil
default['gitlab']['gitlab-rails']['gitlab_shell_receive_pack'] = nil
default['gitlab']['gitlab-rails']['gitlab_shell_ssh_port'] = nil
default['gitlab']['gitlab-rails']['gitlab_shell_git_timeout'] = 800
# Path to the Git Executable
# defaults to /opt/gitlab/embedded/bin/git. The install-dir path is set at build time
default['gitlab']['gitlab-rails']['git_bin_path'] = "#{node['package']['install-dir']}/embedded/bin/git"

View File

@ -404,6 +404,9 @@ production: &base
# If you use non-standard ssh port you need to specify it
ssh_port: <%= @gitlab_shell_ssh_port %>
# Git import/fetch timeout
git_timeout: <%= @gitlab_shell_git_timeout %>
## Git settings
# CAUTION!
# Use the default values unless you really know what you are doing

View File

@ -272,6 +272,24 @@ describe 'gitlab::gitlab-rails' do
end
end
context 'GitLab Shell settings' do
context 'when git_timeout is configured' do
it 'sets the git_timeout value' do
stub_gitlab_rb(gitlab_rails: { gitlab_shell_git_timeout: '1000' })
expect(chef_run).to render_file(gitlab_yml_path)
.with_content(/git_timeout:\s+1000/)
end
end
context 'when git_timeout is not configured' do
it 'sets git_timeout value to default' do
expect(chef_run).to render_file(gitlab_yml_path)
.with_content(/git_timeout:\s+800/)
end
end
end
context 'when there is a legacy GitLab Rails stuck_ci_builds_worker_cron key' do
before do
allow(Gitlab).to receive(:[]).and_call_original