Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.
Main sponsor  GerritLuca Milanesio
Who’s that guy ?review.GerritForge™.com   Copyright © 2012 – LMIT Software
Agenda  •   Agile and the broken build dilemma  •   Can Git solve it ?  •   “Agile” workflow with Git  •   Gerrit: the sma...
Agile and continuous integration  • Who is using CI ? … raise your hand !!!!  • Good or bad ?  •Why ?review.GerritForge™.c...
Continuous Integration is GOOD  •   Live “weather forecast” of the project  •   Detect and resolve conflicts earlier  •   ...
Breaking the build id BAD !  • All devs gets tests broken  • Build stops  • Test are NOT executed  … all team goes at “DEF...
Broken build dilemma: how to avoid it ?         1. Do not PUSH until you’re 100% sure            of GREEN bar         2. C...
Git … can you help out ?   Git short story: the anti-Subversion   • Apr 2005 – Linus writes PERL scripts for Linux Kernel ...
Git topic-branches workflow                           B4             B5                 topic1            A1        A2    ...
Problem resolved ?  • Let’s use Git then ?      “My repo is the master”                          “Git is all about peer-to...
Gerrit, brief history   Google  Mondrian               The idea: Guido Van Rossum                         Code-review for...
What is Gerrit today ?  • 100% pure Java SSH and HTTP Git backend       Powered by JGit  • GWT Web-view administration   ...
Gerrit: high level workflow                 CI Build: OK                                                              mast...
Gerrit: high level workflow                 CI Build: OK                                                              mast...
Gerrit: high level workflow                 CI Build: OK                                                              mast...
Gerrit: high level workflow                  CI Build: OK                                                               ma...
Gerrit: high level workflow                  CI Build: OK                                                                 ...
Gerrit: high level workflow                  CI Build: OK                                                                 ...
Gerrit: high level workflow                  CI Build: OK                                                                 ...
Gerrit: high level workflow                  CI Build: OK                                                                 ...
Gerrit: high level workflow                  CI Build: OK                                               CI Build: OK      ...
Cool, isn’t it ?  • Gerrit allow “automatic” topic-branches  • Triggers with Jenkins branch validation  • Enforce collecti...
See Gerrit “live” in actionreview.GerritForge™.com         Copyright © 2012 – LMIT Software
1. Set-up  • Option-A: download and install      1. Download from         http://code.google.com/p/gerrit/downloads/list  ...
2. Create user and add SSH keys  • Option-A: not easy        Gerrit doesn’t support a “local user registry”       Optio...
3. Talk to Gerrit via SSH  • Gerrit SSH console       Listen at 29418 port       Not a real SSH server (just Gerrit list...
4. Create a Gerrit project • Gerrit Project is:      Git repository (use “path notation” to organise projects)      Acce...
5. Clone repo from Gerrit  • Git SSH repository URL is:     ssh://<user>@<host>:29418/<Gerrit project>.git  • Gerrit suppo...
6. Gerrit Change-Id  • SHA-1 GUID of a change-set under review  • MUST be last line of commit msg         Hint: install Ge...
7. Submit a change for review  • Change for review committed locally  • Push to refs/for/<branch> for submitting local Git...
8. Verify change against CIreview.GerritForge™.com         Copyright © 2012 – LMIT Software
9. Additional patch-set to Change-Id  • Fix the problem locally  • Amend the commit (same Change-Id)  • Push again to refs...
10. Change-Id is validated against CI                          • Request code-reviewreview.GerritForge™.com         Copyri...
11. Review and comment changesreview.GerritForge™.com   Copyright © 2012 – LMIT Software
12. Review merge and submit change                          • One or more                            reviewers can “vote” ...
13. Master build is triggered … SUCCESS !!review.GerritForge™.com     Copyright © 2012 – LMIT Software
… is just about code-review then ?                        GitHub   BitBucket    Gitorious               Gerrit    SSH / HT...
Credits and resources  • Many thanks to      Shawn Pearce, father of Gerrit      Its contributors and Google Inc.  • Googl...
BACKUPreview.GerritForge™.com        Copyright © 2012 – LMIT Software
Gerrit: just code-review then ?  • Git Security – Groups      Define different “roles” in the project      System groups...
Define groups and members Admin > Groupsreview.GerritForge™.com   Copyright © 2012 – LMIT Software
Putting all together with projects  • Git Security: rights to projects      Define access rights to Git operations      ...
Define project access rights per refspec Admin > Projects > 33degree > Accessreview.GerritForge™.com                 Copyr...
Assign access rights to Groupsreview.GerritForge™.com     Copyright © 2012 – LMIT Software
… and Gerrit replication                                                         Remote                                   ...
Nächste SlideShare
Wird geladen in …5
×

Gerrit Code Review

27.167 Aufrufe

Veröffentlicht am

Overview of Gerrit Code Review with a specific focus on its Jenkins CI integration.

See and learn how to improve your Agile application lifecycle management by making your builds more stable and your development more under control.

Gerrit Code Review allows developers to share ideas and get collective ownership of the project design and code-style.

Veröffentlicht in: Bildung, Technologie
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://shorturl.at/krvUW } ......................................................................................................................... Download Full EPUB Ebook here { http://shorturl.at/krvUW } ......................................................................................................................... Download Full doc Ebook here { http://shorturl.at/krvUW } ......................................................................................................................... Download PDF EBOOK here { http://shorturl.at/krvUW } ......................................................................................................................... Download EPUB Ebook here { http://shorturl.at/krvUW } ......................................................................................................................... Download doc Ebook here { http://shorturl.at/krvUW } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy &amp; Proven Way to Build Good Habits &amp; Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Antworten 
    Sind Sie sicher, dass Sie …  Ja  Nein
    Ihre Nachricht erscheint hier
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy &amp; Proven Way to Build Good Habits &amp; Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Antworten 
    Sind Sie sicher, dass Sie …  Ja  Nein
    Ihre Nachricht erscheint hier
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://urlzs.com/UABbn } ......................................................................................................................... Download Full EPUB Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download Full doc Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download PDF EBOOK here { https://urlzs.com/UABbn } ......................................................................................................................... Download EPUB Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download doc Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy &amp; Proven Way to Build Good Habits &amp; Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Antworten 
    Sind Sie sicher, dass Sie …  Ja  Nein
    Ihre Nachricht erscheint hier
  • DOWNLOAD FULL BOOKS, INTO AVAILABLE FORMAT ......................................................................................................................... ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Antworten 
    Sind Sie sicher, dass Sie …  Ja  Nein
    Ihre Nachricht erscheint hier
  • DOWNLOAD FULL BOOKS, INTO AVAILABLE FORMAT ......................................................................................................................... ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Antworten 
    Sind Sie sicher, dass Sie …  Ja  Nein
    Ihre Nachricht erscheint hier

Gerrit Code Review

  1. 1. Main sponsor GerritLuca Milanesio
  2. 2. Who’s that guy ?review.GerritForge™.com Copyright © 2012 – LMIT Software
  3. 3. Agenda • Agile and the broken build dilemma • Can Git solve it ? • “Agile” workflow with Git • Gerrit: the smart way • Just about code-review ? • Let’s play with Gerrit live !review.GerritForge™.com Copyright © 2012 – LMIT Software
  4. 4. Agile and continuous integration • Who is using CI ? … raise your hand !!!! • Good or bad ? •Why ?review.GerritForge™.com Copyright © 2012 – LMIT Software
  5. 5. Continuous Integration is GOOD • Live “weather forecast” of the project • Detect and resolve conflicts earlier • Bring TDD to life • Enforce collective code ownership • … and much morereview.GerritForge™.com Copyright © 2012 – LMIT Software
  6. 6. Breaking the build id BAD ! • All devs gets tests broken • Build stops • Test are NOT executed … all team goes at “DEFCON1” to fix it ASAP !!review.GerritForge™.com Copyright © 2012 – LMIT Software
  7. 7. Broken build dilemma: how to avoid it ? 1. Do not PUSH until you’re 100% sure of GREEN bar 2. Create multiple personal CI builds and validate builds before PUSH 3. Install a “Jenkins Build Game” plug- in and get free beers  … DO ANY OF THEM REALLY WORK ?review.GerritForge™.com Copyright © 2012 – LMIT Software
  8. 8. Git … can you help out ? Git short story: the anti-Subversion • Apr 2005 – Linus writes PERL scripts for Linux Kernel SCM • Jul 2005 … Git 0.99 is out ! Git principles: • Continuous branching / merging / rebasing / stashing • Distributed repositories • Distributed patch distribution • Early integration (before breaking the CI)review.GerritForge™.com Copyright © 2012 – LMIT Software
  9. 9. Git topic-branches workflow B4 B5 topic1 A1 A2 A3 master C2 C3 C4 topic2 Agile workflow – one topic branch per story • Keep on branch whilst RED / AMBER bar • Continuous rebase on master • Merge on GREEN barreview.GerritForge™.com Copyright © 2012 – LMIT Software
  10. 10. Problem resolved ? • Let’s use Git then ? “My repo is the master” “Git is all about peer-to-peer dev” “Who has reverted my commits ? … !$@#!$!” • Git doesn’t enforce any policy  Peer-to-peer development allowed  Dictatorship or anarchy of changes are both allowed … is there a “better Git” out there ?review.GerritForge™.com Copyright © 2012 – LMIT Software
  11. 11. Gerrit, brief history Google Mondrian The idea: Guido Van Rossum  Code-review for Perforce  Porting to SVN and OpenSourced Rietveld  Python-based 2008 - Project fork for AOSP (Shawn Pearce / Joe Onorato) Gerrit Rietveld  Name changed to Gerrit Rietveld  Based on Git  Set of “patches” on original Guido’s Rietveld project gerrit 2009 - Gerrit 2, the Java + GWT rewriting (Shawn Pearce)review.GerritForge™.com Copyright © 2012 – LMIT Software
  12. 12. What is Gerrit today ? • 100% pure Java SSH and HTTP Git backend  Powered by JGit • GWT Web-view administration  Users and Groups  Project and branch security  Git repository browsing • Git repository replication engine • Code collaboration and review • Code validation through Jenkins Triggersreview.GerritForge™.com Copyright © 2012 – LMIT Software
  13. 13. Gerrit: high level workflow CI Build: OK master A1review.GerritForge™.com Copyright © 2012 – LMIT Software
  14. 14. Gerrit: high level workflow CI Build: OK master A1 clone local A1 masterreview.GerritForge™.com Copyright © 2012 – LMIT Software
  15. 15. Gerrit: high level workflow CI Build: OK master A1 clone local A1 C2 masterreview.GerritForge™.com Copyright © 2012 – LMIT Software
  16. 16. Gerrit: high level workflow CI Build: OK master A1 C2 refs/for/master clone push local A1 C2 masterreview.GerritForge™.com Copyright © 2012 – LMIT Software
  17. 17. Gerrit: high level workflow CI Build: OK master A1 Verified: -1 (build failed) C2 refs/for/master clone push local A1 C2 masterreview.GerritForge™.com Copyright © 2012 – LMIT Software
  18. 18. Gerrit: high level workflow CI Build: OK master A1 Verified: -1 (build failed) C2 C2* refs/for/master clone push push local A1 C2 C2* masterreview.GerritForge™.com Copyright © 2012 – LMIT Software
  19. 19. Gerrit: high level workflow CI Build: OK master A1 Verified: -1 Verified: +1 (build failed) (build OK) C2 C2* refs/for/master clone push push local A1 C2 C2* masterreview.GerritForge™.com Copyright © 2012 – LMIT Software
  20. 20. Gerrit: high level workflow CI Build: OK master A1 Verified: -1 Verified: +1 (build failed) (build OK) C2 C2* refs/for/master Reviewed: +2 clone push push local A1 C2 C2* masterreview.GerritForge™.com Copyright © 2012 – LMIT Software
  21. 21. Gerrit: high level workflow CI Build: OK CI Build: OK master A1 C2* Verified: -1 Verified: +1 (build failed) (build OK) C2 C2* refs/for/master Reviewed: +2 clone push push local A1 C2 C2* masterreview.GerritForge™.com Copyright © 2012 – LMIT Software
  22. 22. Cool, isn’t it ? • Gerrit allow “automatic” topic-branches • Triggers with Jenkins branch validation • Enforce collective code-ownership  People “interacts” with the code changes  Discussion on style and architecture  Democratic voting (+1 / -1) • Project history  Reason behind changes is recorded in code-reviewreview.GerritForge™.com Copyright © 2012 – LMIT Software
  23. 23. See Gerrit “live” in actionreview.GerritForge™.com Copyright © 2012 – LMIT Software
  24. 24. 1. Set-up • Option-A: download and install 1. Download from http://code.google.com/p/gerrit/downloads/list 2. Gerrit install wizard: java –jar gerrit-2.2.2.1.war init -d ~/gerrit 3. Run Gerrit: ~/gerrit/bin/gerrit.sh start • Option-B: Gerrit as hosted service  Assembla.com (free for OpenSorce projects)  GitEnterprise.com (free up to 10 users)review.GerritForge™.com Copyright © 2012 – LMIT Software
  25. 25. 2. Create user and add SSH keys • Option-A: not easy   Gerrit doesn’t support a “local user registry”  Options: LDAP or OpenID • Option-B: use the provider user registration  Assembla: https://www.assembla.com/signup  GitEnterprise: https://gitent-scm.com/signupreview.GerritForge™.com Copyright © 2012 – LMIT Software
  26. 26. 3. Talk to Gerrit via SSH • Gerrit SSH console  Listen at 29418 port  Not a real SSH server (just Gerrit listening)review.GerritForge™.com Copyright © 2012 – LMIT Software
  27. 27. 4. Create a Gerrit project • Gerrit Project is:  Git repository (use “path notation” to organise projects)  Access permissions  Code-review and change-sets • Option-A: use Gerrit SSH command $ ssh -p 29418 lmilanesio@localhost gerrit create-project lmit/33degree • Option-B: user the provider-specific page  Assembla: N/A (only 1 project associated to your “space”)  GitEnterprise: https://gitent-scm.com/newreporeview.GerritForge™.com Copyright © 2012 – LMIT Software
  28. 28. 5. Clone repo from Gerrit • Git SSH repository URL is: ssh://<user>@<host>:29418/<Gerrit project>.git • Gerrit supports HTTP or HTTP/S repository URL: http://<Gerrit URL>/p/<Gerrit project>.git NOTE: For HTTP authentication, put your credentials on ~/.netrc file machine <hostname> login <username> password <password>review.GerritForge™.com Copyright © 2012 – LMIT Software
  29. 29. 6. Gerrit Change-Id • SHA-1 GUID of a change-set under review • MUST be last line of commit msg Hint: install Gerrit post-commit hook for auto- generating Change-Id after each Git commit Now all Git commit will auto-generate a Change-Id !review.GerritForge™.com Copyright © 2012 – LMIT Software
  30. 30. 7. Submit a change for review • Change for review committed locally • Push to refs/for/<branch> for submitting local Git changes for review on <branch>review.GerritForge™.com Copyright © 2012 – LMIT Software
  31. 31. 8. Verify change against CIreview.GerritForge™.com Copyright © 2012 – LMIT Software
  32. 32. 9. Additional patch-set to Change-Id • Fix the problem locally • Amend the commit (same Change-Id) • Push again to refs/for/<branch> for adding one extra change-setreview.GerritForge™.com Copyright © 2012 – LMIT Software
  33. 33. 10. Change-Id is validated against CI • Request code-reviewreview.GerritForge™.com Copyright © 2012 – LMIT Software
  34. 34. 11. Review and comment changesreview.GerritForge™.com Copyright © 2012 – LMIT Software
  35. 35. 12. Review merge and submit change • One or more reviewers can “vote” for the change • Authorised users can then “Submit” the change. • Change is automatically merged to masterreview.GerritForge™.com Copyright © 2012 – LMIT Software
  36. 36. 13. Master build is triggered … SUCCESS !!review.GerritForge™.com Copyright © 2012 – LMIT Software
  37. 37. … is just about code-review then ? GitHub BitBucket Gitorious Gerrit SSH / HTTPS Free public repo Free private repo Repo security Branch security Code review Hooks / API Replication CI Integration OpenSource / extensible Issue-tracker integrationreview.GerritForge™.com Copyright © 2012 – LMIT Software
  38. 38. Credits and resources • Many thanks to Shawn Pearce, father of Gerrit Its contributors and Google Inc. • Google Gerrit code-review http://code.google.com/p/gerrit/ • Assembla Gerrit http://review.assembla.com • GitEnterprise http://review.gitent-scm.com @gitenterprise Slides available at http://www.slideshare.net/lucamilanesio Follow me: @lucamilanesioreview.GerritForge™.com Copyright © 2012 – LMIT Software
  39. 39. BACKUPreview.GerritForge™.com Copyright © 2012 – LMIT Software
  40. 40. Gerrit: just code-review then ? • Git Security – Groups Define different “roles” in the project System groups • Anonymous users: use for public projects • Registered Users: all users • Administrators: to administer Gerrit • Project Owners: to administer projects • Non-interactive Users: for CI or batch operations Groups can be hierarchical (groups of groups)review.GerritForge™.com Copyright © 2012 – LMIT Software
  41. 41. Define groups and members Admin > Groupsreview.GerritForge™.com Copyright © 2012 – LMIT Software
  42. 42. Putting all together with projects • Git Security: rights to projects Define access rights to Git operations Control the Gerrit identity vs Git author / committer Delegate project administration Assign code-review voting range rights Define who can submit and merge changes Organise project rights hirarchicallyreview.GerritForge™.com Copyright © 2012 – LMIT Software
  43. 43. Define project access rights per refspec Admin > Projects > 33degree > Accessreview.GerritForge™.com Copyright © 2012 – LMIT Software
  44. 44. Assign access rights to Groupsreview.GerritForge™.com Copyright © 2012 – LMIT Software
  45. 45. … and Gerrit replication Remote gerrit or git Remote gerrit or git Master gerritreview.GerritForge™.com Copyright © 2012 – LMIT Software

×