Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2020-12-08 17:31:40 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2020-12-10 15:45:31 +0300
commit12adbd9488916e8982f0ba64da2df6020db521dd (patch)
treee751e7ec4966a1b8884bd18d6887dd0b0a885b83
parent9923437fb8c09288e77a6454f0bef742fb70b36a (diff)
hooks: Remove GITALY_LOG_FORMAT/LEVEL from environment
We currently have three variables which originally configured the log level, format and directory for Ruby hooks. Except for the GITALY_LOG_DIR variable which our Go hooks use to optionally enable logging, they aren't used at all anymore. Remove the unused GITALY_LOG_FORMAT and GITALY_LOG_LEVEL variables from the environment.
-rw-r--r--internal/gitlabshell/env.go2
-rw-r--r--internal/gitlabshell/env_test.go2
-rw-r--r--ruby/lib/gitlab/config.rb8
-rw-r--r--ruby/lib/gitlab/git/hook.rb2
4 files changed, 0 insertions, 14 deletions
diff --git a/internal/gitlabshell/env.go b/internal/gitlabshell/env.go
index b491c9374..8fd549075 100644
--- a/internal/gitlabshell/env.go
+++ b/internal/gitlabshell/env.go
@@ -40,8 +40,6 @@ func EnvFromConfig(cfg config.Cfg) ([]string, error) {
//TODO: remove GITALY_GITLAB_SHELL_DIR: https://gitlab.com/gitlab-org/gitaly/-/issues/2679
"GITALY_GITLAB_SHELL_DIR=" + cfg.GitlabShell.Dir,
fmt.Sprintf("%s=%s", log.GitalyLogDirEnvKey, cfg.Logging.Dir),
- "GITALY_LOG_FORMAT=" + cfg.Logging.Format,
- "GITALY_LOG_LEVEL=" + cfg.Logging.Level,
"GITALY_BIN_DIR=" + cfg.BinDir,
"GITALY_GITLAB_SHELL_CONFIG=" + string(gitlabShellConfigString),
}, nil
diff --git a/internal/gitlabshell/env_test.go b/internal/gitlabshell/env_test.go
index 3707ea5ca..39dd3c2d2 100644
--- a/internal/gitlabshell/env_test.go
+++ b/internal/gitlabshell/env_test.go
@@ -47,8 +47,6 @@ func TestGitHooksConfig(t *testing.T) {
require.Contains(t, env, "GITALY_GITLAB_SHELL_DIR="+config.Config.GitlabShell.Dir)
require.Contains(t, env, "GITALY_LOG_DIR="+config.Config.Logging.Dir)
- require.Contains(t, env, "GITALY_LOG_FORMAT="+config.Config.Logging.Format)
- require.Contains(t, env, "GITALY_LOG_LEVEL="+config.Config.Logging.Level)
require.Contains(t, env, "GITALY_BIN_DIR="+config.Config.BinDir)
jsonShellConfig := ""
diff --git a/ruby/lib/gitlab/config.rb b/ruby/lib/gitlab/config.rb
index 498d419ad..184d083ff 100644
--- a/ruby/lib/gitlab/config.rb
+++ b/ruby/lib/gitlab/config.rb
@@ -81,14 +81,6 @@ module Gitlab
def dir
@dir ||= ENV['GITALY_LOG_DIR']
end
-
- def level
- @level ||= ENV['GITALY_LOG_LEVEL']
- end
-
- def format
- @format ||= ENV['GITALY_LOG_FORMAT']
- end
end
def git
diff --git a/ruby/lib/gitlab/git/hook.rb b/ruby/lib/gitlab/git/hook.rb
index afc550c9d..7a8215304 100644
--- a/ruby/lib/gitlab/git/hook.rb
+++ b/ruby/lib/gitlab/git/hook.rb
@@ -132,8 +132,6 @@ module Gitlab
'GITALY_GITLAB_SHELL_DIR' => Gitlab.config.gitlab_shell.path,
'GITLAB_SHELL_DIR' => Gitlab.config.gitlab_shell.path,
'GITALY_LOG_DIR' => Gitlab.config.logging.dir,
- 'GITALY_LOG_LEVEL' => Gitlab.config.logging.level,
- 'GITALY_LOG_FORMAT' => Gitlab.config.logging.format,
'GITALY_BIN_DIR' => Gitlab.config.gitaly.bin_dir,
'GL_ID' => gl_id,
'GL_USERNAME' => gl_username,