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
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+30-45Lines changed: 30 additions & 45 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,28 @@ If you ever get stuck, reach out on [Discord](https://discord.com/invite/zerRaGK
14
14
15
15
---
16
16
17
+
## Git Strategy
18
+
19
+
The idea is to follow basic "trunk based development" strategy.
20
+
21
+
We consider that the `main` branch is the one that is production ready and always up to date.
22
+
23
+
When submitting a PR for review, the history should be clean and linear, containing **only** the changes that are being reviewed. Thus, if there are changes on the target branch, the PR should be rebased on top of it. This makes it easier to both review and understand the changes, reducing overall overhead. Consider the history to be part of the PR, not just a side-effect of git.
24
+
25
+
If there are conflicts, they will then have to be resolved locally.
26
+
27
+
When merging a PR, we will use the `squash` option with a linear history, reducing the entire PR into a single commit. This will force PRs to focus on one feature or bug fix at a time.
28
+
29
+
**tldr:**
30
+
31
+
- PRs should be *rebased* on the target branch
32
+
- target branch should *not* be merged back into the PR
33
+
- only tackle one thing at a time
34
+
35
+
**NB:** There is currently a bug in GitHub where using the `rebase` option on the website will remove the gpg signature of the commits. They don't seem to be planning on fixing it so we will need to do it locally and then force-push the PR.
36
+
37
+
---
38
+
17
39
## How to submit a Pull Request
18
40
19
41
> **Prerequisites**: The project uses **Python 3.9+** and `pre-commit` for development.
@@ -36,57 +58,20 @@ If you ever get stuck, reach out on [Discord](https://discord.com/invite/zerRaGK
36
58
pre-commit install
37
59
```
38
60
39
-
4.**Create a branch** for your changes:
40
-
41
-
```bash
42
-
git checkout -b your-branch
43
-
```
61
+
4.**Create a branch** for your changes.
44
62
45
63
5.**Make your changes** (and add tests when relevant).
46
64
47
-
6.**Stage** the changes:
48
-
49
-
```bash
50
-
git add .
51
-
```
52
-
53
-
7.**Run the backend test suite**:
54
-
55
-
```bash
56
-
pytest
57
-
```
58
-
59
-
8.*(Optional)***Run `pre-commit` on all files** to check hooks without committing:
60
-
61
-
```bash
62
-
pre-commit run --all-files
63
-
```
64
-
65
-
9.**Run the local server** to sanity-check:
66
-
67
-
```bash
68
-
cd src
69
-
uvicorn server.main:app
70
-
```
71
-
72
-
Open [http://localhost:8000](http://localhost:8000) to confirm everything works.
65
+
6. Run the local server and tests to sanity-check (these will run automatically in the CI/CD pipelines, but it's good to check locally as well)
73
66
74
-
10. **Commit**(signed):
67
+
7.**Sign**your commits and push your branch.
75
68
76
-
```bash
77
-
git commit -S -m "Your commit message"
78
-
```
69
+
8.**Open a pull request** on GitHub with a clear description of your changes.
79
70
80
-
If *pre-commit* complains, fix the problems and repeat **5 – 9**.
71
+
9.**Iterate** on any feedback you receive.
81
72
82
-
11. **Push** your branch:
83
-
84
-
```bash
85
-
git push origin your-branch
86
-
```
87
-
88
-
12. **Open a pull request** on GitHub with a clear description.
73
+
*(Optional) Invite a maintainer to your branch for easier collaboration.*
89
74
90
-
13. **Iterate** on any review feedback—update your branch and repeat **6 – 11** as needed.
75
+
Do not hesitate to ask for help if you get stuck, either here or on the Discord server.
91
76
92
-
*(Optional) Invite a maintainer to your branch for easier collaboration.*
77
+
Keep in mind that we are a small team and we will do our best to review your changes as soon as possible.
0 commit comments