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

Using Jenkins Job Builder to create triggers based on comment regex fails to trigger

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reopened (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: core, gerrit-trigger-plugin
    • Labels:
      None
    • Environment:
      Jenkins with Gerrit Trigger plugin
      Jenkins Job Builder for job management
    • Similar Issues:

      Description

      When using JJB (Jenkins Job Builder) to create a Gerrit Trigger based job to trigger on a regex pattern in the comment field. The jobs will fail to trigger if created in this way.

      I know of 2 workarounds:

      1. Navigate to the job configure page and hit save
      2. Restart Jenkins process

      Notice that if workaround 1 is used the new config.xml created will be identical to the version of itself before save was clicked.

      My guess is Gerrit Trigger code must be holding something that needs to be updated before it register's the Job's regex trigger. Saving and/or reloading Jenkins causes the update.

      The JJB code for adding RegEx triggers can be found on OpenStack Gerrit at (at time of this writing it's not yet merged into JJB):

      https://review.openstack.org/#/c/136605/

      Any insight on this would be appreciated as the workarounds to move forward are not ideal.

        Attachments

          Issue Links

            Activity

            Hide
            rin_ne rin_ne added a comment - - edited

            What is Jenkins Job Builder? Should we take JJB related issues as Jenkins plugin developer?

            Show
            rin_ne rin_ne added a comment - - edited What is Jenkins Job Builder? Should we take JJB related issues as Jenkins plugin developer?
            Hide
            rsandell rsandell added a comment -

            This is related to JENKINS-23152 that I'm currently working on.
            The issue is that Jenkins Job Builder is using http post of config.xml and in that scenario core isn't calling trigger.stop/start in the same way as when saving config via UI, or it's using CLI which behaves even worse, so the old configuration from the previous trigger config hangs around and the new one isn't activated correctly.

            Show
            rsandell rsandell added a comment - This is related to JENKINS-23152 that I'm currently working on. The issue is that Jenkins Job Builder is using http post of config.xml and in that scenario core isn't calling trigger.stop/start in the same way as when saving config via UI, or it's using CLI which behaves even worse, so the old configuration from the previous trigger config hangs around and the new one isn't activated correctly.
            Hide
            danielbeck Daniel Beck added a comment -

            IMO for issues with JJB to be relevant here they need to be reproducible with Jenkins itself. In this case, probably through the REST API by POSTing config.xml.

            Resolving as duplicate of the linked issue.

            Show
            danielbeck Daniel Beck added a comment - IMO for issues with JJB to be relevant here they need to be reproducible with Jenkins itself. In this case, probably through the REST API by POSTing config.xml. Resolving as duplicate of the linked issue.
            Hide
            danielbeck Daniel Beck added a comment -

            Reopening as the other seems limited to build loss rather than the overall "Trigger not updated" issue.

            Show
            danielbeck Daniel Beck added a comment - Reopening as the other seems limited to build loss rather than the overall "Trigger not updated" issue.
            Hide
            tykeal Andrew Grimberg added a comment -

            This actually seems to be even worse with the newer versions of the trigger plugin. I haven't worked backwards to figure out which one made it worse but 2.18 doesn't even pick up standard triggers when created / modified in this fashion.

            It's painful when a job that was working fine (after having either restarted jenkins or doing the save tango) gets an update and stops responding to any trigger events.

            Show
            tykeal Andrew Grimberg added a comment - This actually seems to be even worse with the newer versions of the trigger plugin. I haven't worked backwards to figure out which one made it worse but 2.18 doesn't even pick up standard triggers when created / modified in this fashion. It's painful when a job that was working fine (after having either restarted jenkins or doing the save tango) gets an update and stops responding to any trigger events.

              People

              Assignee:
              rsandell rsandell
              Reporter:
              zxiiro Thanh Ha
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated: