how we automated code review process · •automation improve our code review process •with code...
TRANSCRIPT
![Page 1: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/1.jpg)
How We Automated Code Review Process
![Page 2: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/2.jpg)
who?
@gozali https://github.com/gozali
![Page 4: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/4.jpg)
What is code review?
![Page 5: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/5.jpg)
https://s-media-cache-ak0.pinimg.com/originals/b8/e7/ca/b8e7cafa593d5358232553c744c47709.jpg
![Page 6: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/6.jpg)
Code review is systematic examination of computer source code
https://en.wikipedia.org/wiki/Code_review
![Page 7: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/7.jpg)
Patterns
![Page 8: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/8.jpg)
Formal Inspections
https://en.wikipedia.org/wiki/Fagan_inspection
![Page 9: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/9.jpg)
Formal Inspections
https://davidwalsh.name/code-review
![Page 10: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/10.jpg)
Formal inspections is proven techniques but require large amounts of developer time
![Page 11: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/11.jpg)
Over-the-shoulder
http://www.sheknows.com/entertainment/articles/827569/source-code-movie-review
![Page 12: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/12.jpg)
Over-the-shoulder are easiest to implement but can’t be instantiated as a controlled process
![Page 13: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/13.jpg)
Pair Programming
https://twitter.com/ArtofWarm/status/714880831206981632
![Page 14: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/14.jpg)
Pair-programming has a lot of advantages but require large amounts of developer time
![Page 15: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/15.jpg)
Tool-assisted
https://github.com/marketplace/category/code-review https://github.com/marketplace/category/code-quality
![Page 16: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/16.jpg)
Tool-assisted strike a balance between time invested and ease of implementation
![Page 17: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/17.jpg)
Rules
![Page 18: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/18.jpg)
•Reviewing code before or after deployment?
•Who should review the code? •Should the code reviews be
blocking? •How strict should the code reviews
be?
![Page 19: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/19.jpg)
•Reviewing code before or after deployment?
•Who should review the code? •Should the code reviews be
blocking? •How strict should the code reviews
be?
![Page 20: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/20.jpg)
•Reviewing code before or after deployment?
•Who should review the code? •Should the code reviews be
blocking? •How strict should the code reviews
be?
![Page 21: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/21.jpg)
•Reviewing code before or after deployment?
•Who should review the code? •Should the code reviews be
blocking? •How strict should the code reviews
be?
![Page 22: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/22.jpg)
Automated Code Reviews? How can this work?
![Page 23: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/23.jpg)
Code reviews are mostly about enforcing best practices, code style, and common security issues
![Page 24: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/24.jpg)
Most of those issues can be found by static analysis and linting tools
![Page 25: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/25.jpg)
Why Automated Code Reviews?
![Page 26: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/26.jpg)
1000 LoC - Looks fine 10 LoC - 9 issues
@mikhailgarber
![Page 27: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/27.jpg)
Our Setup
![Page 28: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/28.jpg)
pull request
![Page 29: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/29.jpg)
![Page 30: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/30.jpg)
webhook
pull request
![Page 31: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/31.jpg)
![Page 32: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/32.jpg)
webhook invoke runner
reports
pull request
![Page 33: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/33.jpg)
sonar.projectBaseDir=$WORKSPACE/src/github.com/mataharimall/orders sonar.projectKey=microservices:orders sonar.sources=./ sonar.inclusions=**/*.go sonar.exclusions=vendor/** sonar.coverage.exclusions=vendor/** sonar.test.exclusions=vendor/** sonar.golint.reportPath=src/github.com/mataharimall/orders/report.xml sonar.analysis.mode=preview sonar.github.oauth=<oauth-token> sonar.github.repository=mataharimall/orders sonar.github.pullRequest=$ghprbPullId
![Page 34: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/34.jpg)
![Page 35: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/35.jpg)
webhook
pull request status
invoke runner
reports
pull request
![Page 36: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/36.jpg)
![Page 37: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/37.jpg)
Conclusions & Future Work
![Page 38: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/38.jpg)
•Automation improve our code review process
•With code review improvement we improved our code quality
•Review the code not the developer
![Page 39: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/39.jpg)
•Automation improve our code review process
•With code review improvement we improved our code quality
•Review the code not the developer
![Page 40: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/40.jpg)
•Automation improve our code review process
•With code review improvement we improved our code quality
•Review the code not the developer
![Page 41: How We Automated Code Review Process · •Automation improve our code review process •With code review improvement we improved our code quality •Review the code not the developer](https://reader034.vdocuments.net/reader034/viewer/2022042912/5f47e0dc753a76534021fa3c/html5/thumbnails/41.jpg)
Questions?