Cascadia PHP October 26, 2024
Tim Bond
👀
Opinions ahead
Scope
Develop
Review
Deploy
main
. EverClear Description
Summarize changes to set context for reviewers
Contextual Information
Include rationale for changes
Documentation Updates
Link(s) to relevant items
Open/closed issues
Design documents
Give reviewers background information so they don't have to search for it
Describe why you're changing things, and less on what or how
This PR fixes bugs
This PR addresses issue #123 and resolves an error in which some users couldn't log in even when their account is active.
Previously the login method could throw an exception when user was activated manually.
Ask yourself...
Is this how we want to solve this problem?
$numbers = [1, 2, 3];
array_map(function($n) {
global $total;
$total += $n;
}, $numbers);
❌ Optimal way to solve this
✔️ Works
Focus on learning
Provide constructive feedback
Encourage collaboration
Look at the big picture
Any checks that can be automated
Linter
Tests
Issue number in the commit message
Bug detection
Personal preferences
Rubber stamps
The reviewer isn't looking to approve the pull request, they are looking for any reasons why they can't approve it
Everyone on the team!
Someone with knowledge on the codebase and/or area(s) being changed (code owner)
Round robin
Balanced
First come, first served
Each dev posts to a Slack room for review
Use a specific mention group
Anyone with capacity will review
Influence with words like "quick" or "easy"
Shopping to friends for an approval
Remain professional
No micromanagement
Give the person the benefit of the doubt
Ask questions: let the author work their way to the conclusion
Be clear when it's an optional change
Good at summarizing the PR
Set expectations upfront
Every line
Every developer
Automate the automatable
Remember that this isn't "wasted" time; it's time you would have spent anyways getting everyone on the same page
Code reviews are a chance for everybody to learn what, why, and how changes are being made
Instills confidence within the team by ensuring that multiple developers collaboratively assess and agree on every line of code deployed to production