Commit 9d036a37 authored by Patrick Steinhardt's avatar Patrick Steinhardt

system_check: Remove Git version check

We're currently requiring a Git version of at least v2.33.0, which is in
fact the same minimum required Git version as required by Gitaly. This
is not a sensible check to have though: the requirement stems back from
the days when Rails still executed Git commands to serve and modify
repos, and we don't do that nowadays anymore. In fact, Rails is in a
perfectly good shape even when no Git version is installed at all. The
CNG images serve as a point in case: they do not have Git installed.

There are some exceptions where we still do execute Git commands, which
are some of Rails tasks to set up gitlab-shell and gitlab-workhorse and
to import bare repositories. None of these require any specific version
of Git though, but would work just as well with ancient versions of Git.

Drop the Git version check completely. It's misleading and ultimately
doesn't reflect reality.

Changelog: removed
parent 469849c3
# frozen_string_literal: true
module SystemCheck
module App
class GitVersionCheck < SystemCheck::BaseCheck
set_name -> { "Git version >= #{self.required_version} ?" }
set_check_pass -> { "yes (#{self.current_version})" }
def self.required_version
@required_version ||= Gitlab::VersionInfo.parse('2.33.0')
end
def self.current_version
@current_version ||= Gitlab::VersionInfo.parse(Gitlab::TaskHelpers.run_command(%W(#{Gitlab.config.git.bin_path} --version)))
end
def check?
self.class.current_version.valid? && self.class.required_version <= self.class.current_version
end
def show_error
$stdout.puts "Your git bin path is \"#{Gitlab.config.git.bin_path}\""
try_fixing_it(
"Update your git to a version >= #{self.class.required_version} from #{self.class.current_version}"
)
fix_and_rerun
end
end
end
end
...@@ -27,7 +27,6 @@ module SystemCheck ...@@ -27,7 +27,6 @@ module SystemCheck
SystemCheck::App::ProjectsHaveNamespaceCheck, SystemCheck::App::ProjectsHaveNamespaceCheck,
SystemCheck::App::RedisVersionCheck, SystemCheck::App::RedisVersionCheck,
SystemCheck::App::RubyVersionCheck, SystemCheck::App::RubyVersionCheck,
SystemCheck::App::GitVersionCheck,
SystemCheck::App::GitUserDefaultSSHConfigCheck, SystemCheck::App::GitUserDefaultSSHConfigCheck,
SystemCheck::App::ActiveUsersCheck, SystemCheck::App::ActiveUsersCheck,
SystemCheck::App::AuthorizedKeysPermissionCheck, SystemCheck::App::AuthorizedKeysPermissionCheck,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment