Add a startup check for Git hook existence
It is a configuration error to run Gitaly without access to its pre-receive
, update
and post-receive
git hooks. For test purposes it is currently not an error to run Gitaly without these hooks; they will get skipped. But in production installations this is a configuration error resulting in issues such as https://gitlab.com/gitlab-org/gitlab-ce/issues/59403.
Considering that we now have an explicit mechanism for tests to signal that they don't want hooks https://godoc.org/gitlab.com/gitlab-org/gitaly/internal/git/hooks#Path GITALY_TESTING_NO_GIT_HOOKS=1
, we should be able to change Gitaly's behavior to be more strict.
-
update the gitlab-ce tests to use GITALY_TESTING_NO_GIT_HOOKS=1 in scripts/gitaly_test.rb and no longer delete hooks -
add a check during gitaly startup that asserts the three hook executables exist (i.e. that the files exist and that they are executable ( filemode & 0755 >= 0755
)
Edited by Zeger-Jan van de Weg