How Google Said - Ninja Code Review With Gerrit
-
Upload
anuar-nurmakanov -
Category
Software
-
view
80 -
download
0
Transcript of How Google Said - Ninja Code Review With Gerrit
About me
Kazakhstan, Karaganda
Lead SoftwareEngineer
XP/EngX Practices fan
Agile Believer
And I love Java!
3
When you start new project
It's new opportunity. You feel like a hero!
It's gonna be the best project!!
6
Lack of Code Review Lack of TDD Lack of Testing Pyramid
Lack of CI/CD/CD Lack of Release Strategy
and other engineering and agile practices13
Code Review Goals
Definition of Done Collective CodeOwnership
Code Quality
Knowledge Sharing Find compromise Education
17
Code Review
Is so huuuuuge topic
Why and whenBenefitsGoalsApproachesRolesStrategiesToolsBest practicesetc
19
No one can make pushesJenkins is redWe cannot prepare buildFix might break one of the test environmentsIt might take lots of time
25
What is Stable build?
Changes do not have any bugs
They do not fail existing tests
They have good test coverage
CI jobs are green
Unit/Integration/System/End-To-End tests passed
Existing functionality works
28
I wanna see everything in oneplace
Feedback from teammates
Feedback from Team Lead
Feedback from Architect
Check that build is not broken
Check any type of tests
Feedback from Architect
New violations and errors
Any blocker issues
Any static analyse
29
Trunk Based DevelopmentEveryone Develops in the trunkBug fixes tooNo Code FreezeNo Merge HellBuild never broken. It's always ready tobe released
36
Pull requests are not purepre-commit review
You can integrate it withCI. Some have CI out of the
box
Pull requests do notshow Static Code
Analyse comments
Pull/Merge Requests
42
Who is Ninja?
Always ready to hear feedbackfrom others and make changesFixes build before it breaksmain branches buildsRemoves all SonarQubeviolationsKnows how GIT worksReady to share knowledge andhelpChecksUnit/Integration/System/End-To-End/UI tests
44
What is Gerrit?
Created for AndroidDevelopment and now it's
in Google
And lots of other companies
45
Gerrit Roles Model
Group Label RangeRegistered Users Code-Review -1..+1
Team Leads Code-Review -2..+1
Architects Code-Review -2..+2
Non-interactiveusers
Code-Review -1..+1
“ For example, only Architectscan allow to make a merge
50
Patch Set
One code change, (be it a feature ora bugfix, ) is one commit. Use
Ammend to update it.
git push gerritHEAD:refs/for/master
When it'sready for
review
51
Gerrit Users
Android – LibreOffice – Wikimedia – Golang – Tuleap – Star Wars Galaxies Emulator –
https://android-review.googlesource.com/https://gerrit.libreoffice.org/https://gerrit.wikimedia.org/
https://go-review.googlesource.com/https://gerrit.tuleap.net/
http://review.swgemu.com/
54