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
+ 6
4
Compare changes
  • Side-by-side
  • Inline
+ 73
12
@@ -22,6 +22,7 @@ namespace :gitlab do
check_tmp_writable
check_init_script_exists
check_init_script_up_to_date
check_projects_have_namespace
check_satellites_exist
check_redis_version
check_git_version
@@ -288,7 +289,6 @@ namespace :gitlab do
########################
def check_gitlab_git_config
gitlab_user = Gitlab.config.gitlab.user
print "Git configured for #{gitlab_user} user? ... "
options = {
@@ -391,14 +391,20 @@ namespace :gitlab do
hook_file = "update"
gitlab_shell_hooks_path = Gitlab.config.gitlab_shell.hooks_path
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)
puts "can't check because of previous errors".magenta
return
if File.exists?(gitlab_shell_hook_file)
puts "yes".green
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
puts "yes".green
end
def check_repo_base_exists
@@ -479,11 +485,13 @@ namespace :gitlab do
return
end
if File.stat(repo_base_path).uid == uid_for(gitlab_shell_ssh_user) &&
File.stat(repo_base_path).gid == gid_for(gitlab_shell_owner_group)
uid = uid_for(gitlab_shell_ssh_user)
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
else
puts "no".red
puts " User id for #{gitlab_shell_ssh_user}: #{uid}. Groupd id for #{gitlab_shell_owner_group}: #{gid}".blue
try_fixing_it(
"sudo chown -R #{gitlab_shell_ssh_user}:#{gitlab_shell_owner_group} #{repo_base_path}"
)
@@ -550,6 +558,32 @@ namespace :gitlab do
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
########################
@@ -579,6 +613,7 @@ namespace :gitlab do
start_checking "Sidekiq"
check_sidekiq_running
only_one_sidekiq_running
finished_checking "Sidekiq"
end
@@ -590,7 +625,7 @@ namespace :gitlab do
def check_sidekiq_running
print "Running? ... "
if run_and_match("ps aux | grep -i sidekiq", /sidekiq \d+\.\d+\.\d+.+$/)
if sidekiq_process_match
puts "yes".green
else
puts "no".red
@@ -604,6 +639,29 @@ namespace :gitlab do
fix_and_rerun
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
@@ -638,10 +696,13 @@ namespace :gitlab do
end
def sudo_gitlab(command)
gitlab_user = Gitlab.config.gitlab.user
"sudo -u #{gitlab_user} -H #{command}"
end
def gitlab_user
Gitlab.config.gitlab.user
end
def start_checking(component)
puts "Checking #{component.yellow} ..."
puts ""
@@ -657,7 +718,7 @@ namespace :gitlab do
end
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)
print "GitLab Shell version >= #{required_version} ? ... "
Loading