diff options
author | James Fargher <proglottis@gmail.com> | 2022-01-26 23:08:18 +0300 |
---|---|---|
committer | James Fargher <proglottis@gmail.com> | 2022-01-26 23:08:18 +0300 |
commit | 440ad2b355bdbcf1d2b21ea63be40fddfc788d86 (patch) | |
tree | 60108cf56129b768b4869316373e262620f9406c | |
parent | 66a4a9452e0ee27a29dd36fffe98ea04dab8ae24 (diff) | |
parent | 9d39c59ff546a09b4b5f08eba48d0a841b634328 (diff) |
Merge branch 'toon-bundle-user-config' into 'master'
rubyserver: Pass on BUNDLE_USER_CONFIG if set
See merge request gitlab-org/gitaly!4267
-rw-r--r-- | internal/gitaly/linguist/linguist.go | 2 | ||||
-rw-r--r-- | internal/gitaly/linguist/linguist_test.go | 14 | ||||
-rw-r--r-- | internal/gitaly/rubyserver/rubyserver.go | 1 |
3 files changed, 16 insertions, 1 deletions
diff --git a/internal/gitaly/linguist/linguist.go b/internal/gitaly/linguist/linguist.go index 64e1c1274..fdd7ee6e7 100644 --- a/internal/gitaly/linguist/linguist.go +++ b/internal/gitaly/linguist/linguist.go @@ -15,7 +15,7 @@ import ( "gitlab.com/gitlab-org/gitaly/v14/internal/gitaly/config" ) -var exportedEnvVars = []string{"HOME", "PATH", "GEM_HOME", "BUNDLE_PATH", "BUNDLE_APP_CONFIG"} +var exportedEnvVars = []string{"HOME", "PATH", "GEM_HOME", "BUNDLE_PATH", "BUNDLE_APP_CONFIG", "BUNDLE_USER_CONFIG"} // Language is used to parse Linguist's language.json file. type Language struct { diff --git a/internal/gitaly/linguist/linguist_test.go b/internal/gitaly/linguist/linguist_test.go index ca59a328c..93e690b02 100644 --- a/internal/gitaly/linguist/linguist_test.go +++ b/internal/gitaly/linguist/linguist_test.go @@ -16,6 +16,20 @@ func TestMain(m *testing.M) { testhelper.Run(m) } +func TestInstance_Stats_successful(t *testing.T) { + ctx, cancel := testhelper.Context() + defer cancel() + + cfg, _, repoPath := testcfg.BuildWithRepo(t) + + ling, err := New(cfg, gittest.NewCommandFactory(t, cfg)) + require.NoError(t, err) + + counts, err := ling.Stats(ctx, repoPath, "1e292f8fedd741b75372e19097c76d327140c312") + require.NoError(t, err) + require.Equal(t, uint64(2943), counts["Ruby"]) +} + func TestInstance_Stats_unmarshalJSONError(t *testing.T) { cfg := testcfg.Build(t) diff --git a/internal/gitaly/rubyserver/rubyserver.go b/internal/gitaly/rubyserver/rubyserver.go index 34ac20f11..c64f183ab 100644 --- a/internal/gitaly/rubyserver/rubyserver.go +++ b/internal/gitaly/rubyserver/rubyserver.go @@ -62,6 +62,7 @@ func setupEnv(cfg config.Cfg, gitCmdFactory git.CommandFactory) []string { env = append(env, command.GitEnv...) env = append(env, gitExecEnv.EnvironmentVariables...) env = appendEnvIfSet(env, "BUNDLE_PATH") + env = appendEnvIfSet(env, "BUNDLE_USER_CONFIG") env = appendEnvIfSet(env, "GEM_HOME") if dsn := cfg.Logging.RubySentryDSN; dsn != "" { |