Gerrit code review Thomas Koch www.koch.ro May 10, 2011
me Thomas Koch http://www.koch.ro finished music, physics 5 years software developer: PHP (RIP!), Java, Hadoop, Search, Crawling, ERP, Groupware currently: finishing computer science bachelor, ETA: Q1/2012 tags: quality, ATTAC, FSFE, FIfF, social responsability, Romania, Switzerland
Outline motivation workflow integration demo apendix
We are GIT - Resistance is futile GNU core utils Linux-Kernel Samba Apache Software Foundation (mirrors) Perl5 freedesktop.org Maemo, QT Debian ( 3 of packages with KDE 4 a VCS) Gnome DragonFly BSD VLC, XMMS2 Fedora Prototype, YUI, jQuery Android Ruby on Rails Wine Drupal, Mantis Erlang . . . and many morea . . . GStreamer a http://git.or.cz/gitwiki/GitProjects
Why GIT? fast merging is easy amazing toolset and features low entry barrier for new contributors
Subversion is irrelevant but you still need: repository server easy repository management access control
Subversion is irrelevant but you still need: repository server easy repository management access control and since we’re agile: code review
Subversion is irrelevant but you still need: repository server easy repository management access control and since we’re agile: code review and if you like it: CLA management
1 we are proud and seek review 1 CC BY-NC-ND 2.0 http://lacrimarum-valle.blogspot.com/2009/11/wendys-cakes.html
enter Gerrit initially for Android by Google public since ca. oct 2008 java rewrite of googles internal code review system by Shawn Pearce himself! tightly coupled to GIT
Gerrit users Eclipse Ebay2 , Intel, Red Hat, SAP Couchbase, WebM, Typo3 Assembla (dev tools as a service)3 openAFS Kitware (e.g. CMake)4 Sandia National Laboratories Mobiles: Android, Qualcomm Innovation Center, MeeGo, Sony Ericsson 2 http://dj.riceweevil.com/2010/07/25-week/ 3 http://blog.assembla.com/assemblablog/tabid/12618/bid/40871/ Introducing-Gerrit-a-scalable-code-review-system.aspx 4 http://www.kitware.com/blog/home/post/70
current ASF workflow
Outline motivation workflow integration demo apendix
commit and push to gerrit continuous integration (Jenkins) peer review jenkins OK, reviewer(s) OK? merge to integration branch
3 main views in Gerrit UI: changes list change overview diff (side by side / unified)
Gerrit Changes list
Gerrit Change overview
Gerrit Change side by side diff
mail notifications From: "Mike Peer (Code Review)" <mike@peer.de> To: Thomas Koch <thomas@koch.ro> Subject: Change in picture-gallery[master]: wrote add method and tests Mike Peer has posted comments on this change. Change subject: wrote add method and tests ........................................................... Patch Set 1: Looks good to me, but someone else must approve (2 inline comments) good enough. .................................................... File src/main/java/ro/koch/picturegallery/App.java Line 13: Could you please avoid unnecessary whitespace? Line 16: return a + b; Did you think about checking for overflows?
Outline motivation workflow integration demo apendix
Mylyn (eclipse) integration
Mylyn changes list
Mylyn change details
Mylyn change details - attributes
Mylyn change details - comments
Mylyn change details - reviewers
Mylyn change details - patch sets
Jenkins integration
Jenkins trigger and post result
Jenkins trigger and post result
Jenkins plugin fast (gerrit ssh stream) global configuration
more integration Mylyn (eclipse) Jenkins GitWeb Email notifications Auth: OpenID, LDAP, HTTP (Browser) build your own: hooks, streaming API e.g. parse Issuetracker IDs from commit messages and post to Jira/Mantis/Bugzilla
clickable Issuetracker IDs in gerrit.config: [commentlink "bugzilla"] match = "(bugs+#?)(d+)" link = http://bugs.example.com/show_bug.cgi?id=$2 [commentlink "tracker"] match = ([Bb]ug:s+)(d+) html = $1<a href="http://trak.example.com/$2">$2</a>
Outline motivation workflow integration demo apendix
Questions? http://www.koch.ro http://identi.ca/thkoch
Outline motivation workflow integration demo apendix
multiple versions of a change Change-Id: I8596454156c4688abd1006cad8297d5aa7eb9331 (There’s a hook for that.)
search (WebUI or cmdline) ssh -p 29418 t61 gerrit query --format=JSON project:picture-gallery status:open owner:thomas@koch.ro Search for: age, owner, reviewer, project, branch, message, file, status, votes issue-tracker IDs: tr:ID / bug:ID topic starred (like bookmarked)
CLA and contact store
more goodies topic star changes hooks (after the fact) replication
commit policies / Change Submit Action Fast Forward Only Merge If Necessary Always Merge Cherry Pick Shawn Pearce: Under cherry-pick the dependency data in Gerrit means nothing. If a change is submitted and it cherry-picks clean onto the branch tip, it gets patched onto the branch and marked merged, even if one or more dependent changes is not ready for submission.
cmdline tools over SSH admin: user: create-account ls-projects create-group query create-project review gsql stream-events suexec ...

