Skip to content

Commit d697469

Browse files
committed
docs: clarify git strategy in CONTRIBUDING.md
1 parent 8445050 commit d697469

File tree

1 file changed

+30
-45
lines changed

1 file changed

+30
-45
lines changed

CONTRIBUTING.md

Lines changed: 30 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,28 @@ If you ever get stuck, reach out on [Discord](https://discord.com/invite/zerRaGK
1414

1515
---
1616

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+
1739
## How to submit a Pull Request
1840

1941
> **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
3658
pre-commit install
3759
```
3860

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.
4462

4563
5. **Make your changes** (and add tests when relevant).
4664

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)
7366

74-
10. **Commit** (signed):
67+
7. **Sign** your commits and push your branch.
7568

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.
7970

80-
If *pre-commit* complains, fix the problems and repeat **5 – 9**.
71+
9. **Iterate** on any feedback you receive.
8172

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.*
8974

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.
9176

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

Comments
 (0)