Welcome to mirror list, hosted at ThFree Co, Russian Federation.

README.md « ruby - gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 54fea399efd1c52b532fad9ce5fd49ad3d5e5652 (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
# `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 was introduced to
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.

## 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'
```