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

Code Snippet Generator for 'step' should use class FQDN in case of collisions

      Some plugins use the same shortname for their build step class such as CheckStylePublisher with the CheckStyle Plugin (hudson.plugins.checkstyle.CheckStylePublisher) and the JSHint Plugin (hudson.plugins.jshint.CheckStylePublisher).

      The groovy code generated by the snipped generator is then invalid (see sample below).

      It would be nice if the snippet generator could generate a syntax with the fully qualified class name or if an error message could be displayed in the workflow editor.

      step([$class: 'CheckStylePublisher', pattern: '**/checkstyle-result.xml'])
      
      java.lang.UnsupportedOperationException: CheckStylePublisher as a interface jenkins.tasks.SimpleBuildStep could mean either hudson.plugins.jshint.CheckStylePublisher or hudson.plugins.checkstyle.CheckStylePublisher
      	at org.jenkinsci.plugins.workflow.structs.DescribableHelper.coerce(DescribableHelper.java:226)
      	at org.jenkinsci.plugins.workflow.structs.DescribableHelper.buildArguments(DescribableHelper.java:185)
      	at org.jenkinsci.plugins.workflow.structs.DescribableHelper.instantiate(DescribableHelper.java:91)
      	at org.jenkinsci.plugins.workflow.steps.StepDescriptor.newInstance(StepDescriptor.java:103)
      	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:133)
      	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:112)
      	...
      	at java.lang.Thread.run(Thread.java:745)
      

          [JENKINS-32476] Code Snippet Generator for 'step' should use class FQDN in case of collisions

          Cyrille Le Clerc created issue -
          Jesse Glick made changes -
          Epic Link New: JENKINS-35393 [ 171186 ]
          Jesse Glick made changes -
          Component/s New: structs-plugin [ 21442 ]
          Component/s Original: workflow-plugin [ 18820 ]
          Jesse Glick made changes -
          Labels New: workflow
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 168112 ] New: JNJira + In-Review [ 182973 ]
          Andrew Bayer made changes -
          Labels Original: workflow New: pipeline workflow
          Andrew Bayer made changes -
          Labels Original: pipeline workflow New: pipeline
          Jesse Glick made changes -
          Link New: This issue duplicates JENKINS-43337 [ JENKINS-43337 ]
          Jesse Glick made changes -
          Resolution New: Duplicate [ 3 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

            jglick Jesse Glick
            cleclerc Cyrille Le Clerc
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: