Skip to content

Absorb gitlab-shell/hooks into Gitaly

If you found this page because of an error "The gitlab-shell hooks have been migrated to Gitaly"

Your Git version is out of date: it does not support the core.hooksPath setting. See https://gitlab.com/gitlab-org/gitaly/tree/master#installation for the current Git version required by Gitaly.


Plan:

Stage 1: code only (config stays in gitlab-shell): DONE !1130 (merged)

  • make preparatory fixes based on !1010 (closed)
  • re-vendor with embedded hooks behind a gitaly "feature flag" (environment variable)
  • integrate upstream (gitlab-ce, omnibus etc.) to look for trouble
  • fix trouble
  • remove feature flag
  • stop vendoring: all future changes to hooks must happen in gitaly repo

Stage 2: migrate config

  • Add config fields go gitaly/config.toml so we know enough to make the hooks do their job (e.g. internal gitlab api url), with fallback to gitlab-shell/config.yml
  • Start making omnibus changes to get new config rendered into gitaly/config.toml
  • ?? Fix source install and CNG ??
  • Remove gitlab-shell/config.yml fallback
  • first step: migrate gitlab-shell logging config #1621 (closed)

Previous text:

Follow-up to #713 (closed).

We can only do this once gitlab-rails no longer creates commits via direct disk access (i.e. when merging a MR).

From an architecture viewpoint, the Git hooks in gitlab-shell/hooks belong to Gitaly. They will only run on Gitaly servers; it makes no sense to have to install gitlab-shell on Gitaly servers just for that.

The first iteration is making the hooks self healing, so we can change the location at any point in time after. This is being done in !886 (merged)

Edited by Chad Woolley
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information