Establish mechanism for communication between CE/EE and git-access-daemon
One of the things that is not clear to me yet is how GitLab will interact with this project. Some options are:
Make the client a git binary substitute
Pros:
- Completely transparent for our current workflow, minimum adjustment needed.
- Makes sure you don't miss any points where git is accessed (for example if you were to just look for
Gitlab::Git
classes you'd miss things likepopen('git ...')
)
Cons:
- Obfuscated: Not very clear that you're actually going now through an API instead of to the filesystem. This is the other side of the "Pro" of a transparent workflow: you should probably approach an API call different than a FS access on your code. Although, as @pcarranza noted somewhere else, you're actually going through a network anyways because our FS is distributed.
- Error handling becomes a bit more awkward, having to read status from the command output
Refactor app/models/repository.rb to be the client
Pros:
- Clear and cleaner architecture: GitLab -> git-access-daemon, no middleman, so the CE code can handle neatly all caveats and errors.
Cons:
- You have to be extra careful to refactor everything (double check EE, if we go down this route we'll miss something there), since an unhandled git access could lead to inconsistencies.
- We introduce some complexity to CE (an API client), which goes against what we're trying to do.
Make gitlab_git the client
Pros:
- You'd refactor gitlab_git, but GitLab CE/EE would require no big changes except for removing all caching logic
Cons:
- Subjective, but this options seems awkward to me. It seems like relying on a component our solution should be getting rid of. But it might actually make sense if you stop seeing gitlab_git as a library and start seeing it as an adapter.