Skip to content

Commit 9a3d7d2

Browse files
author
Bogusevschi, Silviu
committed
meta: contributing: add code review and commit requirements
1 parent bb0f475 commit 9a3d7d2

File tree

1 file changed

+42
-4
lines changed

1 file changed

+42
-4
lines changed

CONTRIBUTING.md

+42-4
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ You can:
1414

1515
## Pull request checklist
1616

17-
Before sending your pull requests, please make sure that you followed this
18-
list.
17+
Before sending your pull requests, make sure that you have followed this list:
1918

2019
* Check the [library functionality guidelines](CONTRIBUTING.md#library-functionality-guidelines).
2120
If you are contributing a new compute primitive or propose changes to the
@@ -50,7 +49,7 @@ criteria:
5049

5150
Significant library changes (new primitives, library architecture changes,
5251
API modifications, etc) require approval from oneDNN maintainers before
53-
opening a Pull Request with such implementation. For that we use the Request
52+
opening a pull request with such implementation. For that we use the Request
5453
For Comments (RFC) process, which consists of opening, discussing, and
5554
accepting (promoting) RFC pull requests.
5655

@@ -59,7 +58,7 @@ More information about the process can be found in the dedicated
5958

6059
## Code contribution guidelines
6160

62-
The code must be:
61+
When submitting your contribution, please make sure that it is:
6362

6463
* *Tested*: oneDNN uses gtests for lightweight functional testing and
6564
benchdnn for functionality that requires both performance and functional
@@ -73,6 +72,45 @@ The code must be:
7372
architectures, compilers, and run-times. The new code should be compliant
7473
with the [System Requirements](README.md#system-requirements).
7574

75+
All code in oneDNN gets promoted to product branches (`master`, `rls-`, and
76+
`mnt-`) only through GitHub pull requests. Requirements for promotion:
77+
78+
- The request is reviewed and approved by maintainers for all affected
79+
components.
80+
- All discussions in the pull request are resolved.
81+
- Continuous integration pipeline passed without errors.
82+
- Promotion to release (`rls-`) branches can be done only by maintainers
83+
(enforced by GitHub)
84+
- The pull request author is responsible for collecting all the necessary
85+
approvals, rebasing of the changes, and resolving the discussions.
86+
87+
To simplify the work of reviewers, make sure that the commits in the pull
88+
request adhere to the following requirements:
89+
90+
- Commit message should be fit into 50 (at most 72) characters and have the
91+
imperative mood.
92+
- Commit message should follow the format:
93+
`<scope>:[scope: ..] <short description>`
94+
Scope examples:
95+
* Top level: `build`, `api`, `doc`, `tests`, `common`, `cpu`, `gpu`
96+
* Second level: `convolution`, `pooling`, `utils`, `verbose`
97+
* Example commit message:
98+
~~~git
99+
common: verbose: fix crash when prim_iface_t is empty
100+
~~~
101+
102+
- Commit body should also fit 72 characters. Think of it as a standard e-mail
103+
body or a markdown document in terms of styling - write sentences from the
104+
very left border keeping capital letters and punctuation in place.
105+
- oneDNN branches maintain linear history. Rebase the changes on top of target
106+
branch before creating a pull request. Rebase again after resolving all the
107+
discussions, as well as in case of merge conflicts.
108+
- Use `git add -p` and `git rebase -i` liberally to split unrelated changes
109+
into multiple self-contained commits. This is a courtesy to reviewers: smaller
110+
commits are easier to comprehend. It also helps with bisecting in the future.
111+
Of course judgement needs to be applied whether to split changes or not. For
112+
example, split code cleanup and the actual fix into two separate patches.
113+
76114
## Coding Standards
77115

78116
Contributions to oneDNN must follow the [Coding Standards](CODING_STANDARDS.md)

0 commit comments

Comments
 (0)