SlideShare a Scribd company logo
1 of 26
How to cook a Plugin

Luca Milanesio
GerritForge LLP

Luca@gerritforge.com
http://www.gerritforge.com
Base ingredients
       1. Gerrit code-review source
          οƒ˜ Ver. 2.5 or later
       2. Maven 3.x and Internet
          connectivity
          οƒ˜ Dependencies and Gerrit Plug-in API
       3. Focus for your plug-in ?
          οƒ˜ HTTP/HTML ?
          οƒ˜ SSH command ?
          οƒ˜ Init step ?
          οƒ˜ Gerrit GUI ?
          οƒ˜ Gerrit internals ?

      Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
                                                                                                                                     gerrit
                                                                                                                                     User Summit 2012
Step-1: get Gerrit 2.5 source

$ git clone -b v2.5 https://gerrit-review.googlesource.com/gerrit
Cloning into 'gerrit'...
remote: Counting objects: 5622, done
remote: Finding sources: 100% (3294/3294)
remote: Getting sizes: 100% (2224/2224)
remote: Compressing objects: 100% (2224/2224)
remote: Total 73349 (delta 39481), reused 72619 (delta 39381)
Receiving objects: 100% (73349/73349), 14.30 MiB | 348 KiB/s, done.
Resolving deltas: 100% (39939/39939), done.
Note: checking out 'b465b6d753559781bcc44adf1077b09d820d09a5'.




                Needed for getting Gerrit plug-in APIs archetypes and
                sources (NOT yet on Maven public repos)




         Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
                                                                                                                                        gerrit
                                                                                                                                        User Summit 2012
Step-2: build Gerrit plug-in archetype
$ cd gerrit/gerrit-plugin-archetype && mvn install && cd ../..
[INFO] -----------------------------------------------------------------
[INFO] Building Gerrit Code Review - Plugin Archetype 2.5-SNAPSHOT
[INFO] -----------------------------------------------------------------
[...lots of Maven rubbish ...]
[INFO] Installing /Users/lucamilanesio/GerritUserSummit/gerrit/gerrit-
plugin-archetype/target/gerrit-plugin-archetype-2.5-SNAPSHOT.jar to
/Users/lucamilanesio/.m2/repository/com/google/gerrit/gerrit-plugin-
archetype/2.5-SNAPSHOT/gerrit-plugin-archetype-2.5-SNAPSHOT.jar
[INFO] Installing /Users/lucamilanesio/GerritUserSummit/gerrit/gerrit-
plugin-archetype/pom.xml to
/Users/lucamilanesio/.m2/repository/com/google/gerrit/gerrit-plugin-
archetype/2.5-SNAPSHOT/gerrit-plugin-archetype-2.5-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------




         Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
                                                                                                                                        gerrit
                                                                                                                                        User Summit 2012
Step-3: create your plug-in project
$ mvn archetype:generate -DarchetypeGroupId=com.google.gerrit 
    -DarchetypeArtifactId=gerrit-plugin-archetype 
    -DarchetypeVersion=2.5-SNAPSHOT 
    -DgerritApiVersion=2.5 
    -DgroupId=com.gerritforge -Dversion=1.0-SNAPSHOT 
    -DImplementation-Url=http://gerritforge.com 
    -DImplementation-Vendor=GerritForge 
    -DartifactId=plugin10mins -DpluginName=plugin10mins
[...]
Confirm properties configuration:
[...]
gerritApiType: plugin
gerritApiVersion: 2.5-SNAPSHOT
pluginName: plugin10mins
 Y: :
[INFO] -------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] -------------------------------------------------------------


         Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
                                                                                                                                        gerrit
                                                                                                                                        User Summit 2012
Step-4: build and install plugin
$ cd plugin10mins && mvn package && cp target/plugin10mins*jar
$GERRIT_SITE/plugins/plugin10mins.jar
[INFO] ---------------------------------------------------------------
[INFO] Building plugin10mins 1.0-SNAPSHOT
[INFO] ---------------------------------------------------------------
[...lots of Maven rubbish ...]
[INFO] Building jar:
/Users/lucamilanesio/GerritUserSummit/plugin10mins/target/plugin10mins-
1.0-SNAPSHOT.jar
[INFO] ---------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ---------------------------------------------------------------




         Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
                                                                                                                                        gerrit
                                                                                                                                        User Summit 2012
Step-5: Ready to Go  … starter is served
Gerrit plugins hot-deploy
  οƒ˜ No need to restart: plugins are automatically scanned and loaded
$ tail -1 $GERRIT_SITE/logs/error_log
[2012-11-09 12:05:33,838] INFO
com.google.gerrit.server.plugins.PluginLoader : Loaded plugin plugin10mins


http://<<GerritURL>>/#/admin/plugins/




         Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
                                                                                                                                        gerrit
                                                                                                                                        User Summit 2012
First course: let's add some initial code
First goal: adding HTTP/HTML features
   οƒ˜ New Server-side feature: show Gerrit server date/time

Gerrit HTTP plug-ins have the ability to:
  οƒ˜ Define new HTTP Servlets
  οƒ˜ Map Servlets to plugin URLs paths automatically
  οƒ˜ Define static resources mapped over HTTP
       (i.e. CSS, images, other)




        Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
                                                                                                                                       gerrit
                                                                                                                                       User Summit 2012
Step-1: Disable Guice modules in MF
Plug-in archetype has created Guice Modules
We will use auto-registration: comment out modules in pom.xml




       Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
                                                                                                                                      gerrit
                                                                                                                                      User Summit 2012
Step-2: Define the ServerTime servlet
                                              Automatically register this Servlet to
                                              <gerrit-url>/plugins/<plugin-name>/servertime


                                                                                                                      Plug-ins inherit
                                                                                                                      Gerrit class loader:
                                                                                                                      Servlet-API is
                                                                                                                      covered by PlugIn
                                                                                                                      API




      Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
                                                                                                                                     gerrit
                                                                                                                                     User Summit 2012
Step-3: add static resources
 We use bootstrap.css in our generated HTML page
 /static folder is automatically managed by Gerrit and mapped to
  <<gerrit-url>>/plugins/<plugin-name>/static


$ mkdir src/main/resources/static/

$ curl http://gitblit.com/bootstrap/css/bootstrap.css 
  -o src/main/resources/static/bootstrap.css
 % Total    % Received % Xferd Average Speed    Time    Time   Time
Current
                                 Dload Upload    Total   Spent  Left Speed
100 99896 100 99896     0     0 49384       0 0:00:02 0:00:02 --:--:--
98033




          Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
                                                                                                                                         gerrit
                                                                                                                                         User Summit 2012
Step-4: Rebuild and install
$ cd mvn package && cp target/plugin10mins*jar
$GERRIT_SITE/plugins/plugin10mins.jar
[...lots of Maven rubbish ...]
[INFO] Building jar:
/Users/lucamilanesio/GerritUserSummit/plugin10mins/target/plugin10mins-1.0-
SNAPSHOT.jar
[INFO] ---------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ---------------------------------------------------------------
Gerrit automatically scans for changes in $GERRIT_SITE/plugins: wait
for your plugin getting reloaded

$ tail -f -1 $GERRIT_SITE/logs/error_log
[2012-11-09 15:49:09,082] INFO
com.google.gerrit.server.plugins.PluginLoader : Reloading plugin
plugin10mins



         Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
                                                                                                                                        gerrit
                                                                                                                                        User Summit 2012
Step-5: First course is on the table 
http://<<GerritURL>>/plugins/plugin10mins/servertime




        Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
                                                                                                                                       gerrit
                                                                                                                                       User Summit 2012
Main course now: get injected by Gerrit
Let's make it useful: extend Gerrit functionality
  οƒ˜ Get injected the same objects available in Gerrit (well, almost)
  οƒ˜ Access Gerrit DB and JGit backend
  οƒ˜ Display my commit from a repository

Our HTTP plug-in will have now the ability to:
  οƒ˜ Current user identity
  οƒ˜ Check if user has access that the repository
  οƒ˜ Open the repository and get latest commit



        Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
                                                                                                                                       gerrit
                                                                                                                                       User Summit 2012
Step-1: New Servlet "LastCommit"
Define a new Servlet mapped to /lastcommit path




        Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
                                                                                                                                       gerrit
                                                                                                                                       User Summit 2012
Step-2: Gerrit injected objects
We need access to accounts, project access and Git repositories
 let's get them injected in the constructor




        Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
                                                                                                                                       gerrit
                                                                                                                                       User Summit 2012
Step-3: Get project and check access
Get project name in 'p' Servlet URL parameter; Gerrit ProjectControl
provides access control info




        Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
                                                                                                                                       gerrit
                                                                                                                                       User Summit 2012
Step-4: Get my current identity
We get the current Gerrit user and display his accounts details
(user full name and preferred e-mail)




        Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
                                                                                                                                       gerrit
                                                                                                                                       User Summit 2012
Step-5: Get latest commit from repo
Using Gerrit's own repo manager, we get our last commit in the repo




        Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
                                                                                                                                       gerrit
                                                                                                                                       User Summit 2012
Main course is served 
http://<<GerritURL>>/plugins/plugin10mins/lastcommit?p=gerritsummit




        Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
                                                                                                                                       gerrit
                                                                                                                                       User Summit 2012
Does it really work with Gerrit security ?
Logging out from Gerrit and coming back to the plug-in page …




        Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
                                                                                                                                       gerrit
                                                                                                                                       User Summit 2012
There's much more …
Gerrit plug-ins are much more than just Servlet 
  οƒ˜ Provide your own SSH commands
  οƒ˜ Listen to Gerrit events for audit-trail purposes
  οƒ˜ Implement Gerrit group backends
  … and much more coming over in Gerrit 2.6 !!!!

Plugins are just "dynamic" Guice Modules
   οƒ˜ Gerrit load and bind plug-ins modules
   οƒ˜ No modules specified  self-discovery (the one we used)



        Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
                                                                                                                                       gerrit
                                                                                                                                       User Summit 2012
Step-1: New SSH command
Create a new SshCommand exported as "servertime" command




                                                                                                         Automatically assigned to
                                                                                                         remote command:
                                                                                                         <plugin-name> servertime




       Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
                                                                                                                                      gerrit
                                                                                                                                      User Summit 2012
Step-2: Gerrit injected objects
Similarly to HTTP plug-in, we can inject Gerrit objects
 get current connected user identity




        Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
                                                                                                                                       gerrit
                                                                                                                                       User Summit 2012
Et voilΓ  le dessert !
$ mvn package && cp target/plugin10mins*jar
$GERRIT_SITE/plugins/plugin10mins.jar
[...lots of Maven rubbish ...]
[INFO] Building jar:
/Users/lucamilanesio/GerritUserSummit/plugin10mins/target/plugin10mins-
1.0-SNAPSHOT.jar
[INFO] ---------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ---------------------------------------------------------------

… wait for hot-deploy … and your new plugin command is there !
$ ssh -p 29418 administrator@localhost plugin10mins servertime
Current date/time: Fri Nov 09 21:08:41 PST 2012
Current user: administrator <admin@mycompany.com>




         Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
                                                                                                                                        gerrit
                                                                                                                                        User Summit 2012
Still hungry ?

Making a group system plugin (Colby Ranger, Google)
  Trombone room – Saturday Nov 10th - 11:30 AM

What’s coming in Gerrit 2.6 (Shawn Pearce, 2.6 Lead)
  Tambourine room – Sunday Nov 11th – 9:45 AM

JavaScript plugins (Dariusz Łuksza, CollabNet)
   Trombone room – Sunday Nov 11th – 1:30 PM

You can see these slides again at: www.slideshare.net/lucamilanesio



         Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
                                                                                                                                        gerrit
                                                                                                                                        User Summit 2012

More Related Content

What's hot

Gerrit multi-master / multi-site at GerritHub
Gerrit multi-master / multi-site at GerritHubGerrit multi-master / multi-site at GerritHub
Gerrit multi-master / multi-site at GerritHubLuca Milanesio
Β 
Introduction to GitHub Actions
Introduction to GitHub ActionsIntroduction to GitHub Actions
Introduction to GitHub ActionsBo-Yi Wu
Β 
Jetpack Navigation Component
Jetpack Navigation ComponentJetpack Navigation Component
Jetpack Navigation ComponentJames Shvarts
Β 
Building a REST Service in minutes with Spring Boot
Building a REST Service in minutes with Spring BootBuilding a REST Service in minutes with Spring Boot
Building a REST Service in minutes with Spring BootOmri Spector
Β 
Spring Bootβ€”Production Boost
Spring Bootβ€”Production BoostSpring Bootβ€”Production Boost
Spring Bootβ€”Production BoostVMware Tanzu
Β 
GitHub Actions in action
GitHub Actions in actionGitHub Actions in action
GitHub Actions in actionOleksii Holub
Β 
Jenkins tutorial
Jenkins tutorialJenkins tutorial
Jenkins tutorialHarikaReddy115
Β 
Container based CI/CD on GitHub Actions
Container based CI/CD on GitHub ActionsContainer based CI/CD on GitHub Actions
Container based CI/CD on GitHub ActionsCasey Lee
Β 
GitHub Actions (Nakov at RuseConf, Sept 2022)
GitHub Actions (Nakov at RuseConf, Sept 2022)GitHub Actions (Nakov at RuseConf, Sept 2022)
GitHub Actions (Nakov at RuseConf, Sept 2022)Svetlin Nakov
Β 
Introduction to GitHub Actions
Introduction to GitHub ActionsIntroduction to GitHub Actions
Introduction to GitHub ActionsKnoldus Inc.
Β 
Jenkins Overview
Jenkins OverviewJenkins Overview
Jenkins OverviewAhmed M. Gomaa
Β 
Git Init (Introduction to Git)
Git Init (Introduction to Git)Git Init (Introduction to Git)
Git Init (Introduction to Git)GDSC UofT Mississauga
Β 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and GithubHouari ZEGAI
Β 

What's hot (20)

Gerrit multi-master / multi-site at GerritHub
Gerrit multi-master / multi-site at GerritHubGerrit multi-master / multi-site at GerritHub
Gerrit multi-master / multi-site at GerritHub
Β 
Git
GitGit
Git
Β 
Introduction to GitHub Actions
Introduction to GitHub ActionsIntroduction to GitHub Actions
Introduction to GitHub Actions
Β 
Advanced Git
Advanced GitAdvanced Git
Advanced Git
Β 
Jetpack Navigation Component
Jetpack Navigation ComponentJetpack Navigation Component
Jetpack Navigation Component
Β 
git flow
git flowgit flow
git flow
Β 
JUnit 5
JUnit 5JUnit 5
JUnit 5
Β 
Building a REST Service in minutes with Spring Boot
Building a REST Service in minutes with Spring BootBuilding a REST Service in minutes with Spring Boot
Building a REST Service in minutes with Spring Boot
Β 
Spring Bootβ€”Production Boost
Spring Bootβ€”Production BoostSpring Bootβ€”Production Boost
Spring Bootβ€”Production Boost
Β 
GitHub Actions in action
GitHub Actions in actionGitHub Actions in action
GitHub Actions in action
Β 
Jenkins tutorial
Jenkins tutorialJenkins tutorial
Jenkins tutorial
Β 
Container based CI/CD on GitHub Actions
Container based CI/CD on GitHub ActionsContainer based CI/CD on GitHub Actions
Container based CI/CD on GitHub Actions
Β 
GitHub Actions (Nakov at RuseConf, Sept 2022)
GitHub Actions (Nakov at RuseConf, Sept 2022)GitHub Actions (Nakov at RuseConf, Sept 2022)
GitHub Actions (Nakov at RuseConf, Sept 2022)
Β 
Introduction to GitHub Actions
Introduction to GitHub ActionsIntroduction to GitHub Actions
Introduction to GitHub Actions
Β 
Jenkins Overview
Jenkins OverviewJenkins Overview
Jenkins Overview
Β 
GitLab.pptx
GitLab.pptxGitLab.pptx
GitLab.pptx
Β 
Git Init (Introduction to Git)
Git Init (Introduction to Git)Git Init (Introduction to Git)
Git Init (Introduction to Git)
Β 
Git & GitHub for Beginners
Git & GitHub for BeginnersGit & GitHub for Beginners
Git & GitHub for Beginners
Β 
Introduction git
Introduction gitIntroduction git
Introduction git
Β 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
Β 

Viewers also liked

GerritHub.io - present, past, future
GerritHub.io - present, past, futureGerritHub.io - present, past, future
GerritHub.io - present, past, futureLuca Milanesio
Β 
Gerrit Code Review Analytics
Gerrit Code Review AnalyticsGerrit Code Review Analytics
Gerrit Code Review AnalyticsLuca Milanesio
Β 
Factors de conversio
Factors de conversioFactors de conversio
Factors de conversioTxema Professor
Β 
Git workshop 33degree 2011 krakow
Git workshop 33degree 2011 krakowGit workshop 33degree 2011 krakow
Git workshop 33degree 2011 krakowLuca Milanesio
Β 
Gerrit JavaScript Plugins
Gerrit JavaScript PluginsGerrit JavaScript Plugins
Gerrit JavaScript PluginsDariusz Łuksza
Β 
Gerrit Code Review: how to script a plugin with Scala and Groovy
Gerrit Code Review: how to script a plugin with Scala and GroovyGerrit Code Review: how to script a plugin with Scala and Groovy
Gerrit Code Review: how to script a plugin with Scala and GroovyLuca Milanesio
Β 
Code review process with JetBrains UpSource
Code review process with JetBrains UpSourceCode review process with JetBrains UpSource
Code review process with JetBrains UpSourceOleksii Prohonnyi
Β 
Gerrit Code Review
Gerrit Code ReviewGerrit Code Review
Gerrit Code ReviewLuca Milanesio
Β 

Viewers also liked (8)

GerritHub.io - present, past, future
GerritHub.io - present, past, futureGerritHub.io - present, past, future
GerritHub.io - present, past, future
Β 
Gerrit Code Review Analytics
Gerrit Code Review AnalyticsGerrit Code Review Analytics
Gerrit Code Review Analytics
Β 
Factors de conversio
Factors de conversioFactors de conversio
Factors de conversio
Β 
Git workshop 33degree 2011 krakow
Git workshop 33degree 2011 krakowGit workshop 33degree 2011 krakow
Git workshop 33degree 2011 krakow
Β 
Gerrit JavaScript Plugins
Gerrit JavaScript PluginsGerrit JavaScript Plugins
Gerrit JavaScript Plugins
Β 
Gerrit Code Review: how to script a plugin with Scala and Groovy
Gerrit Code Review: how to script a plugin with Scala and GroovyGerrit Code Review: how to script a plugin with Scala and Groovy
Gerrit Code Review: how to script a plugin with Scala and Groovy
Β 
Code review process with JetBrains UpSource
Code review process with JetBrains UpSourceCode review process with JetBrains UpSource
Code review process with JetBrains UpSource
Β 
Gerrit Code Review
Gerrit Code ReviewGerrit Code Review
Gerrit Code Review
Β 

Similar to Gerrit: how to cook a plugin in only 10 mins

Gerrit Code Review v3.2 and v3.3
Gerrit Code Review v3.2 and v3.3Gerrit Code Review v3.2 and v3.3
Gerrit Code Review v3.2 and v3.3Luca Milanesio
Β 
What's new in Gerrit Code Review v3.1 and beyond
What's new in Gerrit Code Review v3.1 and beyondWhat's new in Gerrit Code Review v3.1 and beyond
What's new in Gerrit Code Review v3.1 and beyondLuca Milanesio
Β 
Build Your Own HiveMQ Extension
Build Your Own HiveMQ ExtensionBuild Your Own HiveMQ Extension
Build Your Own HiveMQ ExtensionHiveMQ
Β 
Drone CI/CD Platform
Drone CI/CD PlatformDrone CI/CD Platform
Drone CI/CD PlatformBo-Yi Wu
Β 
Exploring the GitHub Service Universe
Exploring the GitHub Service UniverseExploring the GitHub Service Universe
Exploring the GitHub Service UniverseBjΓΆrn Kimminich
Β 
Github By Nyros Developer
Github By Nyros DeveloperGithub By Nyros Developer
Github By Nyros DeveloperNyros Technologies
Β 
Gerrit is Getting Native with RPM, Deb and Docker
Gerrit is Getting Native with RPM, Deb and DockerGerrit is Getting Native with RPM, Deb and Docker
Gerrit is Getting Native with RPM, Deb and DockerLuca Milanesio
Β 
Guiding Diffy to the Enterprise land
Guiding Diffy to the Enterprise landGuiding Diffy to the Enterprise land
Guiding Diffy to the Enterprise landDariusz Łuksza
Β 
Raspberry pi and Google Cloud
Raspberry pi and Google CloudRaspberry pi and Google Cloud
Raspberry pi and Google CloudFaisal Mehmood
Β 
2015-ghci-presentation-git_gerritJenkins_final
2015-ghci-presentation-git_gerritJenkins_final2015-ghci-presentation-git_gerritJenkins_final
2015-ghci-presentation-git_gerritJenkins_finalMythri P K
Β 
GIT training - advanced for software projects
GIT training - advanced for software projectsGIT training - advanced for software projects
GIT training - advanced for software projectsThierry Gayet
Β 
Git - Boost Your DEV Team Speed and Productivity
Git - Boost Your DEV Team Speed and ProductivityGit - Boost Your DEV Team Speed and Productivity
Git - Boost Your DEV Team Speed and ProductivityKMS Technology
Β 
git-commands-cheat-sheet-infopediya-com.pdf
git-commands-cheat-sheet-infopediya-com.pdfgit-commands-cheat-sheet-infopediya-com.pdf
git-commands-cheat-sheet-infopediya-com.pdfmurad khan
Β 
Introduction to git and Github
Introduction to git and GithubIntroduction to git and Github
Introduction to git and GithubWycliff1
Β 
git github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptxgit github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptxAbelPhilipJoseph
Β 
Gerrit linuxtag2011
Gerrit linuxtag2011Gerrit linuxtag2011
Gerrit linuxtag2011thkoch
Β 
Development with Git and Gerrit - Eclipse DemoCamp Stuttgart - 2010-11-23
Development with Git and Gerrit - Eclipse DemoCamp Stuttgart - 2010-11-23Development with Git and Gerrit - Eclipse DemoCamp Stuttgart - 2010-11-23
Development with Git and Gerrit - Eclipse DemoCamp Stuttgart - 2010-11-23msohn
Β 

Similar to Gerrit: how to cook a plugin in only 10 mins (20)

Gerrit tutorial
Gerrit tutorialGerrit tutorial
Gerrit tutorial
Β 
Gerrit Code Review v3.2 and v3.3
Gerrit Code Review v3.2 and v3.3Gerrit Code Review v3.2 and v3.3
Gerrit Code Review v3.2 and v3.3
Β 
What's new in Gerrit Code Review v3.1 and beyond
What's new in Gerrit Code Review v3.1 and beyondWhat's new in Gerrit Code Review v3.1 and beyond
What's new in Gerrit Code Review v3.1 and beyond
Β 
Build Your Own HiveMQ Extension
Build Your Own HiveMQ ExtensionBuild Your Own HiveMQ Extension
Build Your Own HiveMQ Extension
Β 
Drone CI/CD Platform
Drone CI/CD PlatformDrone CI/CD Platform
Drone CI/CD Platform
Β 
Exploring the GitHub Service Universe
Exploring the GitHub Service UniverseExploring the GitHub Service Universe
Exploring the GitHub Service Universe
Β 
Github By Nyros Developer
Github By Nyros DeveloperGithub By Nyros Developer
Github By Nyros Developer
Β 
Gerrit is Getting Native with RPM, Deb and Docker
Gerrit is Getting Native with RPM, Deb and DockerGerrit is Getting Native with RPM, Deb and Docker
Gerrit is Getting Native with RPM, Deb and Docker
Β 
Plugin development
Plugin developmentPlugin development
Plugin development
Β 
Guiding Diffy to the Enterprise land
Guiding Diffy to the Enterprise landGuiding Diffy to the Enterprise land
Guiding Diffy to the Enterprise land
Β 
Raspberry pi and Google Cloud
Raspberry pi and Google CloudRaspberry pi and Google Cloud
Raspberry pi and Google Cloud
Β 
2015-ghci-presentation-git_gerritJenkins_final
2015-ghci-presentation-git_gerritJenkins_final2015-ghci-presentation-git_gerritJenkins_final
2015-ghci-presentation-git_gerritJenkins_final
Β 
GIT training - advanced for software projects
GIT training - advanced for software projectsGIT training - advanced for software projects
GIT training - advanced for software projects
Β 
Git - Boost Your DEV Team Speed and Productivity
Git - Boost Your DEV Team Speed and ProductivityGit - Boost Your DEV Team Speed and Productivity
Git - Boost Your DEV Team Speed and Productivity
Β 
GIT By Sivakrishna
GIT By SivakrishnaGIT By Sivakrishna
GIT By Sivakrishna
Β 
git-commands-cheat-sheet-infopediya-com.pdf
git-commands-cheat-sheet-infopediya-com.pdfgit-commands-cheat-sheet-infopediya-com.pdf
git-commands-cheat-sheet-infopediya-com.pdf
Β 
Introduction to git and Github
Introduction to git and GithubIntroduction to git and Github
Introduction to git and Github
Β 
git github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptxgit github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptx
Β 
Gerrit linuxtag2011
Gerrit linuxtag2011Gerrit linuxtag2011
Gerrit linuxtag2011
Β 
Development with Git and Gerrit - Eclipse DemoCamp Stuttgart - 2010-11-23
Development with Git and Gerrit - Eclipse DemoCamp Stuttgart - 2010-11-23Development with Git and Gerrit - Eclipse DemoCamp Stuttgart - 2010-11-23
Development with Git and Gerrit - Eclipse DemoCamp Stuttgart - 2010-11-23
Β 

More from Luca Milanesio

Gerrit Analytics applied to Android source code
Gerrit Analytics applied to Android source codeGerrit Analytics applied to Android source code
Gerrit Analytics applied to Android source codeLuca Milanesio
Β 
Cloud-native Gerrit Code Review
Cloud-native Gerrit Code ReviewCloud-native Gerrit Code Review
Cloud-native Gerrit Code ReviewLuca Milanesio
Β 
Gerrit Code Review migrations step-by-step
Gerrit Code Review migrations step-by-stepGerrit Code Review migrations step-by-step
Gerrit Code Review migrations step-by-stepLuca Milanesio
Β 
ChronicleMap non-blocking cache for Gerrit v3.3
ChronicleMap non-blocking cache for Gerrit v3.3ChronicleMap non-blocking cache for Gerrit v3.3
ChronicleMap non-blocking cache for Gerrit v3.3Luca Milanesio
Β 
Gerrit User Summit 2019 Keynote
Gerrit User Summit 2019 KeynoteGerrit User Summit 2019 Keynote
Gerrit User Summit 2019 KeynoteLuca Milanesio
Β 
GerritHub a true Gerrit migration story to v2.15
GerritHub a true Gerrit migration story to v2.15GerritHub a true Gerrit migration story to v2.15
GerritHub a true Gerrit migration story to v2.15Luca Milanesio
Β 
Gerrit User Summit 2018 - Keynote
Gerrit User Summit 2018 - Keynote Gerrit User Summit 2018 - Keynote
Gerrit User Summit 2018 - Keynote Luca Milanesio
Β 
Jenkins plugin for Gerrit Code Review pipelines
Jenkins plugin for Gerrit Code Review pipelinesJenkins plugin for Gerrit Code Review pipelines
Jenkins plugin for Gerrit Code Review pipelinesLuca Milanesio
Β 
Gerrit User Summit 2017 Keynote
Gerrit User Summit 2017 KeynoteGerrit User Summit 2017 Keynote
Gerrit User Summit 2017 KeynoteLuca Milanesio
Β 
How to keep Jenkins logs forever without performance issues
How to keep Jenkins logs forever without performance issuesHow to keep Jenkins logs forever without performance issues
How to keep Jenkins logs forever without performance issuesLuca Milanesio
Β 
Jenkins Pipeline on your Local Box to Reduce Cycle Time
Jenkins Pipeline on your Local Box to Reduce Cycle TimeJenkins Pipeline on your Local Box to Reduce Cycle Time
Jenkins Pipeline on your Local Box to Reduce Cycle TimeLuca Milanesio
Β 
Jenkins world 2017 - Data-Driven CI Pipeline with Gerrit Code Review
Jenkins world 2017 - Data-Driven CI Pipeline with Gerrit Code ReviewJenkins world 2017 - Data-Driven CI Pipeline with Gerrit Code Review
Jenkins world 2017 - Data-Driven CI Pipeline with Gerrit Code ReviewLuca Milanesio
Β 
Stable master workflow with Gerrit Code Review
Stable master workflow with Gerrit Code ReviewStable master workflow with Gerrit Code Review
Stable master workflow with Gerrit Code ReviewLuca Milanesio
Β 
Zero-Downtime Gerrit Code Review Upgrade
Zero-Downtime Gerrit Code Review UpgradeZero-Downtime Gerrit Code Review Upgrade
Zero-Downtime Gerrit Code Review UpgradeLuca Milanesio
Β 
Speed up Continuous Delivery with BigData Analytics
Speed up Continuous Delivery with BigData AnalyticsSpeed up Continuous Delivery with BigData Analytics
Speed up Continuous Delivery with BigData AnalyticsLuca Milanesio
Β 
Devoxx 2016 Using Jenkins, Gerrit and Spark for Continuous Delivery Analytics
Devoxx 2016 Using Jenkins, Gerrit and Spark for Continuous Delivery AnalyticsDevoxx 2016 Using Jenkins, Gerrit and Spark for Continuous Delivery Analytics
Devoxx 2016 Using Jenkins, Gerrit and Spark for Continuous Delivery AnalyticsLuca Milanesio
Β 
Gerrit jenkins-big data-continuous-delivery
Gerrit jenkins-big data-continuous-deliveryGerrit jenkins-big data-continuous-delivery
Gerrit jenkins-big data-continuous-deliveryLuca Milanesio
Β 
Is TDD dead or alive?
Is TDD dead or alive?Is TDD dead or alive?
Is TDD dead or alive?Luca Milanesio
Β 
Jenkins User Conference - Continuous Delivery on Mobile
Jenkins User Conference - Continuous Delivery on MobileJenkins User Conference - Continuous Delivery on Mobile
Jenkins User Conference - Continuous Delivery on MobileLuca Milanesio
Β 
Mobile Application Lifecycle with Jekins, Trello and CollabNet TeamForge
Mobile Application Lifecycle with Jekins, Trello and CollabNet TeamForgeMobile Application Lifecycle with Jekins, Trello and CollabNet TeamForge
Mobile Application Lifecycle with Jekins, Trello and CollabNet TeamForgeLuca Milanesio
Β 

More from Luca Milanesio (20)

Gerrit Analytics applied to Android source code
Gerrit Analytics applied to Android source codeGerrit Analytics applied to Android source code
Gerrit Analytics applied to Android source code
Β 
Cloud-native Gerrit Code Review
Cloud-native Gerrit Code ReviewCloud-native Gerrit Code Review
Cloud-native Gerrit Code Review
Β 
Gerrit Code Review migrations step-by-step
Gerrit Code Review migrations step-by-stepGerrit Code Review migrations step-by-step
Gerrit Code Review migrations step-by-step
Β 
ChronicleMap non-blocking cache for Gerrit v3.3
ChronicleMap non-blocking cache for Gerrit v3.3ChronicleMap non-blocking cache for Gerrit v3.3
ChronicleMap non-blocking cache for Gerrit v3.3
Β 
Gerrit User Summit 2019 Keynote
Gerrit User Summit 2019 KeynoteGerrit User Summit 2019 Keynote
Gerrit User Summit 2019 Keynote
Β 
GerritHub a true Gerrit migration story to v2.15
GerritHub a true Gerrit migration story to v2.15GerritHub a true Gerrit migration story to v2.15
GerritHub a true Gerrit migration story to v2.15
Β 
Gerrit User Summit 2018 - Keynote
Gerrit User Summit 2018 - Keynote Gerrit User Summit 2018 - Keynote
Gerrit User Summit 2018 - Keynote
Β 
Jenkins plugin for Gerrit Code Review pipelines
Jenkins plugin for Gerrit Code Review pipelinesJenkins plugin for Gerrit Code Review pipelines
Jenkins plugin for Gerrit Code Review pipelines
Β 
Gerrit User Summit 2017 Keynote
Gerrit User Summit 2017 KeynoteGerrit User Summit 2017 Keynote
Gerrit User Summit 2017 Keynote
Β 
How to keep Jenkins logs forever without performance issues
How to keep Jenkins logs forever without performance issuesHow to keep Jenkins logs forever without performance issues
How to keep Jenkins logs forever without performance issues
Β 
Jenkins Pipeline on your Local Box to Reduce Cycle Time
Jenkins Pipeline on your Local Box to Reduce Cycle TimeJenkins Pipeline on your Local Box to Reduce Cycle Time
Jenkins Pipeline on your Local Box to Reduce Cycle Time
Β 
Jenkins world 2017 - Data-Driven CI Pipeline with Gerrit Code Review
Jenkins world 2017 - Data-Driven CI Pipeline with Gerrit Code ReviewJenkins world 2017 - Data-Driven CI Pipeline with Gerrit Code Review
Jenkins world 2017 - Data-Driven CI Pipeline with Gerrit Code Review
Β 
Stable master workflow with Gerrit Code Review
Stable master workflow with Gerrit Code ReviewStable master workflow with Gerrit Code Review
Stable master workflow with Gerrit Code Review
Β 
Zero-Downtime Gerrit Code Review Upgrade
Zero-Downtime Gerrit Code Review UpgradeZero-Downtime Gerrit Code Review Upgrade
Zero-Downtime Gerrit Code Review Upgrade
Β 
Speed up Continuous Delivery with BigData Analytics
Speed up Continuous Delivery with BigData AnalyticsSpeed up Continuous Delivery with BigData Analytics
Speed up Continuous Delivery with BigData Analytics
Β 
Devoxx 2016 Using Jenkins, Gerrit and Spark for Continuous Delivery Analytics
Devoxx 2016 Using Jenkins, Gerrit and Spark for Continuous Delivery AnalyticsDevoxx 2016 Using Jenkins, Gerrit and Spark for Continuous Delivery Analytics
Devoxx 2016 Using Jenkins, Gerrit and Spark for Continuous Delivery Analytics
Β 
Gerrit jenkins-big data-continuous-delivery
Gerrit jenkins-big data-continuous-deliveryGerrit jenkins-big data-continuous-delivery
Gerrit jenkins-big data-continuous-delivery
Β 
Is TDD dead or alive?
Is TDD dead or alive?Is TDD dead or alive?
Is TDD dead or alive?
Β 
Jenkins User Conference - Continuous Delivery on Mobile
Jenkins User Conference - Continuous Delivery on MobileJenkins User Conference - Continuous Delivery on Mobile
Jenkins User Conference - Continuous Delivery on Mobile
Β 
Mobile Application Lifecycle with Jekins, Trello and CollabNet TeamForge
Mobile Application Lifecycle with Jekins, Trello and CollabNet TeamForgeMobile Application Lifecycle with Jekins, Trello and CollabNet TeamForge
Mobile Application Lifecycle with Jekins, Trello and CollabNet TeamForge
Β 

Recently uploaded

Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Dr. Mazin Mohamed alkathiri
Β 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
Β 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
Β 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
Β 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
Β 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
Β 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 πŸ’ž Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 πŸ’ž Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 πŸ’ž Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 πŸ’ž Full Nigh...Pooja Nehwal
Β 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
Β 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
Β 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
Β 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
Β 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
Β 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
Β 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
Β 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
Β 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
Β 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
Β 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
Β 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
Β 

Recently uploaded (20)

Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
Β 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
Β 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
Β 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
Β 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
Β 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Β 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 πŸ’ž Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 πŸ’ž Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 πŸ’ž Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 πŸ’ž Full Nigh...
Β 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Β 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
Β 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
Β 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
Β 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
Β 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
Β 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
Β 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
Β 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
Β 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
Β 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
Β 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Β 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
Β 

Gerrit: how to cook a plugin in only 10 mins

  • 1. How to cook a Plugin Luca Milanesio GerritForge LLP Luca@gerritforge.com http://www.gerritforge.com
  • 2. Base ingredients 1. Gerrit code-review source οƒ˜ Ver. 2.5 or later 2. Maven 3.x and Internet connectivity οƒ˜ Dependencies and Gerrit Plug-in API 3. Focus for your plug-in ? οƒ˜ HTTP/HTML ? οƒ˜ SSH command ? οƒ˜ Init step ? οƒ˜ Gerrit GUI ? οƒ˜ Gerrit internals ? Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. gerrit User Summit 2012
  • 3. Step-1: get Gerrit 2.5 source $ git clone -b v2.5 https://gerrit-review.googlesource.com/gerrit Cloning into 'gerrit'... remote: Counting objects: 5622, done remote: Finding sources: 100% (3294/3294) remote: Getting sizes: 100% (2224/2224) remote: Compressing objects: 100% (2224/2224) remote: Total 73349 (delta 39481), reused 72619 (delta 39381) Receiving objects: 100% (73349/73349), 14.30 MiB | 348 KiB/s, done. Resolving deltas: 100% (39939/39939), done. Note: checking out 'b465b6d753559781bcc44adf1077b09d820d09a5'. Needed for getting Gerrit plug-in APIs archetypes and sources (NOT yet on Maven public repos) Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. gerrit User Summit 2012
  • 4. Step-2: build Gerrit plug-in archetype $ cd gerrit/gerrit-plugin-archetype && mvn install && cd ../.. [INFO] ----------------------------------------------------------------- [INFO] Building Gerrit Code Review - Plugin Archetype 2.5-SNAPSHOT [INFO] ----------------------------------------------------------------- [...lots of Maven rubbish ...] [INFO] Installing /Users/lucamilanesio/GerritUserSummit/gerrit/gerrit- plugin-archetype/target/gerrit-plugin-archetype-2.5-SNAPSHOT.jar to /Users/lucamilanesio/.m2/repository/com/google/gerrit/gerrit-plugin- archetype/2.5-SNAPSHOT/gerrit-plugin-archetype-2.5-SNAPSHOT.jar [INFO] Installing /Users/lucamilanesio/GerritUserSummit/gerrit/gerrit- plugin-archetype/pom.xml to /Users/lucamilanesio/.m2/repository/com/google/gerrit/gerrit-plugin- archetype/2.5-SNAPSHOT/gerrit-plugin-archetype-2.5-SNAPSHOT.pom [INFO] ------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------ Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. gerrit User Summit 2012
  • 5. Step-3: create your plug-in project $ mvn archetype:generate -DarchetypeGroupId=com.google.gerrit -DarchetypeArtifactId=gerrit-plugin-archetype -DarchetypeVersion=2.5-SNAPSHOT -DgerritApiVersion=2.5 -DgroupId=com.gerritforge -Dversion=1.0-SNAPSHOT -DImplementation-Url=http://gerritforge.com -DImplementation-Vendor=GerritForge -DartifactId=plugin10mins -DpluginName=plugin10mins [...] Confirm properties configuration: [...] gerritApiType: plugin gerritApiVersion: 2.5-SNAPSHOT pluginName: plugin10mins Y: : [INFO] ------------------------------------------------------------- [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------- Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. gerrit User Summit 2012
  • 6. Step-4: build and install plugin $ cd plugin10mins && mvn package && cp target/plugin10mins*jar $GERRIT_SITE/plugins/plugin10mins.jar [INFO] --------------------------------------------------------------- [INFO] Building plugin10mins 1.0-SNAPSHOT [INFO] --------------------------------------------------------------- [...lots of Maven rubbish ...] [INFO] Building jar: /Users/lucamilanesio/GerritUserSummit/plugin10mins/target/plugin10mins- 1.0-SNAPSHOT.jar [INFO] --------------------------------------------------------------- [INFO] BUILD SUCCESS [INFO] --------------------------------------------------------------- Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. gerrit User Summit 2012
  • 7. Step-5: Ready to Go  … starter is served Gerrit plugins hot-deploy οƒ˜ No need to restart: plugins are automatically scanned and loaded $ tail -1 $GERRIT_SITE/logs/error_log [2012-11-09 12:05:33,838] INFO com.google.gerrit.server.plugins.PluginLoader : Loaded plugin plugin10mins http://<<GerritURL>>/#/admin/plugins/ Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. gerrit User Summit 2012
  • 8. First course: let's add some initial code First goal: adding HTTP/HTML features οƒ˜ New Server-side feature: show Gerrit server date/time Gerrit HTTP plug-ins have the ability to: οƒ˜ Define new HTTP Servlets οƒ˜ Map Servlets to plugin URLs paths automatically οƒ˜ Define static resources mapped over HTTP (i.e. CSS, images, other) Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. gerrit User Summit 2012
  • 9. Step-1: Disable Guice modules in MF Plug-in archetype has created Guice Modules We will use auto-registration: comment out modules in pom.xml Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. gerrit User Summit 2012
  • 10. Step-2: Define the ServerTime servlet Automatically register this Servlet to <gerrit-url>/plugins/<plugin-name>/servertime Plug-ins inherit Gerrit class loader: Servlet-API is covered by PlugIn API Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. gerrit User Summit 2012
  • 11. Step-3: add static resources We use bootstrap.css in our generated HTML page /static folder is automatically managed by Gerrit and mapped to <<gerrit-url>>/plugins/<plugin-name>/static $ mkdir src/main/resources/static/ $ curl http://gitblit.com/bootstrap/css/bootstrap.css -o src/main/resources/static/bootstrap.css % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 99896 100 99896 0 0 49384 0 0:00:02 0:00:02 --:--:-- 98033 Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. gerrit User Summit 2012
  • 12. Step-4: Rebuild and install $ cd mvn package && cp target/plugin10mins*jar $GERRIT_SITE/plugins/plugin10mins.jar [...lots of Maven rubbish ...] [INFO] Building jar: /Users/lucamilanesio/GerritUserSummit/plugin10mins/target/plugin10mins-1.0- SNAPSHOT.jar [INFO] --------------------------------------------------------------- [INFO] BUILD SUCCESS [INFO] --------------------------------------------------------------- Gerrit automatically scans for changes in $GERRIT_SITE/plugins: wait for your plugin getting reloaded $ tail -f -1 $GERRIT_SITE/logs/error_log [2012-11-09 15:49:09,082] INFO com.google.gerrit.server.plugins.PluginLoader : Reloading plugin plugin10mins Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. gerrit User Summit 2012
  • 13. Step-5: First course is on the table  http://<<GerritURL>>/plugins/plugin10mins/servertime Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. gerrit User Summit 2012
  • 14. Main course now: get injected by Gerrit Let's make it useful: extend Gerrit functionality οƒ˜ Get injected the same objects available in Gerrit (well, almost) οƒ˜ Access Gerrit DB and JGit backend οƒ˜ Display my commit from a repository Our HTTP plug-in will have now the ability to: οƒ˜ Current user identity οƒ˜ Check if user has access that the repository οƒ˜ Open the repository and get latest commit Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. gerrit User Summit 2012
  • 15. Step-1: New Servlet "LastCommit" Define a new Servlet mapped to /lastcommit path Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. gerrit User Summit 2012
  • 16. Step-2: Gerrit injected objects We need access to accounts, project access and Git repositories  let's get them injected in the constructor Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. gerrit User Summit 2012
  • 17. Step-3: Get project and check access Get project name in 'p' Servlet URL parameter; Gerrit ProjectControl provides access control info Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. gerrit User Summit 2012
  • 18. Step-4: Get my current identity We get the current Gerrit user and display his accounts details (user full name and preferred e-mail) Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. gerrit User Summit 2012
  • 19. Step-5: Get latest commit from repo Using Gerrit's own repo manager, we get our last commit in the repo Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. gerrit User Summit 2012
  • 20. Main course is served  http://<<GerritURL>>/plugins/plugin10mins/lastcommit?p=gerritsummit Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. gerrit User Summit 2012
  • 21. Does it really work with Gerrit security ? Logging out from Gerrit and coming back to the plug-in page … Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. gerrit User Summit 2012
  • 22. There's much more … Gerrit plug-ins are much more than just Servlet  οƒ˜ Provide your own SSH commands οƒ˜ Listen to Gerrit events for audit-trail purposes οƒ˜ Implement Gerrit group backends … and much more coming over in Gerrit 2.6 !!!! Plugins are just "dynamic" Guice Modules οƒ˜ Gerrit load and bind plug-ins modules οƒ˜ No modules specified  self-discovery (the one we used) Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. gerrit User Summit 2012
  • 23. Step-1: New SSH command Create a new SshCommand exported as "servertime" command Automatically assigned to remote command: <plugin-name> servertime Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. gerrit User Summit 2012
  • 24. Step-2: Gerrit injected objects Similarly to HTTP plug-in, we can inject Gerrit objects  get current connected user identity Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. gerrit User Summit 2012
  • 25. Et voilΓ  le dessert ! $ mvn package && cp target/plugin10mins*jar $GERRIT_SITE/plugins/plugin10mins.jar [...lots of Maven rubbish ...] [INFO] Building jar: /Users/lucamilanesio/GerritUserSummit/plugin10mins/target/plugin10mins- 1.0-SNAPSHOT.jar [INFO] --------------------------------------------------------------- [INFO] BUILD SUCCESS [INFO] --------------------------------------------------------------- … wait for hot-deploy … and your new plugin command is there ! $ ssh -p 29418 administrator@localhost plugin10mins servertime Current date/time: Fri Nov 09 21:08:41 PST 2012 Current user: administrator <admin@mycompany.com> Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. gerrit User Summit 2012
  • 26. Still hungry ? Making a group system plugin (Colby Ranger, Google) Trombone room – Saturday Nov 10th - 11:30 AM What’s coming in Gerrit 2.6 (Shawn Pearce, 2.6 Lead) Tambourine room – Sunday Nov 11th – 9:45 AM JavaScript plugins (Dariusz Łuksza, CollabNet) Trombone room – Sunday Nov 11th – 1:30 PM You can see these slides again at: www.slideshare.net/lucamilanesio Gerrit plugin in 10 mins by Luca Milanesio is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. gerrit User Summit 2012