|
| 1 | +# Review Guidelines |
| 2 | + |
| 3 | +The following summarises review guidelines that we follow for pull requests in |
| 4 | +Riot Web and other supporting repos. These are just guidelines (not strict |
| 5 | +rules) and may be updated over time. |
| 6 | + |
| 7 | +## Code Review |
| 8 | + |
| 9 | +When reviewing code, here are some things we look for and also things we avoid: |
| 10 | + |
| 11 | +### We review for |
| 12 | + |
| 13 | +* Correctness |
| 14 | +* Performance |
| 15 | +* Accessibility |
| 16 | +* Security |
| 17 | +* Comments and documentation where needed |
| 18 | +* Sharing knowledge of different areas among the team |
| 19 | +* Ensuring it's something we're comfortable maintaining for the long term |
| 20 | + |
| 21 | +### We should avoid |
| 22 | + |
| 23 | +* Style nits that are already handled by the linter |
| 24 | +* Dramatically increasing scope |
| 25 | + |
| 26 | +### Good practices |
| 27 | + |
| 28 | +* Use empathetic language |
| 29 | + * See also [Mindful Communication in Code |
| 30 | + Reviews](https://kickstarter.engineering/a-guide-to-mindful-communication-in-code-reviews-48aab5282e5e) |
| 31 | + and [How to Do Code Reviews Like a Human](https://mtlynch.io/human-code-reviews-1/) |
| 32 | +* Authors should prefer smaller commits for easier reviewing and bisection |
| 33 | +* Reviewers should be explicit about required versus optional changes |
| 34 | + * Reviews are conversations and the PR author should feel comfortable |
| 35 | + discussing and pushing back on changes before making them |
| 36 | +* Core team should lead by example through their tone and language |
| 37 | +* Take the time to thank and point out good code changes |
| 38 | +* Using softer language like "please" and "what do you think?" goes a long way |
| 39 | + towards making others feel like colleagues working towards a common goal |
| 40 | + |
| 41 | +### Workflow |
| 42 | + |
| 43 | +* Avoid force pushing to a PR after first round of review |
| 44 | +* Use merge commits when landing |
| 45 | +* PR author merges after review (assuming they have write access) |
| 46 | +* Assign issues only when in progress (don’t overly assign things so it’s clear |
| 47 | + that anyone on the team can pick up) |
| 48 | + |
| 49 | +## Design and Product Review |
| 50 | + |
| 51 | +We want to ensure that all changes to Riot fit with our design and product |
| 52 | +vision. We often request review from those teams so they can provide their |
| 53 | +perspective. |
| 54 | + |
| 55 | +In more detail, our usual process for changes that affect the UI or alter user |
| 56 | +functionality is: |
| 57 | + |
| 58 | +* For changes that will go live when merged, always flag Design and Product |
| 59 | + teams as appropriate |
| 60 | +* For changes guarded by a feature flag, Design and Product review is not |
| 61 | + required (though may still be useful) since we can continue tweaking |
| 62 | + |
| 63 | +As it can be difficult to review design work from looking at just the changed |
| 64 | +files in a PR, authors should be prepared for Design and / or Product teams to |
| 65 | +request a link to an ad-hoc build of Riot (hosted anywhere) that can be used for |
| 66 | +the review. In the future, we [hope to automate |
| 67 | +this](https://github.com/vector-im/riot-web/issues/12624) for every PR. |
0 commit comments