[Announce] Gerrit Code Review plugin v0.3.1 is out - supports integration with the Gerrit Trigger Plugin

371 views
Skip to first unread message

Luca Milanesio

unread,
Oct 29, 2018, 4:53:08 AM10/29/18
to Jenkins Developers, jenkins...@googlegroups.com, Repo and Gerrit Discussion, Luca Milanesio, Alon Bar-Lev
Hi all,
I am pleased to announce that after the Jenkins World 2018 summit in Nice last week, the Gerrit Code Review plugin (https://wiki.jenkins.io/display/JENKINS/Gerrit+Code+Review+Plugin) has received new contributions (thanks Alon) and now support many more use-cases:

Integrates with the Gerrit Trigger Plugin for automating Jenkinsfile simple pipelines
Allows posting comments to the source files in Gerrit from a Jenkinsfile pipeline step
Fully compliant with the Declarative and Scripting pipelines
Support multiple review labels in a single review step

The release of v0.3.1 is a significant step to bring this new plugin to a whole new series of use-cases and opening it to future contributions.

Thanks for everyone involved in reviews, fixes, and contributions. Feel free to give it a try and contribute to it.

Luca.

Gareth Bowles

unread,
Oct 29, 2018, 6:42:53 PM10/29/18
to Repo and Gerrit Discussion
This sounds very cool.  Is there documentation on how to use the new features ?

Luca Milanesio

unread,
Oct 29, 2018, 6:49:41 PM10/29/18
to Gareth Bowles, Luca Milanesio, Repo and Gerrit Discussion

On 29 Oct 2018, at 22:42, Gareth Bowles <gbo...@gmail.com> wrote:

This sounds very cool.  Is there documentation on how to use the new features ?

The README.md contains the basics on how to get started:

More documentation will follow, with real-life use-cases.

Luca.

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Yubin Ruan

unread,
Oct 31, 2018, 2:10:17 AM10/31/18
to Repo and Gerrit Discussion
Hi, I fail to use this plugin in our Gerrit+Jenkins system. Can you provide more docs about how it works and how to tune it? Specifically a usable example will be very helpful.

Thanks,
Yubin

Luca Milanesio

unread,
Oct 31, 2018, 9:58:16 AM10/31/18
to Repo and Gerrit Discussion, Luca Milanesio, Yubin Ruan

On 31 Oct 2018, at 06:10, Yubin Ruan <ablack...@gmail.com> wrote:

Hi, I fail to use this plugin in our Gerrit+Jenkins system. Can you provide more docs about how it works and how to tune it? Specifically a usable example will be very helpful.

Hi Yubin,
the simplest use-case is really identical to a typical Multi-branch  pipeline project: just put the Gerrit Repository HTTP URL in the field ... and nothing more :-)
Believe me, it just works without configuration.

If you then need to put more integration with Gerrit, please refer to the project README at:

And if you have any issues, just ping the mailing list :-)

Luca.


Thanks,
Yubin

On Monday, October 29, 2018 at 4:53:08 PM UTC+8, lucamilanesio wrote:
Hi all,
I am pleased to announce that after the Jenkins World 2018 summit in Nice last week, the Gerrit Code Review plugin (https://wiki.jenkins.io/display/JENKINS/Gerrit+Code+Review+Plugin) has received new contributions (thanks Alon) and now support many more use-cases:

Integrates with the Gerrit Trigger Plugin for automating Jenkinsfile simple pipelines
Allows posting comments to the source files in Gerrit from a Jenkinsfile pipeline step
Fully compliant with the Declarative and Scripting pipelines
Support multiple review labels in a single review step

The release of v0.3.1 is a significant step to bring this new plugin to a whole new series of use-cases and opening it to future contributions.

Thanks for everyone involved in reviews, fixes, and contributions. Feel free to give it a try and contribute to it.

Luca.

Luca Milanesio

unread,
Nov 5, 2018, 10:47:31 AM11/5/18
to Repo and Gerrit Discussion, 'Björn Pedersen' via Jenkins Users, Luca Milanesio, Yubin Ruan, Gareth Bowles

On 31 Oct 2018, at 13:58, Luca Milanesio <luca.mi...@gmail.com> wrote:



On 31 Oct 2018, at 06:10, Yubin Ruan <ablack...@gmail.com> wrote:

Hi, I fail to use this plugin in our Gerrit+Jenkins system. Can you provide more docs about how it works and how to tune it? Specifically a usable example will be very helpful.

Hi Yubin,
the simplest use-case is really identical to a typical Multi-branch  pipeline project: just put the Gerrit Repository HTTP URL in the field ... and nothing more :-)
Believe me, it just works without configuration.

If you then need to put more integration with Gerrit, please refer to the project README at:

I have published as well last week a YouTube Video of how to use the plugin:

It is the screen recording of my talk 2 weeks ago in Nice for the JenkinsWorld 2018.
Hope it would help to get started using the plugin and provide feedback and contributions.

Luca.

Yubin Ruan

unread,
Nov 6, 2018, 9:37:00 PM11/6/18
to luca.mi...@gmail.com, repo-d...@googlegroups.com, jenkins...@googlegroups.com, gbo...@gmail.com
> I have published as well last week a YouTube Video of how to use the plugin:
> https://www.youtube.com/watch?v=pyPMeCW-Q5k
>
> It is the screen recording of my talk 2 weeks ago in Nice for the JenkinsWorld 2018.
> Hope it would help to get started using the plugin and provide feedback and contributions.
>
> Luca.
>
>
> And if you have any issues, just ping the mailing list :-)
>
> Luca.

Many thanks, Luca,

but I got several issues:

1.In the "Multi-branch pipeline" configuration, SSH is not
supported. I can only use HTTP.... Are there any way to fix that?
2. Can you share the web hook plugin for gerrit? (i.e., the
"./add-webhook.sh" in your video record)
3. and, can I post message when a specify stage fail/succeed ?,
i.e., I want to post message to Gerrit inside every single stage, not
after the whole "stages".
4. Can you share your example gerrit configuration file ?

--
Yubin

Yubin Ruan

unread,
Nov 6, 2018, 11:48:49 PM11/6/18
to Luca Milanesio, repo-d...@googlegroups.com, jenkins...@googlegroups.com, Gareth Bowles
> I have published as well last week a YouTube Video of how to use the plugin:
> https://www.youtube.com/watch?v=pyPMeCW-Q5k
>
> It is the screen recording of my talk 2 weeks ago in Nice for the JenkinsWorld 2018.
> Hope it would help to get started using the plugin and provide feedback and contributions.
>
> Luca.
>
>
> And if you have any issues, just ping the mailing list :-)
>
> Luca.

Luca Milanesio

unread,
Nov 7, 2018, 3:49:20 AM11/7/18
to Yubin Ruan, Luca Milanesio, repo-d...@googlegroups.com, jenkins...@googlegroups.com, Gareth Bowles


> On 7 Nov 2018, at 04:48, Yubin Ruan <ablack...@gmail.com> wrote:
>
>> I have published as well last week a YouTube Video of how to use the plugin:
>> https://www.youtube.com/watch?v=pyPMeCW-Q5k
>>
>> It is the screen recording of my talk 2 weeks ago in Nice for the JenkinsWorld 2018.
>> Hope it would help to get started using the plugin and provide feedback and contributions.
>>
>> Luca.
>>
>>
>> And if you have any issues, just ping the mailing list :-)
>>
>> Luca.
>
> Many thanks, Luca,
>
> but I got several issues:
>
> 1.In the "Multi-branch pipeline" configuration, SSH is not
> supported. I can only use HTTP.... Are there any way to fix that?

Yes, it only supports HTTP/HTTPS at the moment.

Bear in mind that it would need access to the Gerrit REST API anyway, so you would need HTTP/HTTPS connectivity to Gerrit anyway.
So then, why don't just use the HTTP/HTTPS URL to clone?

> 2. Can you share the web hook plugin for gerrit? (i.e., the
> "./add-webhook.sh" in your video record)

See the content of the shell script below:

WEBHOOKS_URL=https://gerrit-ci.gerritforge.com/job/plugin-webhooks-bazel-master/lastSuccessfulBuild/artifact/bazel-genfiles/plugins/webhooks/webhooks.jar
curl $WEBHOOKS_URL > $(dirname $0)/plugins/webhooks.jar

(basically just downloading the plugin from Gerrit CI and putting into the Gerrit's plugins directory, that's it)

> 3. and, can I post message when a specify stage fail/succeed ?,
> i.e., I want to post message to Gerrit inside every single stage, not
> after the whole "stages".

Oh yes, just call the step 'gerritReview' where you need, including a single stage.


> 4. Can you share your example gerrit configuration file ?

I've used the default gerrit.config of a Dev instance, plus the configuration for the refsfilter module and the webhooks default settings.

[gerrit]
basePath = git
serverId = 61e561d7-693d-4ed6-b825-5b30f1dac430
canonicalWebUrl = http://localhost:9090/
installModule = com.gerritforge.gerrit.modules.refsfilter.GuiceModule
[database]
type = h2
database = /Users/lucamilanesio/jw2018/gerrit/db/ReviewDB
[noteDb "changes"]
disableReviewDb = true
primaryStorage = note db
read = true
sequence = true
write = true
[container]
javaOptions = "-Dflogger.backend_factory=com.google.common.flogger.backend.log4j.Log4jBackendFactory#getInstance"
javaOptions = "-Dflogger.logging_context=com.google.gerrit.server.logging.LoggingContext#getInstance"
user = lucamilanesio
javaHome = /Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home/jre
[index]
type = LUCENE
[auth]
type = DEVELOPMENT_BECOME_ANY_ACCOUNT
skipFullRefEvaluationIfAllRefsAreVisible = false
[receive]
enableSignedPush = false
[sendemail]
smtpServer = localhost
[sshd]
listenAddress = *:29418
[httpd]
listenUrl = http://*:9090/
[cache]
directory = cache
[plugin "webhooks"]
connectionTimeout = 3000
socketTimeout = 2500
maxTries = 300
retryInterval = 2000
threadPoolSize = 3
[plugins]
checkFrequency = 10s

>
> --
> Yubin

Tomas Johansson

unread,
Apr 11, 2019, 8:36:51 AM4/11/19
to Repo and Gerrit Discussion
How do I configure the gerrit webhooks plugin to trigger jenkins on another host?

Johannes Carlsson

unread,
Apr 15, 2019, 2:15:17 AM4/15/19
to Repo and Gerrit Discussion
Hi,

Either you manually edit the config file in the project (see https://youtu.be/pyPMeCW-Q5k?t=1710) or you use curl:

curl -H "Content-Type: application/json" --request PUT --user <user>:<http-password> http://gerrit-server>:<gerrit-port>/a/config/server/webhooks~projects/All-Projects/remotes/jenkins --data '{"url": "http://<jenkins-server>:<jenkins-port>/gerrit-webhook/"}'

Note that above example will add to the "All-Projects" which means all projects will inherit the setting.

Regards
/Johannes
Reply all
Reply to author
Forward
0 new messages