Commit d4862fe2 authored by Nick Thomas's avatar Nick Thomas Committed by Evan Read

Update development documentation for Gitaly

I'm currently working on a change that cuts across both Gitaly and
GitLab. It's been a while since I've done this, and I ran into a couple
of issues that weren't spelled out in the docs. Here's an update.
parent 3e911713
...@@ -27,8 +27,9 @@ have changed since then, it should still serve as a good introduction. ...@@ -27,8 +27,9 @@ have changed since then, it should still serve as a good introduction.
## Beginner's guide ## Beginner's guide
Start by reading the Gitaly repository's Start by reading the Gitaly repository's
[Beginner's guide to Gitaly contributions](https://gitlab.com/gitlab-org/gitaly/blob/master/doc/beginners_guide.md). [Beginner's guide to Gitaly contributions](https://gitlab.com/gitlab-org/gitaly/-/blob/master/doc/beginners_guide.md).
It describes how to set up Gitaly, the various components of Gitaly and what they do, and how to run its test suites. It describes how to set up Gitaly, the various components of Gitaly and what
they do, and how to run its test suites.
## Developing new Git features ## Developing new Git features
...@@ -36,33 +37,17 @@ To read or write Git data, a request has to be made to Gitaly. This means that ...@@ -36,33 +37,17 @@ To read or write Git data, a request has to be made to Gitaly. This means that
if you're developing a new feature where you need data that's not yet available if you're developing a new feature where you need data that's not yet available
in `lib/gitlab/git` changes have to be made to Gitaly. in `lib/gitlab/git` changes have to be made to Gitaly.
> This is a new process that is not clearly defined yet. If you want There should be no new code that touches Git repositories via disk access (for example,
to contribute a Git feature and you're getting stuck, reach out to the Rugged, `git`, `rm -rf`) anywhere in the `gitlab` repository. Anything that
Gitaly team or `@jacobvosmaer-gitlab`. needs direct access to the Git repository *must* be implemented in Gitaly, and
exposed via an RPC.
By 'new feature' we mean any method or class in `lib/gitlab/git` that is It's often easier to develop a new feature in Gitaly if you make the changes to
called from outside `lib/gitlab/git`. For new methods that are called GitLab that will use the new feature in a separate merge request, to be merged
from inside `lib/gitlab/git`, see 'Modifying existing Git features' immediately after the Gitaly one. This allows you to test your changes before
below. they are merged.
There should be no new code that touches Git repositories via - See [below](#running-tests-with-a-locally-modified-version-of-gitaly) for instructions on running GitLab tests with a modified version of Gitaly.
disk access (e.g. Rugged, `git`, `rm -rf`) anywhere outside
`lib/gitlab/git`.
The process for adding new Gitaly features is:
- exploration / prototyping
- design and create a new Gitaly RPC in [`gitaly-proto`](https://gitlab.com/gitlab-org/gitaly-proto)
- release a new version of `gitaly-proto`
- write implementation and tests for the RPC [in Gitaly](https://gitlab.com/gitlab-org/gitaly), in Go or Ruby
- release a new version of Gitaly
- write client code in GitLab CE/EE, GitLab Workhorse or GitLab Shell that calls the new Gitaly RPC
These steps often overlap. It is possible to use an unreleased version
of Gitaly and `gitaly-proto` during testing and development.
- See the [Gitaly repository](https://gitlab.com/gitlab-org/gitaly/blob/master/CONTRIBUTING.md#development-and-testing-with-a-custom-gitaly-proto) for instructions on writing server side code with an unreleased protocol.
- See [below](#running-tests-with-a-locally-modified-version-of-gitaly) for instructions on running GitLab CE tests with a modified version of Gitaly.
- In GDK run `gdk install` and restart `gdk run` (or `gdk run app`) to use a locally modified Gitaly version for development - In GDK run `gdk install` and restart `gdk run` (or `gdk run app`) to use a locally modified Gitaly version for development
### `gitaly-ruby` ### `gitaly-ruby`
...@@ -208,7 +193,7 @@ to manually run `make` again. ...@@ -208,7 +193,7 @@ to manually run `make` again.
Note that CI tests do not use your locally modified version of Note that CI tests do not use your locally modified version of
Gitaly. To use a custom Gitaly version in CI you need to update Gitaly. To use a custom Gitaly version in CI you need to update
GITALY_SERVER_VERSION as described at the beginning of this paragraph. GITALY_SERVER_VERSION as described at the beginning of this section.
To use a different Gitaly repository, e.g., if your changes are present To use a different Gitaly repository, e.g., if your changes are present
on a fork, you can specify a `GITALY_REPO_URL` environment variable when on a fork, you can specify a `GITALY_REPO_URL` environment variable when
...@@ -244,6 +229,9 @@ the branch with the changes (`new-feature-branch`, for example): ...@@ -244,6 +229,9 @@ the branch with the changes (`new-feature-branch`, for example):
1. Run `bundle install` to use the modified RPC client. 1. Run `bundle install` to use the modified RPC client.
Re-run `bundle install` in the `gitlab` project each time the Gitaly branch
changes to embed a new SHA in the `Gemfile.lock` file.
--- ---
[Return to Development documentation](README.md) [Return to Development documentation](README.md)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment