|
| 1 | +# How to contribute |
| 2 | + |
| 3 | +While bug fixes can first be identified via an "issue", that is not required. |
| 4 | +It's ok to just open up a PR with the fix, but make sure you include the same |
| 5 | +information you would have included in an issue - like how to reproduce it. |
| 6 | + |
| 7 | +PRs for new features should include some background on what use cases the |
| 8 | +new code is trying to address. When possible and when it makes sense, try to |
| 9 | +break-up larger PRs into smaller ones - it's easier to review smaller |
| 10 | +code changes. But only if those smaller ones make sense as stand-alone PRs. |
| 11 | + |
| 12 | +Regardless of the type of PR, all PRs should include: |
| 13 | + |
| 14 | +* well documented code changes; |
| 15 | +* additional testcases: ideally, they should fail w/o your code change applied; |
| 16 | +* documentation changes. |
| 17 | + |
| 18 | +Squash your commits into logical pieces of work that might want to be reviewed |
| 19 | +separate from the rest of the PRs. Ideally, each commit should implement a |
| 20 | +single idea, and the PR branch should pass the tests at every commit. GitHub |
| 21 | +makes it easy to review the cumulative effect of many commits; so, when in |
| 22 | +doubt, use smaller commits. |
| 23 | + |
| 24 | +This project tries to follow CRIU's commit message conventions, although they |
| 25 | +are not strictly enforced. For guidance on writing clear and effective commit |
| 26 | +messages, see [How to Write a Git Commit Message][git-commit]. |
| 27 | + |
| 28 | +PRs that fix issues should include a reference like `Closes #XXXX` in the |
| 29 | +commit message so that github will automatically close the referenced issue |
| 30 | +when the PR is merged. |
| 31 | + |
| 32 | +PRs are checked for binary size increases. If a PR legitimately increases |
| 33 | +the binary size beyond the default threshold, a maintainer can add the |
| 34 | +`bloat-ok` label to bypass the size check. |
| 35 | + |
| 36 | +Contributors must assert that they are in compliance with the [Developer |
| 37 | +Certificate of Origin 1.1](http://developercertificate.org/). This is achieved |
| 38 | +by adding a "Signed-off-by" line containing the contributor's name and e-mail |
| 39 | +to every commit message. Your signature certifies that you wrote the patch or |
| 40 | +otherwise have the right to pass it on as an open-source patch. |
| 41 | + |
| 42 | +The use of AI tools is welcome but should be correctly attributed, especially |
| 43 | +for substantial changes. You can use one of the following in your commit |
| 44 | +message: |
| 45 | + |
| 46 | +* `Assisted-by: <AI tool>` |
| 47 | +* `Co-authored-by: <AI tool>` |
| 48 | +* `Generated-by: <AI tool>` |
| 49 | +* Or mention it in the commit message body, e.g., "Generated with <AI tool>" |
| 50 | + |
| 51 | +Marking AI-assisted contributions helps preserve both legal clarity and |
| 52 | +community trust, and makes it easier for reviewers to evaluate the code |
| 53 | +in context. For more information, see [AI-assisted development and open source: |
| 54 | +Navigating the legal issues][ai-legal]. |
| 55 | + |
| 56 | +[ai-legal]: https://www.redhat.com/en/blog/ai-assisted-development-and-open-source-navigating-legal-issues |
| 57 | +[git-commit]: https://chris.beams.io/posts/git-commit/ |
0 commit comments