Skip to content
Snippets Groups Projects

Add support to configure webhook_timeout in gitlab.yaml

Closed gitlab-qa-bot requested to merge github/fork/wesgurn/master into master
1 file
+ 0
2
Compare changes
  • Side-by-side
  • Inline
+ 73
12
@@ -22,6 +22,7 @@ namespace :gitlab do
@@ -22,6 +22,7 @@ namespace :gitlab do
check_tmp_writable
check_tmp_writable
check_init_script_exists
check_init_script_exists
check_init_script_up_to_date
check_init_script_up_to_date
 
check_projects_have_namespace
check_satellites_exist
check_satellites_exist
check_redis_version
check_redis_version
check_git_version
check_git_version
@@ -288,7 +289,6 @@ namespace :gitlab do
@@ -288,7 +289,6 @@ namespace :gitlab do
########################
########################
def check_gitlab_git_config
def check_gitlab_git_config
gitlab_user = Gitlab.config.gitlab.user
print "Git configured for #{gitlab_user} user? ... "
print "Git configured for #{gitlab_user} user? ... "
options = {
options = {
@@ -391,14 +391,20 @@ namespace :gitlab do
@@ -391,14 +391,20 @@ namespace :gitlab do
hook_file = "update"
hook_file = "update"
gitlab_shell_hooks_path = Gitlab.config.gitlab_shell.hooks_path
gitlab_shell_hooks_path = Gitlab.config.gitlab_shell.hooks_path
gitlab_shell_hook_file = File.join(gitlab_shell_hooks_path, hook_file)
gitlab_shell_hook_file = File.join(gitlab_shell_hooks_path, hook_file)
gitlab_shell_ssh_user = Gitlab.config.gitlab_shell.ssh_user
unless File.exists?(gitlab_shell_hook_file)
if File.exists?(gitlab_shell_hook_file)
puts "can't check because of previous errors".magenta
puts "yes".green
return
else
 
puts "no".red
 
puts "Could not find #{gitlab_shell_hook_file}"
 
try_fixing_it(
 
'Check the hooks_path in config/gitlab.yml',
 
'Check your gitlab-shell installation'
 
)
 
for_more_information(
 
see_installation_guide_section "GitLab Shell"
 
)
end
end
puts "yes".green
end
end
def check_repo_base_exists
def check_repo_base_exists
@@ -479,11 +485,13 @@ namespace :gitlab do
@@ -479,11 +485,13 @@ namespace :gitlab do
return
return
end
end
if File.stat(repo_base_path).uid == uid_for(gitlab_shell_ssh_user) &&
uid = uid_for(gitlab_shell_ssh_user)
File.stat(repo_base_path).gid == gid_for(gitlab_shell_owner_group)
gid = gid_for(gitlab_shell_owner_group)
 
if File.stat(repo_base_path).uid == uid && File.stat(repo_base_path).gid == gid
puts "yes".green
puts "yes".green
else
else
puts "no".red
puts "no".red
 
puts " User id for #{gitlab_shell_ssh_user}: #{uid}. Groupd id for #{gitlab_shell_owner_group}: #{gid}".blue
try_fixing_it(
try_fixing_it(
"sudo chown -R #{gitlab_shell_ssh_user}:#{gitlab_shell_owner_group} #{repo_base_path}"
"sudo chown -R #{gitlab_shell_ssh_user}:#{gitlab_shell_owner_group} #{repo_base_path}"
)
)
@@ -550,6 +558,32 @@ namespace :gitlab do
@@ -550,6 +558,32 @@ namespace :gitlab do
end
end
end
end
 
def check_projects_have_namespace
 
print "projects have namespace: ... "
 
 
unless Project.count > 0
 
puts "can't check, you have no projects".magenta
 
return
 
end
 
puts ""
 
 
Project.find_each(batch_size: 100) do |project|
 
print "#{project.name_with_namespace.yellow} ... "
 
 
if project.namespace
 
puts "yes".green
 
else
 
puts "no".red
 
try_fixing_it(
 
"Migrate global projects"
 
)
 
for_more_information(
 
"doc/update/5.4-to-6.0.md in section \"#global-projects\""
 
)
 
fix_and_rerun
 
end
 
end
 
end
# Helper methods
# Helper methods
########################
########################
@@ -579,6 +613,7 @@ namespace :gitlab do
@@ -579,6 +613,7 @@ namespace :gitlab do
start_checking "Sidekiq"
start_checking "Sidekiq"
check_sidekiq_running
check_sidekiq_running
 
only_one_sidekiq_running
finished_checking "Sidekiq"
finished_checking "Sidekiq"
end
end
@@ -590,7 +625,7 @@ namespace :gitlab do
@@ -590,7 +625,7 @@ namespace :gitlab do
def check_sidekiq_running
def check_sidekiq_running
print "Running? ... "
print "Running? ... "
if run_and_match("ps aux | grep -i sidekiq", /sidekiq \d+\.\d+\.\d+.+$/)
if sidekiq_process_match
puts "yes".green
puts "yes".green
else
else
puts "no".red
puts "no".red
@@ -604,6 +639,29 @@ namespace :gitlab do
@@ -604,6 +639,29 @@ namespace :gitlab do
fix_and_rerun
fix_and_rerun
end
end
end
end
 
 
def only_one_sidekiq_running
 
sidekiq_match = sidekiq_process_match
 
return unless sidekiq_match
 
 
print 'Number of Sidekiq processes ... '
 
if sidekiq_match.length == 1
 
puts '1'.green
 
else
 
puts "#{sidekiq_match.length}".red
 
try_fixing_it(
 
'sudo service gitlab stop',
 
"sudo pkill -u #{gitlab_user} -f sidekiq",
 
"sleep 10 && sudo pkill -9 -u #{gitlab_user} -f sidekiq",
 
'sudo service gitlab start'
 
)
 
fix_and_rerun
 
end
 
end
 
 
def sidekiq_process_match
 
run_and_match("ps ux | grep -i sidekiq", /(sidekiq \d+\.\d+\.\d+.+$)/)
 
end
end
end
@@ -638,10 +696,13 @@ namespace :gitlab do
@@ -638,10 +696,13 @@ namespace :gitlab do
end
end
def sudo_gitlab(command)
def sudo_gitlab(command)
gitlab_user = Gitlab.config.gitlab.user
"sudo -u #{gitlab_user} -H #{command}"
"sudo -u #{gitlab_user} -H #{command}"
end
end
 
def gitlab_user
 
Gitlab.config.gitlab.user
 
end
 
def start_checking(component)
def start_checking(component)
puts "Checking #{component.yellow} ..."
puts "Checking #{component.yellow} ..."
puts ""
puts ""
@@ -657,7 +718,7 @@ namespace :gitlab do
@@ -657,7 +718,7 @@ namespace :gitlab do
end
end
def check_gitlab_shell
def check_gitlab_shell
required_version = Gitlab::VersionInfo.new(1, 7, 0)
required_version = Gitlab::VersionInfo.new(1, 7, 1)
current_version = Gitlab::VersionInfo.parse(gitlab_shell_version)
current_version = Gitlab::VersionInfo.parse(gitlab_shell_version)
print "GitLab Shell version >= #{required_version} ? ... "
print "GitLab Shell version >= #{required_version} ? ... "
Loading