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

Promoted builds plugin DSL does not work with dynamic DSL in the actions.

      Promoted builds plugin DSL integration code does not work when dynamic DSL plugins are used in the promotion actions.

      This happens because dynamic DSL plugin node has a different layout than a regular job DSL node.

          [JENKINS-68363] Promoted builds plugin DSL does not work with dynamic DSL in the actions.

          Denis Tikhomirov added a comment - - edited

          Denis Tikhomirov added a comment - - edited A PR with a fix - https://github.com/jenkinsci/promoted-builds-plugin/pull/156

          pam added a comment - - edited

          Could this be why wsCleanup doesn't work in our promoted builds?

           
          **

          17:17:57 ERROR: (unknown source) No signature of method: javaposse.jobdsl.dsl.helpers.step.StepContext.cleanWs() is applicable for argument types: (hello_world_dev$_run_closure1$_closure2$_closure7$_closure8$_closure10$_closure12) values: [hello_world_dev$_run_closure1$_closure2$_closure7$_closure8$_closure10$_closure12@300793fc]

          it looks like this in groovy:

          actions {
                              copyArtifacts("jmx_exporter") {
                                  includePatterns()
                                  fingerprintArtifacts(true)
                              }
                              shell("")
                              cleanWs {
                                  deleteDirectories(false)
                                  cleanWhenSuccess(true)
                                  cleanWhenUnstable(true)
                                  cleanWhenFailure(true)
                                  cleanWhenNotBuilt(true)
                                  cleanWhenAborted(true)
                                  cleanupMatrixParent(false)
                              }
                          } 

          and like this in the original XML:

          <buildSteps>
              ...
              <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup@0.30">
                  <patterns class="empty-list"/>
                  <deleteDirs>false</deleteDirs>
                  <skipWhenFailed>false</skipWhenFailed>
                  <cleanWhenSuccess>true</cleanWhenSuccess>
                  <cleanWhenUnstable>true</cleanWhenUnstable>
                  <cleanWhenFailure>true</cleanWhenFailure>
                  <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
                  <cleanWhenAborted>true</cleanWhenAborted>
                  <notFailBuild>false</notFailBuild>
                  <cleanupMatrixParent>false</cleanupMatrixParent>
                  <externalDelete/>
              </hudson.plugins.ws__cleanup.WsCleanup>
          </buildSteps> 

          Just trying to figure out if this warrants a feature request ticket separate from this one or if we should get that PR approved and it would solve both problems.

           

          I only say so since our API viewer says cleanWs is dynamic

           

          I've tried switching it to WsCleanup but that doesn't work either: https://jenkinsci.github.io/job-dsl-plugin/#method/javaposse.jobdsl.dsl.helpers.publisher.MavenPublisherContext.wsCleanup

           

          pam added a comment - - edited Could this be why wsCleanup doesn't work in our promoted builds?   ** 17:17:57 ERROR: (unknown source) No signature of method: javaposse.jobdsl.dsl.helpers.step.StepContext.cleanWs() is applicable for argument types: (hello_world_dev$_run_closure1$_closure2$_closure7$_closure8$_closure10$_closure12) values: [hello_world_dev$_run_closure1$_closure2$_closure7$_closure8$_closure10$_closure12@300793fc] it looks like this in groovy: actions {                     copyArtifacts( "jmx_exporter" ) {                         includePatterns()                         fingerprintArtifacts( true )                     }                     shell("")                     cleanWs {                         deleteDirectories( false )                         cleanWhenSuccess( true )                         cleanWhenUnstable( true )                         cleanWhenFailure( true )                         cleanWhenNotBuilt( true )                         cleanWhenAborted( true )                         cleanupMatrixParent( false )                     }                 } and like this in the original XML: <buildSteps> ... <hudson.plugins.ws__cleanup.WsCleanup plugin= "ws-cleanup@0.30" > <patterns class= "empty-list" /> <deleteDirs> false </deleteDirs> <skipWhenFailed> false </skipWhenFailed> <cleanWhenSuccess> true </cleanWhenSuccess> <cleanWhenUnstable> true </cleanWhenUnstable> <cleanWhenFailure> true </cleanWhenFailure> <cleanWhenNotBuilt> true </cleanWhenNotBuilt> <cleanWhenAborted> true </cleanWhenAborted> <notFailBuild> false </notFailBuild> <cleanupMatrixParent> false </cleanupMatrixParent> <externalDelete/> </hudson.plugins.ws__cleanup.WsCleanup> </buildSteps> Just trying to figure out if this warrants a feature request ticket separate from this one or if we should get that PR approved and it would solve both problems.   I only say so since our API viewer says cleanWs is dynamic   I've tried switching it to WsCleanup but that doesn't work either: https://jenkinsci.github.io/job-dsl-plugin/#method/javaposse.jobdsl.dsl.helpers.publisher.MavenPublisherContext.wsCleanup  

          pam added a comment -

          cc tikhde since I didn't find where you posted your original error

          pam added a comment - cc tikhde since I didn't find where you posted your original error

            oleg_nenashev Oleg Nenashev
            tikhde Denis Tikhomirov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: