ENTERPRISE CLOUD DEVELOPMENT Berlin Expert Days 2013 Enjoy Code Review Again Marrying Gerrit with Jenkins in 20 Minutes Johannes Nicolai Development Manager, CollabNet Dharmesh Sheta Software Engineer, CollabNet CollabNet Engineering Office, Potsdam, Germany
18
Embed
Marrying Jenkins and Gerrit-Berlin Expert Days 2013
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
“Code review is systematic examination (often known as peer review) of computer source code. […] Reviews are done in various forms such as pair programming, informal walkthroughs, and formal inspections.” [1]
We will not cover formal inspections methods and pair programming here but concentrate on informal walk throughs, typically referred as Informal Peer review
“In software development, peer review is a type of software review in which a work product (document, code, or other) is examined by its author and one or more colleagues, in order to evaluate its technical content and quality.” [2][1] Kolawa, Adam; Huizinga, Dorota (2007). Automated Defect Prevention: Best Practices in Software Management. Wiley-IEEE Computer Society Press. p. 260. ISBN 0-470-04212-5.
• Less than 50 percent of software applications are developed using code review [5][5] C. Jones, The Economics of Software Quality, Capers Jones, Olivier Bonsignour and Jitendra Subramanyam, Addison-Wesley Longman, 2011
• Ego challenges – Welcome to the world of gamification (after talk)
• Half baked review requests killing motivation – ‘The demo tape problem‘– Many code review requests do not meet basic quality gates
• Compiles/builds• Passes unit / integration tests• Meets coding standards and metrics• No IP violations
Jenkins = Most popular Open Source CI• Has hundreds of plugins to– Interact with various SCMs (Git, SVN, CVS, …)– Build software (ant, maven, gradle, make)– Run unit/integration tests (JUnit, Selenium, …)– Perform static code analysis (findbugs, checkstyle,
PMS, Sonar, …)
• Works brilliantly together with Gerrit over Gerrit Trigger Plugin– Keeps ssh connection open to learn about new
review requests immediatly– Builds and verifies all configures quality gates (tests,
coding conventions, code KPIs, you name it)– Sets ‘verified’ flag in review request according to
result of verification build (either +1 or -1) – If Jenkins sets -1, then further code review isn’t
possible, developer has to either re-work or abandon change
Basic SCM features jGit engine Native engine GitWeb
Gerrit
With TeamForge and Gerrit, Git is now ready for the enterprise. Realize all the benefits of Git, without compromising governance, security and compliance.