Remove all support for passing repository paths as absolute paths on disk
gitlab-shell has fallback support in a number of places that uses Dir.pwd
to determine the repository path.
However, with the introduction of both gitaly and hashed storage, these code paths are legacy. We use the project full_path
(lfs authentication, for instance) or the gl_repository
key instead, to communicate to Gitaly or GitLab which repository we want to take action on.
I propose we modify gitlab-shell to remove all sites that might fall back to an absolute path on disk. They should be dead code at this point. We can then modify gitlab-rails and gitaly (if necessary) to remove legacy support for parameters of this form.
An example:
https://gitlab.com/gitlab-org/gitlab-shell/blob/master/hooks/pre-receive#L9
In all places, the repo_path
is shadowed by the value that was in GL_REPOSITORY
. It should be an error to run without this envvar being set.
Simplifying the Ruby code now will also simplify any future rewrite into something that starts up more quickly, as there will be fewer code paths to replicate.