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

Workflow Job does not call Trigger.start() when job is created

      When a Trigger that extends Trigger<Job> is added to a job as it is being created, the start() method is not called.

      There is a test called PipelineTriggersJobPropertyTest#triggerPresentDuringStart which shows that start() is called. But in practice...in a non-test environment, it is not called.

      I created a simple MockTrigger that shows this.

      How to reproduce:

      You will notice that the start() method is not called.

      This behaviour is not consistent with Freestyle jobs.

          [JENKINS-42446] Workflow Job does not call Trigger.start() when job is created

          Scott Hebert created issue -
          Scott Hebert made changes -
          Link New: This issue blocks JENKINS-42401 [ JENKINS-42401 ]
          Jesse Glick made changes -
          Assignee New: Scott Hebert [ scoheb ]
          Jesse Glick made changes -
          Remote Link New: This issue links to "PR 41 (Web Link)" [ 15805 ]
          Jesse Glick made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Jesse Glick made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]

          Jesse Glick added a comment -

          Workaround: resave the job configuration.

          Jesse Glick added a comment - Workaround: resave the job configuration.
          Jesse Glick made changes -
          Link New: This issue relates to JENKINS-44218 [ JENKINS-44218 ]
          Jesse Glick made changes -
          Link New: This issue is duplicated by JENKINS-45067 [ JENKINS-45067 ]

          Andrew Bayer added a comment -

          Merged, will be in workflow-job 2.16.

          Andrew Bayer added a comment - Merged, will be in workflow-job 2.16.

          Code changed in jenkins
          User: Scott Hebert
          Path:
          src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java
          src/test/java/org/jenkinsci/plugins/workflow/job/properties/PipelineTriggersJobPropertyTest.java
          http://jenkins-ci.org/commit/workflow-job-plugin/47622a022bc226e7d4223053334912056803f081
          Log:
          Triggers should be started on job creation

          [FIXES JENKINS-42446]

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Scott Hebert Path: src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java src/test/java/org/jenkinsci/plugins/workflow/job/properties/PipelineTriggersJobPropertyTest.java http://jenkins-ci.org/commit/workflow-job-plugin/47622a022bc226e7d4223053334912056803f081 Log: Triggers should be started on job creation [FIXES JENKINS-42446]
          Andrew Bayer made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Review [ 10005 ] New: Resolved [ 5 ]

            scoheb Scott Hebert
            scoheb Scott Hebert
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: