[JIRA] (JENKINS-60072) trigger on "ref-updated" generates many noisy/wrong events

4 views
Skip to first unread message

msc@onesty-tech.de (JIRA)

unread,
Nov 6, 2019, 3:45:05 AM11/6/19
to jenkinsc...@googlegroups.com
Markus Schulz created an issue
 
Jenkins / Bug JENKINS-60072
trigger on "ref-updated" generates many noisy/wrong events
Issue Type: Bug Bug
Assignee: rsandell
Components: gerrit-trigger-plugin
Created: 2019-11-06 08:44
Priority: Major Major
Reporter: Markus Schulz

Gerrit-Version: 2.15.8

After enabling the Trigger on "Ref Updated" i got many gerrit events for "non source code" based updates.

I need the "Ref-Updated" trigger to allow "non-reviewing projects" to be executed thru a jenkins pipeline (after pushing some changes -> build/deploy stuff). These projects are working fine, now only the "review-projects" are stumbling like described below.

For example if a user create a new patchset i got two events

  1. unexpected event GERRIT_EVENT_TYPE=ref-updated with the following variables
    GERRIT_REFSPEC=refs/heads/master
    GERRIT_REFNAME=refs/changes/37/7337/1
    GERRIT_OLDREV=0000000000000000000000000000000000000000
    GERRIT_NEWREV=f1afefdb742808546864b89db42655a6cc1f1296
    don't know what this event wants to tell me
  2. expected event GERRIT_EVENT_TYPE=patchset-created
    GERRIT_REFSPEC=refs/changes/37/7337/1
    ....
    the normal event (like before enabling Ref Updated)

If a user submit a review it becomes more strange, now i got three events:

  1. unexpected event GERRIT_EVENT_TYPE=ref-updated with the following variables
    GERRIT_REFSPEC=refs/heads/master
    GERRIT_OLDREV=fbdab6370a390f03a565fe3f065c76434bf7277a
    GERRIT_NEWREV=f1afefdb742808546864b89db42655a6cc1f1296
  1. expected event GERRIT_EVENT_TYPE=change-merged with the following variables
    GERRIT_REFSPEC=refs/changes/37/7337/1
    GERRIT_NEWREV=f1afefdb742808546864b89db42655a6cc1f1296
  1. unexpected event GERRIT_EVENT_TYPE=ref-updated with the following variables
    GERRIT_REFSPEC=refs/heads/master
    GERRIT_REFNAME=refs/notes/review
    GERRIT_OLDREV=7f5b17092e3f724defd8074f815dab8e034a8b92
    GERRIT_NEWREV=c7c264f68f44a1865eaad29c748a9a49aec644c2
    these one is strange, looks like it comes from submitting internal structures of gerrit (i know that in gerrit there are some changes ongoing to replace the sql database and safe these values into git/note-db?)

 

I'm not sure if the order of these events is predictable and if there are more events like for example if the user adds some notes to the review.

But at least the third event should never be passed thru the gerrit-trigger-plugin to jenkins. It's an gerrit internal use of the git repository to store some things (like refs/meta/config) and has nothing to do with the project itself.

Additional it would be nice to get rid of the first event for a "submit" action.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

okitain@gmail.com (JIRA)

unread,
Mar 24, 2020, 11:10:03 AM3/24/20
to jenkinsc...@googlegroups.com
Olga K commented on Bug JENKINS-60072
 
Re: trigger on "ref-updated" generates many noisy/wrong events

I have to confirm this bug. It seems like pushing a new patchset, commenting or submitting through review generates extra ref-updated events since the NoteDB migration.

E.g. me writing a comment on Gerrit:

GERRIT_EVENT_TYPE = ref-updated
GERRIT_REFNAME = refs/changes/11/15511/meta
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages