Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-60072

trigger on "ref-updated" generates many noisy/wrong events

    Details

    • Similar Issues:

      Description

      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.

        Attachments

          Activity

          Hide
          oktuba Olga K added a comment -

          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
          Show
          oktuba Olga K added a comment - 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

            People

            • Assignee:
              rsandell rsandell
              Reporter:
              nias Markus Schulz
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: