Jenkins Gerrit-Trigger plugin triggers multiple jobs

134 views
Skip to first unread message

Jean-Louis Petitlaurent

unread,
Sep 14, 2021, 10:11:03 AM9/14/21
to Repo and Gerrit Discussion
Hi guys,

I deployed on openshift v4.6 (kubernetes 1.19)
- jenkins 2.289.2 with gerrit-trigger 2.35
- gerrit 3.3.2-1 (dnf install gerrit)

project.config modified on the top of my project
[access]
    inheritFrom = All-Projects
...
[access "refs/heads/*"]
    label-Code-Review = -2..+1 group Service Users
    label-Sonar-Verified = -2..+1 group Service Users
    label-Verified = -1..+1 group Service Users
...

as I commit on gerrit:
git add . && git commit -m'XXXX' && git push origin HEAD:refs/for/develop

There are several jobs Ref updated trigger on jenkins.
refs/changes/[09][09]/[09]/meta X2 :-(
refs/changes/[09][09]/[09]/[01]    :-(
And my patchset                    :-)

After, my change was merged
refs/changes/[09][09]/[09]/meta X2 :-(
refs/notes/review                   :-(
my right ref-updated on my branch  :-)

I saw this bug: https://bugs.chromium.org/p/gerrit/issues/detail?id=13621

I'm lost on what to do.
What is project.config modification applied to solve this issue?

Regards
Jean-Louis


Sven Selberg

unread,
Sep 14, 2021, 10:29:31 AM9/14/21
to Repo and Gerrit Discussion
gerrit-trigger allows you to filter which refs to trigger on (refs/heads/*) and to trigger on the "patchset-created" event. If configured correctly it should not trigger on the meta-refs.
For how to configure gerrit-trigger check documentation: https://plugins.jenkins.io/gerrit-trigger/

Hope that helps.

Jean-Louis Petitlaurent

unread,
Sep 14, 2021, 11:12:52 AM9/14/21
to Repo and Gerrit Discussion
Hi Sven,
Thanks for your answer, as you can see on this documentation is not up to date.
With gerrit version >=3.3, 'Non-Interactive Users' is replaced 'Service User', we should not allow on refs/*
May be I create an issue on this plugin?

Admin > Projects > …​ > Access > Edit

  • Reference: refs/*

    • Read: ALLOW for Non-Interactive Users


Admin > Projects > …​ > Access > Edit

  • Reference: refs/*

    • Read: ALLOW for Non-Interactive Users


Sven Selberg

unread,
Sep 15, 2021, 4:47:51 AM9/15/21
to Repo and Gerrit Discussion
On Tuesday, September 14, 2021 at 5:12:52 PM UTC+2 jl.peti...@gmail.com wrote:
Hi Sven,
Thanks for your answer, as you can see on this documentation is not up to date.
With gerrit version >=3.3, 'Non-Interactive Users' is replaced 'Service User', we should not allow on refs/*
May be I create an issue on this plugin?

I took the liberty of updating the documentation. Don't know if Bobby wants an Issue to track it with.
https://github.com/jenkinsci/gerrit-trigger-plugin/pull/452 

Sven Selberg

unread,
Sep 15, 2021, 5:13:47 AM9/15/21
to Repo and Gerrit Discussion
On Wednesday, September 15, 2021 at 10:47:51 AM UTC+2 Sven Selberg wrote:
On Tuesday, September 14, 2021 at 5:12:52 PM UTC+2 jl.peti...@gmail.com wrote:
Hi Sven,
Thanks for your answer, as you can see on this documentation is not up to date.
With gerrit version >=3.3, 'Non-Interactive Users' is replaced 'Service User', we should not allow on refs/*
May be I create an issue on this plugin?

I took the liberty of updating the documentation. Don't know if Bobby wants an Issue to track it with.
https://github.com/jenkinsci/gerrit-trigger-plugin/pull/452 

P.s.
Depending on your use-case and how invested you are in the gerrit-trigger plugin already,  you should take a look at https://plugins.jenkins.io/gerrit-code-review/ for your 
Gerrit -> Jenkins integration. A different approach which might be a better fit for you.
Luca can probably talk more on the benefits of this plugin.
Reply all
Reply to author
Forward
0 new messages