• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • job-dsl-plugin
    • Jenkins 2.12, Job DSL 1.48

      Currently Job DSL has neat support for running as a Pipeline step: https://github.com/jenkinsci/job-dsl-plugin/wiki/User-Power-Moves#use-job-dsl-in-pipeline-scripts. However, if attempting to add this from the snippet generator (https://jenkins.io/doc/pipeline/#using-snippet-generator) you end up with an unhelpful generated groovy: "step <object of type javaposse.jobdsl.plugin.ExecuteDslScripts>". I'm not positive if this needs a different constructor or how exactly Job DSL can better support this, but if it helps I found a related issue+PR for another plugin with the same problem: https://github.com/dblock/jenkins-ansicolor-plugin/issues/65

          [JENKINS-36502] compatibility with snippet generator

          mcrooney created issue -
          Daniel Spilker made changes -
          Link New: This issue is duplicated by JENKINS-36711 [ JENKINS-36711 ]
          Liam Newman made changes -
          Comment [ [~daspilker]
          This wouldn't effect a custom build step exposed via "org.jenkinsci.plugins.workflow.steps.AbstractStepDescriptorImpl", right?


          ]
          Liam Newman made changes -
          Comment [ I'm working on a fix for this. It has to do with getting the databound paramters just right. ]

          Liam Newman added a comment -

          Liam Newman added a comment - daspilker I've implemented a fix for this. https://github.com/jenkinsci/job-dsl-plugin/pull/880
          mcrooney made changes -
          Summary Original: compatibility with snipper generator New: compatibility with snippet generator
          Liam Newman made changes -
          Link New: This issue is related to JENKINS-35282 [ JENKINS-35282 ]

          The problem seems to be the @DataBoundConstructor parameter with type javaposse.jobdsl.plugin.ExecuteDslScripts.ScriptLocation.

          https://github.com/jenkinsci/job-dsl-plugin/blob/job-dsl-1.48/job-dsl-plugin/src/main/groovy/javaposse/jobdsl/plugin/ExecuteDslScripts.java#L143

          jglick: is there a chance to improve the snippet generator?

          Daniel Spilker added a comment - The problem seems to be the @DataBoundConstructor parameter with type javaposse.jobdsl.plugin.ExecuteDslScripts.ScriptLocation . https://github.com/jenkinsci/job-dsl-plugin/blob/job-dsl-1.48/job-dsl-plugin/src/main/groovy/javaposse/jobdsl/plugin/ExecuteDslScripts.java#L143 jglick : is there a chance to improve the snippet generator?

          Liam Newman added a comment -

          jglick,daspilker
          Actually, it isn't the constructor that's the issue exactly. It is the fact that the constructor takes a field that doesn't exist as a "public final" field or a public get/set databound member. I have a PR (noted above) that fixes this.

          Liam Newman added a comment - jglick , daspilker Actually, it isn't the constructor that's the issue exactly. It is the fact that the constructor takes a field that doesn't exist as a "public final" field or a public get/set databound member. I have a PR (noted above) that fixes this.
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 173214 ] New: JNJira + In-Review [ 185001 ]

            daspilker Daniel Spilker
            mcrooney mcrooney
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: