If review is not done,
deploy you should not
May the 4th 2017 VilniusPHP meetup
Developer I am
Žilvinas Kuusas
11+ metų programuoju
Sprendžiu el. parašo problemas -
Estina / ISIGN
Mokau/konsultuoju programuotojus
CleanPHP.lt
Skatinu bendruomeniškumą per
VilniusPHP.lt, Symfony.lt,
NoTrollsAllowed.com
Pre-merge code reviews
It’s “code inspection”
5 rules
of code
reviews
Rule #1
If problem is not solved
code exist should not
Rule #2
Push to the master
you should not
Rule #3
Trust no one you should
(even yourself)
Rule #4
Review often, review work in progress
Rule #5
Merge responsibly you must
Where to start?
Small tasks
Acceptance criteria
Atomic commits
Tests
Pull requests
Integrate frequently
Pair on merges
Solve the Problem
Before Coding
Things to avoid
Blind Merge
One person responsible for everything
No one can push to master
Excuses
Cowboy coders
Focus on details with low value
Blame you should not
Do not be defensive
Review checklist
Unit tests
Does the code solve the given problem?
Method arguments
Null References
Conventions and Consistency
Disposable things
Security
Finally - accept code by merge
Tools
● Github
● Gitlab
● Phabricator
● ...
● ReviewBoard
● BarKeep
● Gerrit
Collective ownership
Everybody knows...
● what the code does
● why it’s designed that way
● how everything works
Bus Factor
no single team member is a bottleneck
Shared best practices
Consistent code
Reusable code
Team maturity
Ready to create
your first pull-request
you are
Code reviews

Code reviews