Gerrit linuxtag2011

  • 1.
    Gerrit code review Thomas Koch www.koch.ro May 10, 2011
  • 2.
    me Thomas Koch http://www.koch.ro finished music, physics 5 years software developer: PHP (RIP!), Java, Hadoop, Search, Crawling, ERP, Groupware currently: finishing computer science bachelor, ETA: Q1/2012 tags: quality, ATTAC, FSFE, FIfF, social responsability, Romania, Switzerland
  • 3.
    Outline motivation workflow integration demo apendix
  • 4.
    We are GIT- Resistance is futile GNU core utils Linux-Kernel Samba Apache Software Foundation (mirrors) Perl5 freedesktop.org Maemo, QT Debian ( 3 of packages with KDE 4 a VCS) Gnome DragonFly BSD VLC, XMMS2 Fedora Prototype, YUI, jQuery Android Ruby on Rails Wine Drupal, Mantis Erlang . . . and many morea . . . GStreamer a http://git.or.cz/gitwiki/GitProjects
  • 5.
    Why GIT? fast merging is easy amazing toolset and features low entry barrier for new contributors
  • 6.
    Subversion is irrelevant but you still need: repository server easy repository management access control
  • 7.
    Subversion is irrelevant but you still need: repository server easy repository management access control and since we’re agile: code review
  • 8.
    Subversion is irrelevant but you still need: repository server easy repository management access control and since we’re agile: code review and if you like it: CLA management
  • 9.
    1 we are proudand seek review 1 CC BY-NC-ND 2.0 http://lacrimarum-valle.blogspot.com/2009/11/wendys-cakes.html
  • 10.
    enter Gerrit initially for Android by Google public since ca. oct 2008 java rewrite of googles internal code review system by Shawn Pearce himself! tightly coupled to GIT
  • 11.
    Gerrit users Eclipse Ebay2 , Intel, Red Hat, SAP Couchbase, WebM, Typo3 Assembla (dev tools as a service)3 openAFS Kitware (e.g. CMake)4 Sandia National Laboratories Mobiles: Android, Qualcomm Innovation Center, MeeGo, Sony Ericsson 2 http://dj.riceweevil.com/2010/07/25-week/ 3 http://blog.assembla.com/assemblablog/tabid/12618/bid/40871/ Introducing-Gerrit-a-scalable-code-review-system.aspx 4 http://www.kitware.com/blog/home/post/70
  • 12.
  • 13.
    Outline motivation workflow integration demo apendix
  • 14.
    commit and pushto gerrit continuous integration (Jenkins) peer review jenkins OK, reviewer(s) OK? merge to integration branch
  • 15.
    3 main viewsin Gerrit UI: changes list change overview diff (side by side / unified)
  • 16.
  • 17.
  • 18.
    Gerrit Change sideby side diff
  • 19.
    mail notifications From: "Mike Peer (Code Review)" <mike@peer.de> To: Thomas Koch <thomas@koch.ro> Subject: Change in picture-gallery[master]: wrote add method and tests Mike Peer has posted comments on this change. Change subject: wrote add method and tests ........................................................... Patch Set 1: Looks good to me, but someone else must approve (2 inline comments) good enough. .................................................... File src/main/java/ro/koch/picturegallery/App.java Line 13: Could you please avoid unnecessary whitespace? Line 16: return a + b; Did you think about checking for overflows?
  • 20.
    Outline motivation workflow integration demo apendix
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
    Jenkins plugin fast (gerrit ssh stream) global configuration
  • 32.
    more integration Mylyn (eclipse) Jenkins GitWeb Email notifications Auth: OpenID, LDAP, HTTP (Browser) build your own: hooks, streaming API e.g. parse Issuetracker IDs from commit messages and post to Jira/Mantis/Bugzilla
  • 33.
    clickable Issuetracker IDs in gerrit.config: [commentlink "bugzilla"] match = "(bugs+#?)(d+)" link = http://bugs.example.com/show_bug.cgi?id=$2 [commentlink "tracker"] match = ([Bb]ug:s+)(d+) html = $1<a href="http://trak.example.com/$2">$2</a>
  • 34.
    Outline motivation workflow integration demo apendix
  • 35.
    Questions? http://www.koch.ro http://identi.ca/thkoch
  • 36.
    Outline motivation workflow integration demo apendix
  • 37.
    multiple versions ofa change Change-Id: I8596454156c4688abd1006cad8297d5aa7eb9331 (There’s a hook for that.)
  • 38.
    search (WebUI orcmdline) ssh -p 29418 t61 gerrit query --format=JSON project:picture-gallery status:open owner:thomas@koch.ro Search for: age, owner, reviewer, project, branch, message, file, status, votes issue-tracker IDs: tr:ID / bug:ID topic starred (like bookmarked)
  • 39.
  • 40.
    more goodies topic star changes hooks (after the fact) replication
  • 41.
    commit policies /Change Submit Action Fast Forward Only Merge If Necessary Always Merge Cherry Pick Shawn Pearce: Under cherry-pick the dependency data in Gerrit means nothing. If a change is submitted and it cherry-picks clean onto the branch tip, it gets patched onto the branch and marked merged, even if one or more dependent changes is not ready for submission.
  • 42.
    cmdline tools overSSH admin: user: create-account ls-projects create-group query create-project review gsql stream-events suexec ...