Skip to content

Remove legacy restrictions on the Git installation

Patrick Steinhardt requested to merge pks-git-drop-legacy-functionality into master

What does this MR do and why?

Nowadays Rails doesn't require a Git installation anymore given that all core functionality that did require Git has been moved into Gitaly. There are some exceptions in Rake tasks which import a bare repository or which setup gitlab-workhorse and gitlab-shell, but those aren't core functionality that's required at runtime. We still report the Git version like it was a core component though, and furthermore our health checks require a minimum required Git version (we don't need a minimum required Git version in Rails though) and specific Git configuration (which we don't use nowadays anymore).

This MR removes these legacy restrictions and stops reporting the Git version. This makes it much clearer that Rails doesn't require Git to be installed at all, except for some specific Rake subtasks which aren't typically executed during runtime. Note that we already have such Git-less setups with CNG images, where we don't have Git set up, so this MR only adapts to the reality we already live in.

Ultimately, we should have a look at whether we can convert the Rake tasks to not require Git anymore, either:

  • The "gitlab-workhorse" target is essentially a no-op nowadays given that it's been absorbed into Rails.
  • The "gitlab-shell" target still does its thing. I have no clue what its usecase is though, it feels rather weird to me to expose it as a Rake target. After all, we don't expose targets to build Gitaly or whatever other component, either.
  • The bare-repositories-importer could be converted to use CreateRepositoryFromSnapshot instead, which only needs us to create an archive without using Git. Gitaly would need to introduce hardening for that RPC though given that it currently just extracts the repo into place.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Stan Hu

Merge request reports

Loading