You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
-[7. Turn coffee and documentation into code and documentation!](#7-turn-coffee-and-documentation-into-code-and-documentation)
14
+
-[8. Test, test, test!](#8-test-test-test)
15
+
*[Run the linters.](#run-the-linters)
16
+
*[Run the unit tests.](#run-the-unit-tests)
17
+
*[Run the integration tests.](#run-the-integration-tests)
18
+
-[9. Submit your patch.](#9-submit-your-patch)
19
+
*[Changelog](#changelog)
20
+
+[How do I know what to call the changelog file before I create the PR?](#how-do-i-know-what-to-call-the-changelog-file-before-i-create-the-pr)
21
+
+[Debian changelog](#debian-changelog)
22
+
*[Sign off](#sign-off)
23
+
-[10. Turn feedback into better code.](#10-turn-feedback-into-better-code)
24
+
-[11. Find a new issue.](#11-find-a-new-issue)
25
+
-[Notes for maintainers on merging PRs etc](#notes-for-maintainers-on-merging-prs-etc)
26
+
-[Conclusion](#conclusion)
27
+
28
+
# 1. Who can contribute to Synapse?
2
29
3
30
Everyone is welcome to contribute code to [matrix.org
4
31
projects](https://github.com/matrix-org), provided that they are willing to
@@ -9,70 +36,179 @@ license the code under the same terms as the project's overall 'outbound'
9
36
license - in our case, this is almost always Apache Software License v2 (see
10
37
[LICENSE](LICENSE)).
11
38
12
-
## How to contribute
39
+
# 2. What do I need?
40
+
41
+
The code of Synapse is written in Python 3. To do pretty much anything, you'll need [a recent version of Python 3](https://wiki.python.org/moin/BeginnersGuide/Download).
42
+
43
+
The source code of Synapse is hosted on GitHub. You will also need [a recent version of git](https://github.com/git-guides/install-git).
44
+
45
+
For some tests, you will need [a recent version of Docker](https://docs.docker.com/get-docker/).
46
+
47
+
48
+
# 3. Get the source.
13
49
14
50
The preferred and easiest way to contribute changes is to fork the relevant
15
-
project on github, and then [create a pull request](
51
+
project on GitHub, and then [create a pull request](
16
52
https://help.github.com/articles/using-pull-requests/) to ask us to pull your
If you need help getting started with git, this is beyond the scope of the document, but you
63
+
can find many good git tutorials on the web.
64
+
65
+
# 4. Install the dependencies
20
66
21
-
* Please base your changes on the `develop` branch.
67
+
## Under Unix (macOS, Linux, BSD, ...)
22
68
23
-
* Please follow the [code style requirements](#code-style).
69
+
Once you have installed Python 3 and added the source, please open a terminal and
70
+
setup a *virtualenv*, as follows:
71
+
72
+
```sh
73
+
cd path/where/you/have/cloned/the/repository
74
+
python3 -m venv ./env
75
+
source ./env/bin/activate
76
+
pip install -e ".[all,lint,mypy,test]"
77
+
pip install tox
78
+
```
79
+
80
+
This will install the developer dependencies for the project.
81
+
82
+
## Under Windows
83
+
84
+
TBD
24
85
25
-
* Please include a [changelog entry](#changelog) with each PR.
26
86
27
-
* Please [sign off](#sign-off) your contribution.
87
+
# 5. Get in touch.
28
88
29
-
* Please keep an eye on the pull request for feedback from the [continuous
30
-
integration system](#continuous-integration-and-testing) and try to fix any
31
-
errors that come up.
89
+
Join our developer community on Matrix: #synapse-dev:matrix.org !
32
90
33
-
* If you need to [update your PR](#updating-your-pull-request), just add new
34
-
commits to your branch rather than rebasing.
35
91
36
-
## Code style
92
+
# 6. Pick an issue.
93
+
94
+
Fix your favorite problem or perhaps find a [Good First Issue](https://github.com/matrix-org/synapse/issues?q=is%3Aopen+is%3Aissue+label%3A%22Good+First+Issue%22)
95
+
to work on.
96
+
97
+
98
+
# 7. Turn coffee and documentation into code and documentation!
37
99
38
100
Synapse's code style is documented [here](docs/code_style.md). Please follow
39
101
it, including the conventions for the [sample configuration
If your tests fail, you may wish to look at the logs:
177
+
178
+
```sh
179
+
less _trial_temp/test.log
180
+
```
181
+
182
+
## Run the integration tests.
183
+
184
+
The integration tests are a more comprehensive suite of tests. They
185
+
run a full version of Synapse, including your changes, to check if
186
+
anything was broken. They are slower than the unit tests but will
187
+
typically catch more errors.
188
+
189
+
The following command will let you run the integration test with the most common
190
+
configuration:
191
+
192
+
```sh
193
+
$ docker run --rm -it -v /path/where/you/have/cloned/the/repository\:/src:ro -v /path/to/where/you/want/logs\:/logs matrixdotorg/sytest-synapse:py37
194
+
```
195
+
196
+
This configuration should generally cover your needs. For more details about other configurations, see [documentation in the SyTest repo](https://github.com/matrix-org/sytest/blob/develop/docker/README.md).
197
+
69
198
70
-
Before pushing new changes, ensure they don't produce linting errors. Commit any
71
-
files that were corrected.
199
+
# 9. Submit your patch.
200
+
201
+
Once you're happy with your patch, it's time to prepare a Pull Request.
202
+
203
+
To prepare a Pull Request, please:
204
+
205
+
1. verify that [all the tests pass](#test-test-test), including the coding style;
206
+
2.[sign off](#sign-off) your contribution;
207
+
3.`git push` your commit to your fork of Synapse;
208
+
4. on GitHub, [create the Pull Request](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request);
209
+
5. add a [changelog entry](#changelog) and push it to your Pull Request;
210
+
6. for most contributors, that's all - however, if you are a member of the organization `matrix-org`, on GitHub, please request a review from `matrix.org / Synapse Core`.
72
211
73
-
Please ensure your changes match the cosmetic style of the existing project,
74
-
and **never** mix cosmetic and functional changes in the same commit, as it
75
-
makes it horribly hard to review otherwise.
76
212
77
213
## Changelog
78
214
@@ -156,24 +292,6 @@ directory, you will need both a regular newsfragment *and* an entry in the
156
292
debian changelog. (Though typically such changes should be submitted as two
157
293
separate pull requests.)
158
294
159
-
## Documentation
160
-
161
-
There is a growing amount of documentation located in the [docs](docs)
162
-
directory. This documentation is intended primarily for sysadmins running their
163
-
own Synapse instance, as well as developers interacting externally with
164
-
Synapse. [docs/dev](docs/dev) exists primarily to house documentation for
0 commit comments