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

Using a Delivery Pipeline view as the default view in Jenkins breaks the "New Item" sidebar link

XMLWordPrintable

      Overview
      --------
      Pull Request #67 added the ability to use a Delivery Pipeline view as the default view in Jenkins (see JENKINS-23282). However, this fix introduced a defect when trying to create a new job from the default view.

      Steps to Reproduce
      -------------------
      1. As a Jenkins admin, install version 0.8.0 or later of the Delivery Pipeline plugin in Jenkins
      2. Create a new pipeline view by navigating to /newView in Jenkins, selecting "Build Pipeline View", assigning a name, and clicking "Ok"
      3. In the newly created view from #2, click the "Edit View" sidebar link to add one or more jobs to the pipeline view. Click Ok to save the changes to the pipeline view.
      4. Click the "Manage Jenkins" sidebar link, and click the "Configure System" link.
      5. Change the default view to the pipeline view created in step #2. Click Ok to save.
      6. Navigate to the Jenkins default view by clicking the Jenkins logo in the upper left hand header region of the screen
      7. Click the "New Item" sidebar link to create a new job.
      8. Enter a new job name such as "test", select "Build a free-style software project", and click the "OK" button.

      Expected Result
      ---------------
      Jenkins should create a new job using the name provided in step #8 and render the configure page for the new job.

      Actual Result
      -------------
      An error page displays with a stack trace of

      javax.servlet.ServletException: java.lang.StackOverflowError
      ...
      Caused by: java.lang.StackOverflowError
      	at hudson.model.ViewGroupMixIn.getPrimaryView(ViewGroupMixIn.java:127)
      	at jenkins.model.Jenkins.getPrimaryView(Jenkins.java:1484)
      	at se.diabol.jenkins.pipeline.DeliveryPipelineView.doCreateItem(DeliveryPipelineView.java:363)
      	at se.diabol.jenkins.pipeline.DeliveryPipelineView.doCreateItem(DeliveryPipelineView.java:363)
      	at se.diabol.jenkins.pipeline.DeliveryPipelineView.doCreateItem(DeliveryPipelineView.java:363)
      ...
      

      Remarks
      -------
      The hudson.model.View abstract class declares the doCreateItem method as abstract. The current implementation of doCreateItem in the DeliveryPipelineView class defers implementation of doCreateItem to the default system view. This causes an infinite loop when the DeliveryPipeline view is the default view, as it keeps calling it's own doCreateItem method.

            patbos Patrik Boström
            stevejansen Steve Jansen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: