Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
SlideShare a Scribd company logo
Luca Milanesio
GerritForge
Luca@gerritforge.com
http://www.gerritforge.com
Twitter: @gitenterprise
How to script a Plugin
2
About Luca
• Luca Milanesio
Co-founder of GerritForge
• over 20 years of experience
in Agile Development
SCM, CI and ALM worldwide
• Contributor to Jenkins
since 2007 (and previously Hudson)
• Git SCM mentor
for the Enterprise since 2009
• Contributor to Gerrit Code Review community since 2011
3
About GerritForge
Founded in 2009 in London UK
Mission: Agile Enterprise
Products:
4
Agenda
 Where we come from ?
 2 years ago: Gerrit plugins
 We want more plugins
 Create a plugin in 60 seconds
 What, how and when are coming?
 Plugins showcase
5
WHO REMEMBERS
THIS ?
GitTogether 2011
Gerrit 2.2.x
6
Why don’t we
introduce plugins ?
They have been so
successful with
Jenkins
7
Gerrit Hackathon
7th of May 2012
The first “helloworld”
plugin was born
8
WHO REMEMBERS THIS ?
Gerrit Summit 2012
Ver. 2.5.x
9
Gerrit Plugins
Growth
in 2 years
50
10
Can we do more ?
Let's ask Jenkins 
11
PLUGINS SUCCESS
=
COMMUNITY
ENGAGEMENT
12
COMMUNITY
=
BRIDGING
DIFFERENCES
13
That would be very useful for
Gerrit Administrators to be
able to write quick automation
scripts for their daily tasks. I
would prioritize groovy plugin
more for the popularity of
groovy scripting.
I think adding a "scripting
language plugin" to support
plugins written in scripting
languages is a very good idea
Hi all,
I was thinking about extending
Gerrit capabilities to load
plugins / extensions by
providing "wrapper" for other
JVM languages.
So … we asked the Community
I would prefer scala, because
I've already written my plugins
with it. imho the builld process is
the main impediment.
14
CHALLENGE
for building a
Gerrit Plugin
15
NO STEPS, NO BUILD … just do it !
$ cat - > ~/gerrit/plugins/hello-1.0.groovy
import com.google.gerrit.sshd.*
import com.google.gerrit.extensions.annotations.*
@Export("groovy")
class GroovyCommand extends SshCommand {
public void run() { stdout.println "Hi from Groovy" }
}
^D
This sample has 190 chars: you need to type
at least 3.2 chars/sec to complete the sample
in only one minute 
https://gist.github.com/lucamilanesio/9687053
16
IS THAT TRUE ? Let’s check on Gerrit
$ ssh –p 29418 user@localhost gerrit plugin ls
Name Version Status File
----------------------------------------------------------------------
hello 1.0 ENABLED hello-1.0.groovy
Gerrit auto-detects the new Groovy file under
$GERRIT_SITE/plugins, invoke the interpreter
and auto-wrap the class into a self-contained Gerrit
plugin.
Groovy class is compiled into byte-code BUT is
slower than native Java plugin.
17
DOES IT REALLY WORK ?
$ ssh –p 29418 user@localhost hello groovy
Hi from Groovy
No magic … IT IS ALL REAL !
Plugin name (hello) comes from the
script filename.
A new SSH command (groovy) has
been defined in Gerrit associated to
the Groovy script loaded.
18
What about Scala ? Just do it again !
$ cat - > ~/gerrit/plugins/hi-1.0.scala
import com.google.gerrit.sshd._
import com.google.gerrit.extensions.annotations._
@Export("scala")
class ScalaCommand extends SshCommand {
override def run = stdout println "Hi from Scala"
}
^D
Scala is more concise with just 178 chars :
you can take it easy with 2.9 chars/sec to type
it a minute 
https://gist.github.com/lucamilanesio/9687092
19
You have now two plugins loaded
$ ssh –p 29418 user@localhost gerrit plugin ls
Name Version Status File
----------------------------------------------------------------------
hello 1.0 ENABLED hello-1.0.groovy
hi 1.0 ENABLED hi-1.0.scala
There are no differences for Gerrit between
Java, Groovy or Scala plugins: they have the same
dignity and power.
Scala compiler takes longer but byte-code runs at
the same speed as a native Java plugin!
20
Reactions from the Gerrit mailing list …
So i checked it out and tried it, and
what should i say ...
Wow, it rocks! ;-)
Combined with new and shiny
Plugin API the code is really short.
So i started new repo
on gh [1] and created two working
plugins [2], [3], and sure would add
more, so to say,
cookbook-groovy-plugin:
$>ssh gerrit review approve
I59302cbb
$>Approve change: I59302cbb.
What do
YOU think
? 
21
WHAT can scripting plugins do now ?
1. Define new SSH commands
2. Define new REST APIs
3. Listen to Gerrit events
22
HOW can I get Gerrit with scripting plugins ?
Download the Gerrit master with scripting extensions from:
http://ci.gerritforge.com/job/Gerrit-master-scripting/lastSuccessfulBuild/artifact/buck-
out/gen/gerrit-scripting.war
Run Gerrit init and say Y for installing the Scala and Groovy scripting plugins
providers:
*** Plugins
***
Install plugin groovy-provider version v2.9-rc1-325-g96d0d43 [y/N]? Y
Install plugin scala-provider version v2.9-rc1-325-g96d0d43 [y/N]? y
You may want to increase the JVM PermGen on gerrit.config when
loading/unloading scripting plugins
[container]
javaOptions = -XX:MaxPermSize=1024m
23
Scripting plugins
showcase
24
Create a branch through Gerrit API
$ cat - > ~/gerrit/plugins/branch-1.0.groovy
import com.google.gerrit.sshd.*
import com.google.gerrit.extensions.annotations.*
import com.google.gerrit.extensions.api.*
import com.google.gerrit.extensions.api.projects.*
import com.google.inject.*
import org.kohsuke.args4j.*
@Export("create")
@CommandMetaData(name = "create-branch", description = "Create branch")
class CreateBranch extends SshCommand {
@Inject GerritApi api
@Argument(index = 0, usage = "Project name", metaVar = "PROJECT")
String projectName
@Argument(index = 1, usage = "Branch name", metaVar = "BRANCH")
String branchName
@Argument(index = 2, usage = "Branch point sha1", metaVar = "SHA1")
String sha1
void run() {
BranchInput branch = new BranchInput()
branch.revision = sha1
api.projects().name(projectName).branch(branchName).create(branch)
stdout.println("Branch created: " + branchName)
}
}
^D
https://gist.github.com/lucamilanesio/9687118
25
Script classes get
Plugins Guice
Injections
(but cannot add Guice Modules)
26
List projects via REST API
$ cat - > ~/gerrit/plugins/projects-1.0.scala
import com.google.inject._
import com.google.gerrit.extensions.annotations._
import com.google.gerrit.server.project._
import javax.servlet.http._
import scala.collection.JavaConversions._
@Singleton @Export("/")
class Projects @Inject() (val pc: ProjectCache) extends HttpServlet {
override def doGet(req: HttpServletRequest, resp: HttpServletResponse) =
resp.getWriter print
"[" +
(pc.all map ( """ + _.get + """ ) mkString ",") +
"]"
}
^D
https://gist.github.com/lucamilanesio/9687133
27
Scala is
COMPACT + FUNCTIONAL
NOTE: for Guice injection
@Inject() before constructor vals
28
FUNCTIONAL
IS PERFECT
FOR …
29
Scalable in-process hooks
$ cat - > ~/gerrit/plugins/inprochook-1.0.scala
import org.slf4j.LoggerFactory._
import com.google.inject._
import com.google.gerrit.common._
import com.google.gerrit.server.events._
import com.google.gerrit.extensions.registration.DynamicSet
@Singleton
class ListenToChanges extends ChangeListener {
val log = getLogger(classOf[ListenToChanges])
override def onChangeEvent(e: ChangeEvent) = e match {
case comm: CommentAddedEvent =>
log info s"${comm.author.name} said '${comm.comment}' " +
s"on ${comm.change.project}/${comm.change.number}'"
case _ =>
}
}
class HooksModule extends AbstractModule {
override def configure =
DynamicSet bind(binder, classOf[ChangeListener]) to classOf[ListenToChanges]
}
^D
 Less CPU overhead (no exec/fork)  faster and scalable
 Works on behalf of user thread identity
 Access Gerrit injected objects (Cache, ReviewDb, JGit)
https://gist.github.com/lucamilanesio/9687154
30
Commit message validation
$ cat - > ~/gerrit/plugins/commitheadline-1.0.scala
import scala.collection.JavaConversions._
import com.google.inject._
import com.google.gerrit.extensions.annotations._
import com.google.gerrit.server.git.validators._
import com.google.gerrit.server.events._
@Singleton
@Listen
class HasIssueInCommitHeadline extends CommitValidationListener {
override def onCommitReceived(e: CommitReceivedEvent) =
"[A-Z]+-[0-9]+".r findFirstIn e.commit.getShortMessage map {
issue => Seq(new CommitValidationMessage(s"Issue: $issue", false))
} getOrElse {
throw new CommitValidationException("Missing JIRA-ID in commit headline")
}
}
^D
 Native pattern-matching support
 Java regex available out-of-the box
 Support for Optional values (map/getOrElse)
https://gist.github.com/lucamilanesio/9687174
31
And there is more …
audit events
download commands
project and group events
message of the day
Prolog predicates
auth backends
avatars
32
WHEN scripting plugins will be included in Gerrit ?
Hackathon #6
24-26th March we will keep
on hacking on Gerrit
MISSION:
improve, stabilise and
merge scripting plugins into
Gerrit master !
TARGET VERSION:
Gerrit Ver. 2.10 (?)
33
Try it on-line (with scripting): http://gerrithub.io/login
Read the Gerrit book: http://gerrithub.io/book
Keep in touch: http://gitenterprise.me
Learn more about Gerrit with
20% OFF Book discount for
Gerrit User Summit 2014
Book PROMO-CODE: LGCRB20
eBook PROMO-CODE: LGCReB20

More Related Content

What's hot

Introduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech ArticleIntroduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech Article
PRIYATHAMDARISI
 
Intro to GitOps & Flux.pdf
Intro to GitOps & Flux.pdfIntro to GitOps & Flux.pdf
Intro to GitOps & Flux.pdf
Weaveworks
 
Linux'a Giris ve VirtualBox a Ubuntu Kurulumu
Linux'a Giris ve VirtualBox a Ubuntu KurulumuLinux'a Giris ve VirtualBox a Ubuntu Kurulumu
Linux'a Giris ve VirtualBox a Ubuntu Kurulumu
Ahmet Gürel
 
ID & IT 2013 - OpenID Connect Hands-on
ID & IT 2013 - OpenID Connect Hands-onID & IT 2013 - OpenID Connect Hands-on
ID & IT 2013 - OpenID Connect Hands-on
Nov Matake
 
OpenTelemetry Introduction
OpenTelemetry Introduction OpenTelemetry Introduction
OpenTelemetry Introduction
DimitrisFinas1
 
Your own full blown Gerrit plugin
Your own full blown Gerrit pluginYour own full blown Gerrit plugin
Your own full blown Gerrit plugin
Dariusz Łuksza
 
OpenTelemetry For Developers
OpenTelemetry For DevelopersOpenTelemetry For Developers
OpenTelemetry For Developers
Kevin Brockhoff
 
Hyperledger Fabric Private Chaincodeについて
Hyperledger Fabric Private ChaincodeについてHyperledger Fabric Private Chaincodeについて
Hyperledger Fabric Private Chaincodeについて
Hyperleger Tokyo Meetup
 
Git and GitHub Info Session
Git and GitHub Info SessionGit and GitHub Info Session
Git and GitHub Info Session
SawanBhattacharya
 
Versioning avec Git
Versioning avec GitVersioning avec Git
Versioning avec Git
Jean-Baptiste Vigneron
 
仮想化技術によるマルウェア対策とその問題点
仮想化技術によるマルウェア対策とその問題点仮想化技術によるマルウェア対策とその問題点
仮想化技術によるマルウェア対策とその問題点
Kuniyasu Suzaki
 
Observability, Distributed Tracing, and Open Source: The Missing Primer
Observability, Distributed Tracing, and Open Source: The Missing PrimerObservability, Distributed Tracing, and Open Source: The Missing Primer
Observability, Distributed Tracing, and Open Source: The Missing Primer
VMware Tanzu
 
Get started with gitops and flux
Get started with gitops and fluxGet started with gitops and flux
Get started with gitops and flux
LibbySchulze1
 
Red Hat OpenShift Container Storage
Red Hat OpenShift Container StorageRed Hat OpenShift Container Storage
Red Hat OpenShift Container Storage
Takuya Utsunomiya
 
Analytics with Apache Superset and ClickHouse - DoK Talks #151
Analytics with Apache Superset and ClickHouse - DoK Talks #151Analytics with Apache Superset and ClickHouse - DoK Talks #151
Analytics with Apache Superset and ClickHouse - DoK Talks #151
DoKC
 
Azure Digital TwinとUnreal Engineを統合するADTLink Pluginについて
 Azure Digital TwinとUnreal Engineを統合するADTLink Pluginについて Azure Digital TwinとUnreal Engineを統合するADTLink Pluginについて
Azure Digital TwinとUnreal Engineを統合するADTLink Pluginについて
Takahiro Miyaura
 
U2F Tutorial - Authentication Tokens for Enterprise and Consumers
U2F Tutorial - Authentication Tokens for Enterprise and ConsumersU2F Tutorial - Authentication Tokens for Enterprise and Consumers
U2F Tutorial - Authentication Tokens for Enterprise and Consumers
FIDO Alliance
 
Flux is incubating + the road ahead
Flux is incubating + the road aheadFlux is incubating + the road ahead
Flux is incubating + the road ahead
LibbySchulze
 
Her Yönü İle Siber Tehdit İstihbaratı
Her Yönü İle Siber Tehdit İstihbaratıHer Yönü İle Siber Tehdit İstihbaratı
Her Yönü İle Siber Tehdit İstihbaratı
BGA Cyber Security
 

What's hot (20)

Introduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech ArticleIntroduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech Article
 
Intro to GitOps & Flux.pdf
Intro to GitOps & Flux.pdfIntro to GitOps & Flux.pdf
Intro to GitOps & Flux.pdf
 
Linux'a Giris ve VirtualBox a Ubuntu Kurulumu
Linux'a Giris ve VirtualBox a Ubuntu KurulumuLinux'a Giris ve VirtualBox a Ubuntu Kurulumu
Linux'a Giris ve VirtualBox a Ubuntu Kurulumu
 
ID & IT 2013 - OpenID Connect Hands-on
ID & IT 2013 - OpenID Connect Hands-onID & IT 2013 - OpenID Connect Hands-on
ID & IT 2013 - OpenID Connect Hands-on
 
OpenTelemetry Introduction
OpenTelemetry Introduction OpenTelemetry Introduction
OpenTelemetry Introduction
 
Your own full blown Gerrit plugin
Your own full blown Gerrit pluginYour own full blown Gerrit plugin
Your own full blown Gerrit plugin
 
OpenTelemetry For Developers
OpenTelemetry For DevelopersOpenTelemetry For Developers
OpenTelemetry For Developers
 
Hyperledger Fabric Private Chaincodeについて
Hyperledger Fabric Private ChaincodeについてHyperledger Fabric Private Chaincodeについて
Hyperledger Fabric Private Chaincodeについて
 
Git and GitHub Info Session
Git and GitHub Info SessionGit and GitHub Info Session
Git and GitHub Info Session
 
Versioning avec Git
Versioning avec GitVersioning avec Git
Versioning avec Git
 
仮想化技術によるマルウェア対策とその問題点
仮想化技術によるマルウェア対策とその問題点仮想化技術によるマルウェア対策とその問題点
仮想化技術によるマルウェア対策とその問題点
 
BGA Eğitim Sunum
BGA Eğitim SunumBGA Eğitim Sunum
BGA Eğitim Sunum
 
Observability, Distributed Tracing, and Open Source: The Missing Primer
Observability, Distributed Tracing, and Open Source: The Missing PrimerObservability, Distributed Tracing, and Open Source: The Missing Primer
Observability, Distributed Tracing, and Open Source: The Missing Primer
 
Get started with gitops and flux
Get started with gitops and fluxGet started with gitops and flux
Get started with gitops and flux
 
Red Hat OpenShift Container Storage
Red Hat OpenShift Container StorageRed Hat OpenShift Container Storage
Red Hat OpenShift Container Storage
 
Analytics with Apache Superset and ClickHouse - DoK Talks #151
Analytics with Apache Superset and ClickHouse - DoK Talks #151Analytics with Apache Superset and ClickHouse - DoK Talks #151
Analytics with Apache Superset and ClickHouse - DoK Talks #151
 
Azure Digital TwinとUnreal Engineを統合するADTLink Pluginについて
 Azure Digital TwinとUnreal Engineを統合するADTLink Pluginについて Azure Digital TwinとUnreal Engineを統合するADTLink Pluginについて
Azure Digital TwinとUnreal Engineを統合するADTLink Pluginについて
 
U2F Tutorial - Authentication Tokens for Enterprise and Consumers
U2F Tutorial - Authentication Tokens for Enterprise and ConsumersU2F Tutorial - Authentication Tokens for Enterprise and Consumers
U2F Tutorial - Authentication Tokens for Enterprise and Consumers
 
Flux is incubating + the road ahead
Flux is incubating + the road aheadFlux is incubating + the road ahead
Flux is incubating + the road ahead
 
Her Yönü İle Siber Tehdit İstihbaratı
Her Yönü İle Siber Tehdit İstihbaratıHer Yönü İle Siber Tehdit İstihbaratı
Her Yönü İle Siber Tehdit İstihbaratı
 

Viewers also liked

Gerrit Code Review Analytics
Gerrit Code Review AnalyticsGerrit Code Review Analytics
Gerrit Code Review Analytics
Luca 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 Analytics
Luca 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 TeamForge
Luca Milanesio
 
Gerrit jenkins-big data-continuous-delivery
Gerrit jenkins-big data-continuous-deliveryGerrit jenkins-big data-continuous-delivery
Gerrit jenkins-big data-continuous-delivery
Luca Milanesio
 
Git workshop 33degree 2011 krakow
Git workshop 33degree 2011 krakowGit workshop 33degree 2011 krakow
Git workshop 33degree 2011 krakow
Luca Milanesio
 
Is TDD dead or alive?
Is TDD dead or alive?Is TDD dead or alive?
Is TDD dead or alive?
Luca Milanesio
 
GitBlit plugin for Gerrit Code Review
GitBlit plugin for Gerrit Code ReviewGitBlit plugin for Gerrit Code Review
GitBlit plugin for Gerrit Code Review
Luca Milanesio
 
GerritHub.io - present, past, future
GerritHub.io - present, past, futureGerritHub.io - present, past, future
GerritHub.io - present, past, future
Luca 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 Analytics
Luca Milanesio
 
Zero-Downtime Gerrit Code Review Upgrade
Zero-Downtime Gerrit Code Review UpgradeZero-Downtime Gerrit Code Review Upgrade
Zero-Downtime Gerrit Code Review Upgrade
Luca Milanesio
 
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
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 Mobile
Luca Milanesio
 

Viewers also liked (12)

Gerrit Code Review Analytics
Gerrit Code Review AnalyticsGerrit Code Review Analytics
Gerrit Code Review Analytics
 
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
 
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
 
Gerrit jenkins-big data-continuous-delivery
Gerrit jenkins-big data-continuous-deliveryGerrit jenkins-big data-continuous-delivery
Gerrit jenkins-big data-continuous-delivery
 
Git workshop 33degree 2011 krakow
Git workshop 33degree 2011 krakowGit workshop 33degree 2011 krakow
Git workshop 33degree 2011 krakow
 
Is TDD dead or alive?
Is TDD dead or alive?Is TDD dead or alive?
Is TDD dead or alive?
 
GitBlit plugin for Gerrit Code Review
GitBlit plugin for Gerrit Code ReviewGitBlit plugin for Gerrit Code Review
GitBlit plugin for Gerrit Code Review
 
GerritHub.io - present, past, future
GerritHub.io - present, past, futureGerritHub.io - present, past, future
GerritHub.io - present, past, future
 
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
 
Zero-Downtime Gerrit Code Review Upgrade
Zero-Downtime Gerrit Code Review UpgradeZero-Downtime Gerrit Code Review Upgrade
Zero-Downtime Gerrit Code Review Upgrade
 
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
 
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
 

Similar to Gerrit Code Review: how to script a plugin with Scala and Groovy

GIT By Sivakrishna
GIT By SivakrishnaGIT By Sivakrishna
GIT By Sivakrishna
Nyros Technologies
 
Github By Nyros Developer
Github By Nyros DeveloperGithub By Nyros Developer
Github By Nyros Developer
Nyros Technologies
 
Introduction to git and Github
Introduction to git and GithubIntroduction to git and Github
Introduction to git and Github
Wycliff1
 
FOSDEM 2017: GitLab CI
FOSDEM 2017:  GitLab CIFOSDEM 2017:  GitLab CI
FOSDEM 2017: GitLab CI
OlinData
 
Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010
Matt Gauger
 
GDSC GIT AND GITHUB
GDSC GIT AND GITHUB GDSC GIT AND GITHUB
GDSC GIT AND GITHUB
GDSCIIITDHARWAD
 
Gitlab Training with GIT and SourceTree
Gitlab Training with GIT and SourceTreeGitlab Training with GIT and SourceTree
Gitlab Training with GIT and SourceTree
Teerapat Khunpech
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
Somkiat Puisungnoen
 
Testing of javacript
Testing of javacriptTesting of javacript
Testing of javacript
Lei Kang
 
Managing Github via Terrafom.pdf
Managing Github via Terrafom.pdfManaging Github via Terrafom.pdf
Managing Github via Terrafom.pdf
micharaeck
 
git github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptxgit github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptx
AbelPhilipJoseph
 
GIT training - advanced for software projects
GIT training - advanced for software projectsGIT training - advanced for software projects
GIT training - advanced for software projects
Thierry Gayet
 
2015-ghci-presentation-git_gerritJenkins_final
2015-ghci-presentation-git_gerritJenkins_final2015-ghci-presentation-git_gerritJenkins_final
2015-ghci-presentation-git_gerritJenkins_final
Mythri P K
 
OpenStack Contribution Process
OpenStack Contribution ProcessOpenStack Contribution Process
OpenStack Contribution Process
openstackindia
 
Openstack contribution process
Openstack contribution processOpenstack contribution process
Openstack contribution process
Syed Armani
 
Gitlab ci, cncf.sk
Gitlab ci, cncf.skGitlab ci, cncf.sk
Gitlab ci, cncf.sk
Juraj Hantak
 
GWT Contributor Workshop
GWT Contributor WorkshopGWT Contributor Workshop
GWT Contributor Workshop
Manuel Carrasco Moñino
 
introductiontogitandgithub-120702044048-phpapp01.pdf
introductiontogitandgithub-120702044048-phpapp01.pdfintroductiontogitandgithub-120702044048-phpapp01.pdf
introductiontogitandgithub-120702044048-phpapp01.pdf
BruceLee275640
 
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
Victor Wong
 
Introduction to git and github
Introduction to git and githubIntroduction to git and github
Introduction to git and github
Aderemi Dadepo
 

Similar to Gerrit Code Review: how to script a plugin with Scala and Groovy (20)

GIT By Sivakrishna
GIT By SivakrishnaGIT By Sivakrishna
GIT By Sivakrishna
 
Github By Nyros Developer
Github By Nyros DeveloperGithub By Nyros Developer
Github By Nyros Developer
 
Introduction to git and Github
Introduction to git and GithubIntroduction to git and Github
Introduction to git and Github
 
FOSDEM 2017: GitLab CI
FOSDEM 2017:  GitLab CIFOSDEM 2017:  GitLab CI
FOSDEM 2017: GitLab CI
 
Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010
 
GDSC GIT AND GITHUB
GDSC GIT AND GITHUB GDSC GIT AND GITHUB
GDSC GIT AND GITHUB
 
Gitlab Training with GIT and SourceTree
Gitlab Training with GIT and SourceTreeGitlab Training with GIT and SourceTree
Gitlab Training with GIT and SourceTree
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Testing of javacript
Testing of javacriptTesting of javacript
Testing of javacript
 
Managing Github via Terrafom.pdf
Managing Github via Terrafom.pdfManaging Github via Terrafom.pdf
Managing Github via Terrafom.pdf
 
git github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptxgit github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptx
 
GIT training - advanced for software projects
GIT training - advanced for software projectsGIT training - advanced for software projects
GIT training - advanced for software projects
 
2015-ghci-presentation-git_gerritJenkins_final
2015-ghci-presentation-git_gerritJenkins_final2015-ghci-presentation-git_gerritJenkins_final
2015-ghci-presentation-git_gerritJenkins_final
 
OpenStack Contribution Process
OpenStack Contribution ProcessOpenStack Contribution Process
OpenStack Contribution Process
 
Openstack contribution process
Openstack contribution processOpenstack contribution process
Openstack contribution process
 
Gitlab ci, cncf.sk
Gitlab ci, cncf.skGitlab ci, cncf.sk
Gitlab ci, cncf.sk
 
GWT Contributor Workshop
GWT Contributor WorkshopGWT Contributor Workshop
GWT Contributor Workshop
 
introductiontogitandgithub-120702044048-phpapp01.pdf
introductiontogitandgithub-120702044048-phpapp01.pdfintroductiontogitandgithub-120702044048-phpapp01.pdf
introductiontogitandgithub-120702044048-phpapp01.pdf
 
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
 
Introduction to git and github
Introduction to git and githubIntroduction to git and github
Introduction to git and github
 

More from Luca 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 beyond
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 code
Luca Milanesio
 
Cloud-native Gerrit Code Review
Cloud-native Gerrit Code ReviewCloud-native Gerrit Code Review
Cloud-native Gerrit Code Review
Luca 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-step
Luca Milanesio
 
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
Luca 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.3
Luca Milanesio
 
Gerrit Code Review multi-site
Gerrit Code Review multi-siteGerrit Code Review multi-site
Gerrit Code Review multi-site
Luca Milanesio
 
What's new in Gerrit Code Review 3.0
What's new in Gerrit Code Review 3.0What's new in Gerrit Code Review 3.0
What's new in Gerrit Code Review 3.0
Luca Milanesio
 
Gerrit User Summit 2019 Keynote
Gerrit User Summit 2019 KeynoteGerrit User Summit 2019 Keynote
Gerrit User Summit 2019 Keynote
Luca Milanesio
 
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
Luca 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.15
Luca 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 pipelines
Luca Milanesio
 
Gerrit User Summit 2017 Keynote
Gerrit User Summit 2017 KeynoteGerrit User Summit 2017 Keynote
Gerrit User Summit 2017 Keynote
Luca 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 issues
Luca 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 Time
Luca 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 Review
Luca 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 Review
Luca Milanesio
 

More from Luca Milanesio (18)

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
 
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
 
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
 
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 Code Review multi-site
Gerrit Code Review multi-siteGerrit Code Review multi-site
Gerrit Code Review multi-site
 
What's new in Gerrit Code Review 3.0
What's new in Gerrit Code Review 3.0What's new in Gerrit Code Review 3.0
What's new in Gerrit Code Review 3.0
 
Gerrit User Summit 2019 Keynote
Gerrit User Summit 2019 KeynoteGerrit User Summit 2019 Keynote
Gerrit User Summit 2019 Keynote
 
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
 
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
 

Recently uploaded

Tales of Two States: A Comparative Study of Language and Literature in Kerala...
Tales of Two States: A Comparative Study of Language and Literature in Kerala...Tales of Two States: A Comparative Study of Language and Literature in Kerala...
Tales of Two States: A Comparative Study of Language and Literature in Kerala...
joshanmath
 
Lesson 11 - On Happiness. Introduction to Philosophy of a Human Personpptx
Lesson 11 - On Happiness. Introduction to Philosophy of a Human PersonpptxLesson 11 - On Happiness. Introduction to Philosophy of a Human Personpptx
Lesson 11 - On Happiness. Introduction to Philosophy of a Human Personpptx
JonathanMansueto1
 
hISTORY OF THE jEWISH COMMUNITY IN ROMANIA.pdf
hISTORY OF THE jEWISH COMMUNITY IN ROMANIA.pdfhISTORY OF THE jEWISH COMMUNITY IN ROMANIA.pdf
hISTORY OF THE jEWISH COMMUNITY IN ROMANIA.pdf
zuzanka
 
Delegation Inheritance in Odoo 17 and Its Use Cases
Delegation Inheritance in Odoo 17 and Its Use CasesDelegation Inheritance in Odoo 17 and Its Use Cases
Delegation Inheritance in Odoo 17 and Its Use Cases
Celine George
 
No, it's not a robot: prompt writing for investigative journalism
No, it's not a robot: prompt writing for investigative journalismNo, it's not a robot: prompt writing for investigative journalism
No, it's not a robot: prompt writing for investigative journalism
Paul Bradshaw
 
chemistry project on foaming capacity of soap class 11
chemistry project on foaming capacity of soap class 11chemistry project on foaming capacity of soap class 11
chemistry project on foaming capacity of soap class 11
equaltogreenxyz
 
Split Shifts From Gantt View in the Odoo 17
Split Shifts From Gantt View in the  Odoo 17Split Shifts From Gantt View in the  Odoo 17
Split Shifts From Gantt View in the Odoo 17
Celine George
 
How to Store Data on the Odoo 17 Website
How to Store Data on the Odoo 17 WebsiteHow to Store Data on the Odoo 17 Website
How to Store Data on the Odoo 17 Website
Celine George
 
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 12 - GLOBAL SUCCESS - FORM MỚI 2025 - HK1 (C...
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 12 - GLOBAL SUCCESS - FORM MỚI 2025 - HK1 (C...CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 12 - GLOBAL SUCCESS - FORM MỚI 2025 - HK1 (C...
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 12 - GLOBAL SUCCESS - FORM MỚI 2025 - HK1 (C...
Nguyen Thanh Tu Collection
 
Traces of the Holocaust in our communities in Levice Sovakia and Constanta Ro...
Traces of the Holocaust in our communities in Levice Sovakia and Constanta Ro...Traces of the Holocaust in our communities in Levice Sovakia and Constanta Ro...
Traces of the Holocaust in our communities in Levice Sovakia and Constanta Ro...
Zuzana Mészárosová
 
2024 KWL Back 2 School Summer Conference
2024 KWL Back 2 School Summer Conference2024 KWL Back 2 School Summer Conference
2024 KWL Back 2 School Summer Conference
KlettWorldLanguages
 
NationalLearningCamp-2024-Orientation-for-RO-SDO.pptx
NationalLearningCamp-2024-Orientation-for-RO-SDO.pptxNationalLearningCamp-2024-Orientation-for-RO-SDO.pptx
NationalLearningCamp-2024-Orientation-for-RO-SDO.pptx
CelestineMiranda
 
Beginner's Guide to Bypassing Falco Container Runtime Security in Kubernetes ...
Beginner's Guide to Bypassing Falco Container Runtime Security in Kubernetes ...Beginner's Guide to Bypassing Falco Container Runtime Security in Kubernetes ...
Beginner's Guide to Bypassing Falco Container Runtime Security in Kubernetes ...
anjaliinfosec
 
Satta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results Kalyan ChartSatta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results Kalyan Chart
Mohit Tripathi
 
The basics of sentences session 9pptx.pptx
The basics of sentences session 9pptx.pptxThe basics of sentences session 9pptx.pptx
The basics of sentences session 9pptx.pptx
heathfieldcps1
 
NLC English 7 Consolidation Lesson plan for teacher
NLC English 7 Consolidation Lesson plan for teacherNLC English 7 Consolidation Lesson plan for teacher
NLC English 7 Consolidation Lesson plan for teacher
AngelicaLubrica
 
debts of gratitude 1 and silent b activity.pptx
debts of gratitude 1 and silent b activity.pptxdebts of gratitude 1 and silent b activity.pptx
debts of gratitude 1 and silent b activity.pptx
AncyTEnglish
 
debts of gratitude 2 detailed meaning and certificate of appreciation.pptx
debts of gratitude 2 detailed meaning and certificate of appreciation.pptxdebts of gratitude 2 detailed meaning and certificate of appreciation.pptx
debts of gratitude 2 detailed meaning and certificate of appreciation.pptx
AncyTEnglish
 
Capitol Doctoral Presentation -June 2024v2.pptx
Capitol Doctoral Presentation -June 2024v2.pptxCapitol Doctoral Presentation -June 2024v2.pptx
Capitol Doctoral Presentation -June 2024v2.pptx
CapitolTechU
 
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
siemaillard
 

Recently uploaded (20)

Tales of Two States: A Comparative Study of Language and Literature in Kerala...
Tales of Two States: A Comparative Study of Language and Literature in Kerala...Tales of Two States: A Comparative Study of Language and Literature in Kerala...
Tales of Two States: A Comparative Study of Language and Literature in Kerala...
 
Lesson 11 - On Happiness. Introduction to Philosophy of a Human Personpptx
Lesson 11 - On Happiness. Introduction to Philosophy of a Human PersonpptxLesson 11 - On Happiness. Introduction to Philosophy of a Human Personpptx
Lesson 11 - On Happiness. Introduction to Philosophy of a Human Personpptx
 
hISTORY OF THE jEWISH COMMUNITY IN ROMANIA.pdf
hISTORY OF THE jEWISH COMMUNITY IN ROMANIA.pdfhISTORY OF THE jEWISH COMMUNITY IN ROMANIA.pdf
hISTORY OF THE jEWISH COMMUNITY IN ROMANIA.pdf
 
Delegation Inheritance in Odoo 17 and Its Use Cases
Delegation Inheritance in Odoo 17 and Its Use CasesDelegation Inheritance in Odoo 17 and Its Use Cases
Delegation Inheritance in Odoo 17 and Its Use Cases
 
No, it's not a robot: prompt writing for investigative journalism
No, it's not a robot: prompt writing for investigative journalismNo, it's not a robot: prompt writing for investigative journalism
No, it's not a robot: prompt writing for investigative journalism
 
chemistry project on foaming capacity of soap class 11
chemistry project on foaming capacity of soap class 11chemistry project on foaming capacity of soap class 11
chemistry project on foaming capacity of soap class 11
 
Split Shifts From Gantt View in the Odoo 17
Split Shifts From Gantt View in the  Odoo 17Split Shifts From Gantt View in the  Odoo 17
Split Shifts From Gantt View in the Odoo 17
 
How to Store Data on the Odoo 17 Website
How to Store Data on the Odoo 17 WebsiteHow to Store Data on the Odoo 17 Website
How to Store Data on the Odoo 17 Website
 
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 12 - GLOBAL SUCCESS - FORM MỚI 2025 - HK1 (C...
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 12 - GLOBAL SUCCESS - FORM MỚI 2025 - HK1 (C...CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 12 - GLOBAL SUCCESS - FORM MỚI 2025 - HK1 (C...
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 12 - GLOBAL SUCCESS - FORM MỚI 2025 - HK1 (C...
 
Traces of the Holocaust in our communities in Levice Sovakia and Constanta Ro...
Traces of the Holocaust in our communities in Levice Sovakia and Constanta Ro...Traces of the Holocaust in our communities in Levice Sovakia and Constanta Ro...
Traces of the Holocaust in our communities in Levice Sovakia and Constanta Ro...
 
2024 KWL Back 2 School Summer Conference
2024 KWL Back 2 School Summer Conference2024 KWL Back 2 School Summer Conference
2024 KWL Back 2 School Summer Conference
 
NationalLearningCamp-2024-Orientation-for-RO-SDO.pptx
NationalLearningCamp-2024-Orientation-for-RO-SDO.pptxNationalLearningCamp-2024-Orientation-for-RO-SDO.pptx
NationalLearningCamp-2024-Orientation-for-RO-SDO.pptx
 
Beginner's Guide to Bypassing Falco Container Runtime Security in Kubernetes ...
Beginner's Guide to Bypassing Falco Container Runtime Security in Kubernetes ...Beginner's Guide to Bypassing Falco Container Runtime Security in Kubernetes ...
Beginner's Guide to Bypassing Falco Container Runtime Security in Kubernetes ...
 
Satta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results Kalyan ChartSatta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results Kalyan Chart
 
The basics of sentences session 9pptx.pptx
The basics of sentences session 9pptx.pptxThe basics of sentences session 9pptx.pptx
The basics of sentences session 9pptx.pptx
 
NLC English 7 Consolidation Lesson plan for teacher
NLC English 7 Consolidation Lesson plan for teacherNLC English 7 Consolidation Lesson plan for teacher
NLC English 7 Consolidation Lesson plan for teacher
 
debts of gratitude 1 and silent b activity.pptx
debts of gratitude 1 and silent b activity.pptxdebts of gratitude 1 and silent b activity.pptx
debts of gratitude 1 and silent b activity.pptx
 
debts of gratitude 2 detailed meaning and certificate of appreciation.pptx
debts of gratitude 2 detailed meaning and certificate of appreciation.pptxdebts of gratitude 2 detailed meaning and certificate of appreciation.pptx
debts of gratitude 2 detailed meaning and certificate of appreciation.pptx
 
Capitol Doctoral Presentation -June 2024v2.pptx
Capitol Doctoral Presentation -June 2024v2.pptxCapitol Doctoral Presentation -June 2024v2.pptx
Capitol Doctoral Presentation -June 2024v2.pptx
 
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
 

Gerrit Code Review: how to script a plugin with Scala and Groovy

  • 2. 2 About Luca • Luca Milanesio Co-founder of GerritForge • over 20 years of experience in Agile Development SCM, CI and ALM worldwide • Contributor to Jenkins since 2007 (and previously Hudson) • Git SCM mentor for the Enterprise since 2009 • Contributor to Gerrit Code Review community since 2011
  • 3. 3 About GerritForge Founded in 2009 in London UK Mission: Agile Enterprise Products:
  • 4. 4 Agenda  Where we come from ?  2 years ago: Gerrit plugins  We want more plugins  Create a plugin in 60 seconds  What, how and when are coming?  Plugins showcase
  • 6. 6 Why don’t we introduce plugins ? They have been so successful with Jenkins
  • 7. 7 Gerrit Hackathon 7th of May 2012 The first “helloworld” plugin was born
  • 8. 8 WHO REMEMBERS THIS ? Gerrit Summit 2012 Ver. 2.5.x
  • 10. 10 Can we do more ? Let's ask Jenkins 
  • 13. 13 That would be very useful for Gerrit Administrators to be able to write quick automation scripts for their daily tasks. I would prioritize groovy plugin more for the popularity of groovy scripting. I think adding a "scripting language plugin" to support plugins written in scripting languages is a very good idea Hi all, I was thinking about extending Gerrit capabilities to load plugins / extensions by providing "wrapper" for other JVM languages. So … we asked the Community I would prefer scala, because I've already written my plugins with it. imho the builld process is the main impediment.
  • 15. 15 NO STEPS, NO BUILD … just do it ! $ cat - > ~/gerrit/plugins/hello-1.0.groovy import com.google.gerrit.sshd.* import com.google.gerrit.extensions.annotations.* @Export("groovy") class GroovyCommand extends SshCommand { public void run() { stdout.println "Hi from Groovy" } } ^D This sample has 190 chars: you need to type at least 3.2 chars/sec to complete the sample in only one minute  https://gist.github.com/lucamilanesio/9687053
  • 16. 16 IS THAT TRUE ? Let’s check on Gerrit $ ssh –p 29418 user@localhost gerrit plugin ls Name Version Status File ---------------------------------------------------------------------- hello 1.0 ENABLED hello-1.0.groovy Gerrit auto-detects the new Groovy file under $GERRIT_SITE/plugins, invoke the interpreter and auto-wrap the class into a self-contained Gerrit plugin. Groovy class is compiled into byte-code BUT is slower than native Java plugin.
  • 17. 17 DOES IT REALLY WORK ? $ ssh –p 29418 user@localhost hello groovy Hi from Groovy No magic … IT IS ALL REAL ! Plugin name (hello) comes from the script filename. A new SSH command (groovy) has been defined in Gerrit associated to the Groovy script loaded.
  • 18. 18 What about Scala ? Just do it again ! $ cat - > ~/gerrit/plugins/hi-1.0.scala import com.google.gerrit.sshd._ import com.google.gerrit.extensions.annotations._ @Export("scala") class ScalaCommand extends SshCommand { override def run = stdout println "Hi from Scala" } ^D Scala is more concise with just 178 chars : you can take it easy with 2.9 chars/sec to type it a minute  https://gist.github.com/lucamilanesio/9687092
  • 19. 19 You have now two plugins loaded $ ssh –p 29418 user@localhost gerrit plugin ls Name Version Status File ---------------------------------------------------------------------- hello 1.0 ENABLED hello-1.0.groovy hi 1.0 ENABLED hi-1.0.scala There are no differences for Gerrit between Java, Groovy or Scala plugins: they have the same dignity and power. Scala compiler takes longer but byte-code runs at the same speed as a native Java plugin!
  • 20. 20 Reactions from the Gerrit mailing list … So i checked it out and tried it, and what should i say ... Wow, it rocks! ;-) Combined with new and shiny Plugin API the code is really short. So i started new repo on gh [1] and created two working plugins [2], [3], and sure would add more, so to say, cookbook-groovy-plugin: $>ssh gerrit review approve I59302cbb $>Approve change: I59302cbb. What do YOU think ? 
  • 21. 21 WHAT can scripting plugins do now ? 1. Define new SSH commands 2. Define new REST APIs 3. Listen to Gerrit events
  • 22. 22 HOW can I get Gerrit with scripting plugins ? Download the Gerrit master with scripting extensions from: http://ci.gerritforge.com/job/Gerrit-master-scripting/lastSuccessfulBuild/artifact/buck- out/gen/gerrit-scripting.war Run Gerrit init and say Y for installing the Scala and Groovy scripting plugins providers: *** Plugins *** Install plugin groovy-provider version v2.9-rc1-325-g96d0d43 [y/N]? Y Install plugin scala-provider version v2.9-rc1-325-g96d0d43 [y/N]? y You may want to increase the JVM PermGen on gerrit.config when loading/unloading scripting plugins [container] javaOptions = -XX:MaxPermSize=1024m
  • 24. 24 Create a branch through Gerrit API $ cat - > ~/gerrit/plugins/branch-1.0.groovy import com.google.gerrit.sshd.* import com.google.gerrit.extensions.annotations.* import com.google.gerrit.extensions.api.* import com.google.gerrit.extensions.api.projects.* import com.google.inject.* import org.kohsuke.args4j.* @Export("create") @CommandMetaData(name = "create-branch", description = "Create branch") class CreateBranch extends SshCommand { @Inject GerritApi api @Argument(index = 0, usage = "Project name", metaVar = "PROJECT") String projectName @Argument(index = 1, usage = "Branch name", metaVar = "BRANCH") String branchName @Argument(index = 2, usage = "Branch point sha1", metaVar = "SHA1") String sha1 void run() { BranchInput branch = new BranchInput() branch.revision = sha1 api.projects().name(projectName).branch(branchName).create(branch) stdout.println("Branch created: " + branchName) } } ^D https://gist.github.com/lucamilanesio/9687118
  • 25. 25 Script classes get Plugins Guice Injections (but cannot add Guice Modules)
  • 26. 26 List projects via REST API $ cat - > ~/gerrit/plugins/projects-1.0.scala import com.google.inject._ import com.google.gerrit.extensions.annotations._ import com.google.gerrit.server.project._ import javax.servlet.http._ import scala.collection.JavaConversions._ @Singleton @Export("/") class Projects @Inject() (val pc: ProjectCache) extends HttpServlet { override def doGet(req: HttpServletRequest, resp: HttpServletResponse) = resp.getWriter print "[" + (pc.all map ( """ + _.get + """ ) mkString ",") + "]" } ^D https://gist.github.com/lucamilanesio/9687133
  • 27. 27 Scala is COMPACT + FUNCTIONAL NOTE: for Guice injection @Inject() before constructor vals
  • 29. 29 Scalable in-process hooks $ cat - > ~/gerrit/plugins/inprochook-1.0.scala import org.slf4j.LoggerFactory._ import com.google.inject._ import com.google.gerrit.common._ import com.google.gerrit.server.events._ import com.google.gerrit.extensions.registration.DynamicSet @Singleton class ListenToChanges extends ChangeListener { val log = getLogger(classOf[ListenToChanges]) override def onChangeEvent(e: ChangeEvent) = e match { case comm: CommentAddedEvent => log info s"${comm.author.name} said '${comm.comment}' " + s"on ${comm.change.project}/${comm.change.number}'" case _ => } } class HooksModule extends AbstractModule { override def configure = DynamicSet bind(binder, classOf[ChangeListener]) to classOf[ListenToChanges] } ^D  Less CPU overhead (no exec/fork)  faster and scalable  Works on behalf of user thread identity  Access Gerrit injected objects (Cache, ReviewDb, JGit) https://gist.github.com/lucamilanesio/9687154
  • 30. 30 Commit message validation $ cat - > ~/gerrit/plugins/commitheadline-1.0.scala import scala.collection.JavaConversions._ import com.google.inject._ import com.google.gerrit.extensions.annotations._ import com.google.gerrit.server.git.validators._ import com.google.gerrit.server.events._ @Singleton @Listen class HasIssueInCommitHeadline extends CommitValidationListener { override def onCommitReceived(e: CommitReceivedEvent) = "[A-Z]+-[0-9]+".r findFirstIn e.commit.getShortMessage map { issue => Seq(new CommitValidationMessage(s"Issue: $issue", false)) } getOrElse { throw new CommitValidationException("Missing JIRA-ID in commit headline") } } ^D  Native pattern-matching support  Java regex available out-of-the box  Support for Optional values (map/getOrElse) https://gist.github.com/lucamilanesio/9687174
  • 31. 31 And there is more … audit events download commands project and group events message of the day Prolog predicates auth backends avatars
  • 32. 32 WHEN scripting plugins will be included in Gerrit ? Hackathon #6 24-26th March we will keep on hacking on Gerrit MISSION: improve, stabilise and merge scripting plugins into Gerrit master ! TARGET VERSION: Gerrit Ver. 2.10 (?)
  • 33. 33
  • 34. Try it on-line (with scripting): http://gerrithub.io/login Read the Gerrit book: http://gerrithub.io/book Keep in touch: http://gitenterprise.me Learn more about Gerrit with 20% OFF Book discount for Gerrit User Summit 2014 Book PROMO-CODE: LGCRB20 eBook PROMO-CODE: LGCReB20