Add CONTRIBUTING.md
Browse files at this commitfe2c2eec29492b169a834e066deac84ea3bfe013Parent: 746a7e81 changed file +95 -0
- CONTRIBUTING.md +95 -0
CONTRIBUTING.mdadded+95 -0
| @@ -0,0 +1,95 @@ | |||
| 1 | +# Contributing to niri | ||
| 2 | + | ||
| 3 | +Thanks for your interest in niri! | ||
| 4 | +The project has grown quite a bit, and we could use all help that we can. | ||
| 5 | + | ||
| 6 | +Make sure to join our Matrix chat if you have any questions or want to discuss anything: https://matrix.to/#/#niri:matrix.org | ||
| 7 | + | ||
| 8 | +## Issues and discussions | ||
| 9 | + | ||
| 10 | +This is a good way to help many new and existing users without programming knowledge. | ||
| 11 | + | ||
| 12 | +- Answer and help people in GitHub issues and discussions. | ||
| 13 | +- Check and point out duplicate issues. | ||
| 14 | +- Check for issues that are likely application bugs (and not niri bugs). | ||
| 15 | + - Ask or try to reproduce on another non-Smithay-based compositor (sway, KDE/KWin, GNOME/Mutter). If the issue reproduces, it's likely an application bug. | ||
| 16 | + - Ask or try to reproduce on another *Smithay-based* compositor ([cosmic-comp], [anvil]). If the issue reproduces only on Smithay compositors, it may be a Smithay bug. | ||
| 17 | + - Make sure you're testing the Wayland version of the app on all compositors. Apps may silently use X11 when an X11 `$DISPLAY` is available. | ||
| 18 | + - Problems with X11 apps should be reported to [xwayland-satellite]. When testing xwayland-satellite on different compositors, make sure you use xwayland-satellite's `$DISPLAY` (rather than another compositor's built-in Xwayland `$DISPLAY`). | ||
| 19 | + - After testing, mention where you could and couldn't reproduce, as well as the exact steps to reproduce if the issue is missing them. | ||
| 20 | +- Try to reproduce the issue on your own system and write if you could or couldn't reproduce it. | ||
| 21 | +- Upvote issues with a thumbs up reaction as you like. | ||
| 22 | +- Ideas and feature requests from new users should go to Discussions. | ||
| 23 | + | ||
| 24 | +If your issue is a duplicate, or not a niri issue (application bug, hardware problem, configuration problem), then please close it. | ||
| 25 | + | ||
| 26 | +## Reviewing and testing pull requests | ||
| 27 | + | ||
| 28 | +With the growing popularity, the volume of pull requests is honestly more than I can manage myself in my free time. | ||
| 29 | +I would really appreciate help with testing and reviewing them. | ||
| 30 | + | ||
| 31 | +### Testing | ||
| 32 | + | ||
| 33 | +Pick a pull request you like, then build it and give it a go. | ||
| 34 | +The [Developing niri wiki page](https://github.com/YaLTeR/niri/wiki/Developing-niri) has guidance on running niri test builds. | ||
| 35 | + | ||
| 36 | +Be really thorough with your testing. | ||
| 37 | +We're striving for polished features in niri, so point out any issues and bugs, even small ones like animation jank. | ||
| 38 | + | ||
| 39 | +- Think of weird edge cases or unexpected interactions and try them to see that they work reasonably. | ||
| 40 | +- Try to break the feature and check that it behaves well. | ||
| 41 | +- Where applicable, try different input devices: keyboard, mouse, trackpad, tablet, touchscreen. | ||
| 42 | +- Watch out for any new performance drops. | ||
| 43 | + | ||
| 44 | +For bug fixes, first make sure you can reproduce the bug, then do the same steps in the PR test build, and verify that the bug is fixed. | ||
| 45 | +Be similarly thorough: test any similar or related edge cases to verify that the fix doesn't introduce any new problems. | ||
| 46 | + | ||
| 47 | +Write your findings in the pull request: any issues you found, or if everything worked well. | ||
| 48 | +Re-test after the author updates the code to see that your issues were fixed. | ||
| 49 | + | ||
| 50 | +Don't hesitate to test even if someone else already did; very frequently different people will stumble upon different problems. | ||
| 51 | + | ||
| 52 | +### Reviewing | ||
| 53 | + | ||
| 54 | +Reviewing pull requests is something I need the most help with since there are a lot of them, and it's quite time-consuming. | ||
| 55 | +Anyone with code accepted into niri is welcome, but this is not a requirement; even if you aren't familiar with Rust you may find some logic problems. | ||
| 56 | + | ||
| 57 | +Pick a pull request, then review its code. | ||
| 58 | + | ||
| 59 | +- Check that everything looks good, check various conditions for edge cases. | ||
| 60 | +- See if there are any scenarios the author forgot to handle. | ||
| 61 | +- Check that the code fits well into the rest of niri, follows its design and code style. | ||
| 62 | + - I understand this is vague. The idea is: look at the surrounding code and at similar modules (e.g. when implementing a new protocol, check other protocol implementations), and try to follow the style and structure. | ||
| 63 | +- Check for unrelated changes that may be better split into their own pull request. | ||
| 64 | +- Check that the wiki had been updated if necessary (for example, new config options were documented with examples, and have a correct Since annotation). | ||
| 65 | + | ||
| 66 | +Point out everything you find as review comments (don't forget to submit the review). | ||
| 67 | +Be constructive and respectful; some people may be new to programming and Rust. | ||
| 68 | +As the author addresses the comments and issues, check the code again to see that the problems were fixed. | ||
| 69 | +If everything looks good, say that, so I know someone has reviewed the PR. | ||
| 70 | + | ||
| 71 | +As with testing, don't hesitate to look through and comment even if someone else already had. | ||
| 72 | +Extra pairs of eyes catch more problems. | ||
| 73 | + | ||
| 74 | +## Writing pull requests | ||
| 75 | + | ||
| 76 | +When creating pull requests, please keep the following in mind. | ||
| 77 | + | ||
| 78 | +- Make sure new features align with niri's design directions. Ideally, there should be an existing issue or discussion where we settled on that solution. | ||
| 79 | +- Keep pull requests focused on a single feature or bug fix with no unrelated changes. | ||
| 80 | +- Try to split your changes into small, self-contained commits. Every commit should build and pass tests. This makes it much easier to review your PR, and bisect for regressions in the future. | ||
| 81 | + - When addressing PR comments, try to squash the changes straight into the relevant commits. | ||
| 82 | + - In some cases when the requested changes are big/unclear, you can leave them as separate commits on top, but please squash and otherwise clean up the history when the changes are finalized. | ||
| 83 | + - To update the main branch, please rebase instead of merging. Try to force-push the main update rebase separately from other changes, this way it's easy to skip during review since it's usually not interesting. | ||
| 84 | + - When working on bigger features, I usually start with a big messy commit, then gradually split out smaller self-contained changes from it as the code gets into shape. | ||
| 85 | + - [git-rebase.io](https://git-rebase.io/) is a helpful guide for splitting commits and cleaning up history in git. | ||
| 86 | +- When you address a review comment, mark it as resolved. | ||
| 87 | +- Remember to [run tests](https://github.com/YaLTeR/niri/wiki/Developing-niri#tests) and format the code with `cargo +nightly fmt --all`. | ||
| 88 | +- For new layout actions, remember to add them to the randomized tests. For weird Wayland handling, adding client-server tests in `src/tests/` could be very useful. | ||
| 89 | +- Remember to document new config options on the wiki. | ||
| 90 | +- When opening a pull request, ensure "Allow edits from maintainers" is enabled, so I can make final tweaks before merging. | ||
| 91 | + | ||
| 92 | + | ||
| 93 | +[cosmic-comp]: https://github.com/pop-os/cosmic-comp | ||
| 94 | +[anvil]: https://github.com/Smithay/smithay/tree/master/anvil | ||
| 95 | +[xwayland-satellite]: https://github.com/Supreeeme/xwayland-satellite | ||