Lock in $30 Savings on PRO—Offer Ends Soon! ⏳

Practical Code Review with Gerrit

Practical Code Review with Gerrit

Presented at ConFoo 2014

Avatar for gmacdougall

gmacdougall

February 27, 2014
Tweet

More Decks by gmacdougall

Other Decks in Programming

Transcript

  1. Why I Love Code Review! • Code Review Stops Bugs

    • Keeps Your Code Readable • Fosters Learning • Keeps Your Team Honest
  2. Process of Code Review? • Does your team do code

    review? • How do you do it? / How will you do it? • How often?
  3. Gerrit • Developed by folks at Google • Provides an

    automated web interface for code review • Used by popular projects ◦ Android, Chromium, Cyanogen, Eclipse, LibreOffice, MediaWiki, and many more
  4. Based on Git • Gerrit is a remote git server

    • Your code lives in Gerrit • Permissions Management System
  5. Fork & Pull vs. Gerrit • Gerrit based on commit

    • Fork & Pull based on a branch • Gerrit updates by amending existing change • Fork & Pull updates by adding new commit • Gerrit is a tool designed explicitly for code review
  6. Review Mode +2 Looks good to me, approved +1 Looks

    good to me, but someone else must approve 0 No score -1 I would prefer that you didn't submit this -2 Do not submit
  7. What To Look For in Code Review • obviously broken

    code • performance and environment issues • console.log, print’s, debugging statements • more effective code • team conventions • style issues • adding additional responsibilities • localization and internationalization • missing/poor tests
  8. What To Look For in Code Review • obviously broken

    code • potential environmental issues • console.log, print’s, debugging statements • more effective code • team conventions • style issues • adding additional responsibilities • localization and internationalization • missing/poor tests
  9. What To Look For in Code Review • obviously broken

    code • potential environmental issues • console.log, print’s, debugging statements • more effective code • team conventions • style issues • adding additional responsibilities • localization and internationalization • missing/poor tests
  10. Interactive Rebase $ touch 2; git add 2; git commit

    -m "Commit #2" $ touch 3; git add 3; git commit -m "Commit #3" $ touch 1; git add 1; git commit -m "Commit #1" $ touch 4; git add 4; git commit -m "Commit #4"
  11. Automatically Verifying Builds Code Review • Approved by humans •

    Meets the teams standards Verified • Build successful • Meets automated code quality checks
  12. Why this system works? Everything Gets Reviewed Everyone Reviews You

    learn from feedback you get from others You learn from code you see others write
  13. Words of Warning • This is a tool for developers

    • Configuration is a little challenging • Will bring team dysfunction to the surface