From 1ed9d219191d19125defe1f6c0e5455e6dacdb8d Mon Sep 17 00:00:00 2001 From: Zeger-Jan van de Weg Date: Tue, 13 Oct 2020 12:23:35 +0200 Subject: hooks: Check command ported to Go GitLab-Shell has `bin/check` as a small utility to check the API access required for the hooks. These hooks are now managed by Gitaly, and gitaly-hooks has a subcommand `check` too. This subcommend used to invoke `bin/check` from the vendored `gitlab-shell`. This change ports the logic to Go, and removes `bin/check`. It depends on the same config values that the hooks depend on, which wasn't always true, but usually was just because of Omnibus configuration reconfiguration. --- internal/testhelper/testserver.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'internal/testhelper/testserver.go') diff --git a/internal/testhelper/testserver.go b/internal/testhelper/testserver.go index ce2e85f82..741b69870 100644 --- a/internal/testhelper/testserver.go +++ b/internal/testhelper/testserver.go @@ -874,16 +874,16 @@ func WriteTemporaryGitlabShellConfigFile(t FatalLogger, dir string, config Gitla // WriteTemporaryGitalyConfigFile writes a gitaly toml file into a temporary directory. It returns the path to // the file as well as a cleanup function -func WriteTemporaryGitalyConfigFile(t testing.TB, tempDir, gitlabURL, user, password string) (string, func()) { +func WriteTemporaryGitalyConfigFile(t testing.TB, tempDir, gitlabURL, user, password, secretFile string) (string, func()) { path := filepath.Join(tempDir, "config.toml") contents := fmt.Sprintf(` -[gitlab-shell] - dir = "%s/gitlab-shell" - gitlab_url = %q - [gitlab-shell.http-settings] +[gitlab] + url = "%s" + secret_file = "%s" + [gitlab.http-settings] user = %q password = %q -`, tempDir, gitlabURL, user, password) +`, gitlabURL, secretFile, user, password) require.NoError(t, ioutil.WriteFile(path, []byte(contents), 0644)) return path, func() { -- cgit v1.2.3