Skip to content

Ignore global git configuration and remove HOME overriding in tests

Sami Hiltunen requested to merge smh-remove-home-hack into master
  • Gitaly is currently using the global configuration for git. This can cause problems as the configuration may contain config that breaks the assumptions Gitaly is making. This commit ignores the global configuration for git so the only config considered is what Gitaly explicitly sets.

  • AllowedEnvironment currently overrides any variables set by the test. In order to override some of the variables, one would have to set an environment variable which would be a global change. Change the order of how the environment variables are collected so the command invocation can override environment variables.

  • Gitaly's tests are overriding the HOME environment variable. This was originally done to prevent loading the global configuration in Gitaly tests which caused problems on some developer machines. The hack itself causes bunch of other issues though. Anything that relies on HOME breaks, such as asdf shimmed Ruby installations. Likewise, the GDK database auto-discovery in the tests breaks. There's been some work around added for Go to avoid changing the location of the cache directories.

    The approach is inherently flawed. Since then, Git has introduced environment variables that allow for ignoring the global configuration. Gitaly is now ignoring the global configuration using them, so we can remove the HOME overriding hack from the tests.

Closes #3028 (closed)
Closes #3320 (closed)

Edited by Sami Hiltunen

Merge request reports