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: docs/developer-guide/contributing.md
+29-30
Original file line number
Diff line number
Diff line change
@@ -8,24 +8,22 @@ There are three ways to contribute to Concrete ML:
8
8
9
9
## 1. Setting up the project
10
10
11
-
First, you need to properly set up the project by following the steps provided [here](project_setup.md).
11
+
First, you need to [fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) the [Concrete ML](https://github.com/zama-ai/concrete-ml) repository and properly set up the project by following the steps provided [here](project_setup.md).
12
12
13
13
## 2. Creating a new branch
14
14
15
-
To create your branch, you have to use the issue ID somewhere in the branch name:
15
+
When creating your branch, make sure the name follows the expected format :
@@ -38,29 +36,30 @@ Each commit to Concrete ML should conform to the standards of the project. You c
38
36
make conformance
39
37
```
40
38
41
-
Conformance can be checked using the following command:
39
+
Additionally, you will need to make sure that the following command does not return any error (`pcc`: pre-commit checks):
42
40
43
41
```shell
44
42
make pcc
45
43
```
46
44
47
45
### 3.2 Testing
48
46
49
-
Your code must be well documented, containing tests and not breaking other tests:
47
+
Your code must be well documented, provide extensive tests if any feature has been added and must not break other tests.
48
+
To execute all tests, please run the following command. Be aware that running all tests can take up to an hour.
50
49
51
50
```shell
52
51
make pytest
53
52
```
54
53
55
54
You need to make sure you get 100% code coverage. The `make pytest` command checks that by default and will fail with a coverage report at the end should some lines of your code not be executed during testing.
56
55
57
-
If your coverage is below 100%, you should write more tests and then create the pull request. If you ignore this warning and create the PR, GitHub actions will fail and your PR will not be merged.
56
+
If your coverage is below 100%, you should write more tests and then create the pull request. If you ignore this warning and create the PR, checks will fail and your PR will not be merged.
58
57
59
58
There may be cases where covering your code is not possible (an exception that cannot be triggered in normal execution circumstances). In those cases, you may be allowed to disable coverage for some specific lines. This should be the exception rather than the rule, and reviewers will ask why some lines are not covered. If it appears they can be covered, then the PR won't be accepted in that state.
60
59
61
60
## 4. Committing
62
61
63
-
Concrete ML uses a consistent commit naming scheme, and you are expected to follow it as well (the CI will make sure you do). The accepted format can be printed to your terminal by running:
62
+
Concrete ML uses a consistent commit naming scheme and you are expected to follow it as well. The accepted format can be printed to your terminal by running:
64
63
65
64
```shell
66
65
make show_scope
@@ -69,39 +68,39 @@ make show_scope
69
68
For example:
70
69
71
70
```shell
72
-
git commit -m "feat: implement bounds checking"
73
-
git commit -m "feat(debugging): add an helper function to draw intermediate representation"
74
-
git commit -m "fix(tracing): fix a bug that crashed PyTorch tracer"
71
+
git commit -m "feat: support AVGPool2d operator"
72
+
git commit -m "fix: fix AVGPool2d operator"
75
73
```
76
74
77
-
Just a reminder that commit messages are checked in the conformance step and are rejected if they don't follow the rules. To learn more about conventional commits, check [this](https://www.conventionalcommits.org/en/v1.0.0/) page.
75
+
Just a reminder that commit messages are checked in the conformance step and are rejected if they don't follow the rules. To learn more about conventional commits, check [this page](https://www.conventionalcommits.org/en/v1.0.0/).
78
76
79
77
## 5. Rebasing
80
78
81
-
You should rebase on top of the `main` branch before you create your pull request. Merge commits are not allowed, so rebasing on `main` before pushing gives you the best chance of to avoid rewriting parts of your PR later if conflicts arise with other PRs being merged. After you commit changes to your new branch, you can use the following commands to rebase:
79
+
You should rebase on top of the repository's `main` branch before you create your pull request. Merge commits are not allowed, so rebasing on `main` before pushing gives you the best chance of to avoid rewriting parts of your PR later if conflicts arise with other PRs being merged. After you commit changes to your forked repository, you can use the following commands to rebase your main branch with Concrete ML's one:
82
80
83
81
```shell
84
-
#fetch the list of active remote branches
85
-
git fetch --all --prune
82
+
#Add the Concrete ML repository as remote, named "upstream"
# pull the latest changes to main (--ff-only is there to prevent accidental commits to main)
91
-
git pull --ff-only
85
+
# Fetch all last branches and changes from Concrete ML
86
+
git fetch upstream
92
87
93
-
#checkout back to your branch
94
-
git checkout $YOUR_BRANCH
88
+
#Checkout to your local main branch
89
+
git checkout main
95
90
96
-
#rebase on top of main branch
97
-
git rebase main
91
+
#Rebase on top of main
92
+
git rebase upstream/main
98
93
99
94
# If there are conflicts during the rebase, resolve them
100
95
# and continue the rebase with the following command
101
96
git rebase --continue
102
97
103
-
#push the latest version of the local branch to remote
104
-
git push --force
98
+
#Push the latest version of your local main to your remote forked repository
99
+
git push --force origin main
105
100
```
106
101
107
102
You can learn more about rebasing [here](https://git-scm.com/docs/git-rebase).
103
+
104
+
## 6. Open a pull-request
105
+
106
+
You can now open a pull-request [in the Concrete ML repository](https://github.com/zama-ai/concrete-ml/pulls). For more details on how to do so from a forked repository, please read GitHub's [official documentation](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork) on the subject.
0 commit comments