blob: ce947a6b759a0de246d639cf798e2adb4b418d54 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
# `gitaly-ruby`
`gitaly-ruby` is a 'sidecar' process for the main Gitaly service. It
allows us to run legacy Ruby application code for which it would be
too risky or even infeasible to port it to Go. It will also speed up
the Gitaly migration project.
## Architecture
Gitaly-ruby is a minimal Ruby gRPC service which should only receive
requests from its (Go) parent Gitaly process. The Gitaly parent
handles authentication, logging, metrics, configuration file parsing
etc.
The Gitaly parent is also responsible for starting and (if necessary)
restarting Gitaly-ruby.
## Authentication
Gitaly-ruby listens on a Unix socket in a temporary directory with
mode 0700. It runs as the same user as the Gitaly parent process.
## Testing
There are three sets of test that exercise gitaly-ruby:
- Top-level Go integration tests
- Rspec integration tests (`spec/gitaly`)
- Rspec unit tests (`spec/lib`)
If you are working on the Ruby code and you want to run the Rspec
tests only, without recompiling the Go parts then do the following:
- run `make rspec` at the top level at least once, to compile Go binaries and get the test repo;
- edit code under the current directory (`ruby`);
- run `bundle exec rspec` in the current directory.
## Vendored copy of Gitlab::Git
`gitaly-ruby` contains a vendored copy of `lib/gitlab/git` from
https://gitlab.com/gitlab-org/gitlab-ce. This allows us to share code
between gitlab-ce / gitlab-ee and `gitaly-ruby`.
To update the vendored copy of Gitlab::Git, run
`_support/vendor-gitlab-git COMMIT_ID` from the root of the Gitaly
repository.
## Development
Gitaly-ruby is only meant to be spawned by Gitaly itself. But, during
development you may want to try spawning it in a terminal yourself.
You can do that with the following incantation:
```shell
sh -c 'bin/gitaly-ruby $$ tmp/socket & wait'
```
|