Skip to content

Prepare test suite for switch to Gitaly-embedded Git hooks

Jacob Vosmaer requested to merge ci-use-gitaly-embedded-hooks into master

What does this MR do?

GitLab uses Git hooks to perform checks and notifications while receiving a git push. The actual hook executables live in the gitlab-org/gitlab-shell repository but we are trying to move them over to the gitlab-org/gitaly repository (gitaly#1226 (closed)).

Because the hooks try to make API calls to the internal GitLab API, which is not available during rspec, we intentionally sabotage the Git hooks during the gitlab-ce/ee test suite. This MR updates the sabotage mechanism to sabotage the Git hooks both in the old location tmp/tests/gitlab-shell/hooks and in the future location tmp/tests/gitaly/ruby/git-hooks.

This is preparation for gitaly!1088 (merged) where we will do a partial switch to hooks at the new location (tmp/tests/gitaly/ruby/git-hooks).

During review we ran into Gitlab.config.gitlab_shell.hooks_path which is a gitlab-ce configuration value that is ignored by Gitaly. Because Gitaly is the thing that connects repositories to the GitLab git hooks, and Gitaly ignores this setting, that means it is useless. So this MR removes that setting.

What are the relevant issue numbers?

Part of gitaly#1226 (closed).

Does this MR meet the acceptance criteria?

Edited by Jacob Vosmaer

Merge request reports