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

Parallel step snippet generator error

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      When trying to generate a parallel step from the snippet generator an exception is thrown:

      java.lang.RuntimeException: Failed to instantiate class org.jenkinsci.plugins.workflow.cps.steps.ParallelStep from {"stapler-class":"org.jenkinsci.plugins.workflow.cps.steps.ParallelStep", "$class":"org.jenkinsci.plugins.workflow.cps.steps.ParallelStep"}
      	at hudson.model.Descriptor.newInstance(Descriptor.java:579)
      	at org.jenkinsci.plugins.workflow.cps.Snippetizer.doGenerateSnippet(Snippetizer.java:212)
      
      ...
      
      Caused by: org.kohsuke.stapler.NoStaplerConstructorException: There's no @DataBoundConstructor on any constructor of class org.jenkinsci.plugins.workflow.cps.steps.ParallelStep
      	at org.kohsuke.stapler.ClassDescriptor.loadConstructorParamNames(ClassDescriptor.java:177)
      

        Attachments

          Issue Links

            Activity

            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            The issue still exists on the latest versions

            Show
            oleg_nenashev Oleg Nenashev added a comment - The issue still exists on the latest versions
            Hide
            znerd Ernst de Haan added a comment -

             Is there a workaround available so that I can have syntax highlighting in IntelliJ IDEA?

            I tried this:

            method(name: 'parallel', type: 'Object', params: [name: 'steps', type: 'Map'], doc: 'Parallel steps')
            

            …but that doesn't work. I may need to specify a different type (but which one?)

            Show
            znerd Ernst de Haan added a comment -  Is there a workaround available so that I can have syntax highlighting in IntelliJ IDEA? I tried this: method(name: 'parallel', type: 'Object', params: [name: 'steps', type: 'Map'], doc: 'Parallel steps') …but that doesn't work. I may need to specify a different type (but which one?)
            Hide
            tgray Trevor Gray added a comment -

             I added the following lines to the GDSL and it seems to be working, using Intellij IDEA (2017.2.5):

            method(name: 'parallel', type: 'Object', params: [steps: 'Map'], doc: 'Execute in parallel')
            method(name: 'parallel', type: 'Object', params: [steps: 'Map', failFast: 'boolean'], doc: 'Execute in parallel')

             

            Another workaround, is to just disable the check by adding the following comment above each call to parallel:

            //noinspection GroovyAssignabilityCheck

            But this is really just ignoring the issue, and unhelpful for autocomplete / syntax highlighting.

            Show
            tgray Trevor Gray added a comment -  I added the following lines to the GDSL and it seems to be working, using Intellij IDEA (2017.2.5): method(name: 'parallel' , type: ' Object ' , params: [steps: 'Map' ], doc: 'Execute in parallel' ) method(name: 'parallel' , type: ' Object ' , params: [steps: 'Map' , failFast: ' boolean ' ], doc: 'Execute in parallel' )   Another workaround, is to just disable the check by adding the following comment above each call to parallel : //noinspection GroovyAssignabilityCheck But this is really just ignoring the issue, and unhelpful for autocomplete / syntax highlighting.
            Hide
            dnusbaum Devin Nusbaum added a comment -

            I filed a PR to fix the GDSL issue here. The snippet generator and automatically generated documentation would not be affected by that PR.

            Show
            dnusbaum Devin Nusbaum added a comment - I filed a PR to fix the GDSL issue here . The snippet generator and automatically generated documentation would not be affected by that PR.
            Hide
            dnusbaum Devin Nusbaum added a comment -

            Ok, the GDSL issues should be fixed in Pipeline: Groovy Plugin version 2.73. The documentation issues and error when "generate snippet" is clicked still exist, and I'm not sure of a good way to fix them without more special casing for the parallel step. I'm going to move this back to open.

            Show
            dnusbaum Devin Nusbaum added a comment - Ok, the GDSL issues should be fixed in Pipeline: Groovy Plugin version 2.73. The documentation issues and error when "generate snippet" is clicked still exist, and I'm not sure of a good way to fix them without more special casing for the parallel step. I'm going to move this back to open.

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              amuniz Antonio Muñiz
              Votes:
              4 Vote for this issue
              Watchers:
              13 Start watching this issue

                Dates

                Created:
                Updated: