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

Job-DSL stash notifier creates "Unreadable Data".

      When following the job dsl documentation for the Stash notifier plugin (https://jenkinsci.github.io/job-dsl-plugin/#path/job-publishers-stashNotifier) 

      code:

      job('blah') { publishers {  stashNotifier()  } } 

       

      It produces the following XML:
      <org.jenkinsci.plugins.stashNotifier.StashNotifier>
               <stashServerBaseUrl/>
               <stashUserName/>
               <stashUserPassword/>
               <ignoreUnverifiedSSLPeer>false</ignoreUnverifiedSSLPeer>
               <commitSha1/>
               <includeBuildNumberInKey>false</includeBuildNumberInKey>
      </org.jenkinsci.plugins.stashNotifier.StashNotifier>
       
      This triggers an "Unreadable Data" message:
            MissingFieldException: No field 'stashUserName' found in class 'org.jenkinsci.plugins.stashNotifier.StashNotifier', MissingFieldException: No field 'stashUserPassword' found in class 'org.jenkinsci.plugins.stashNotifier.StashNotifier'

          [JENKINS-42900] Job-DSL stash notifier creates "Unreadable Data".

          Daniel Christophis added a comment - - edited

          Same issue just occured to me. I think because of changes in StashNotifier plugin (https://github.com/jenkinsci/stashnotifier-plugin)

          stashServerBaseUrl, stashUserName, stashUserPassword and ignoreUnverifiedSSLPeer are obsolete for job configuration in DSL.

           

          In my opinion this must be fixed in Job-DSL-Plugin (https://github.com/jenkinsci/job-dsl-plugin)

          See: https://github.com/jenkinsci/job-dsl-plugin/blob/master/job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/helpers/publisher/PublisherContext.groovy#L1028

          and perhaps also: https://github.com/jenkinsci/job-dsl-plugin/blob/master/job-dsl-core/src/test/groovy/javaposse/jobdsl/dsl/helpers/publisher/PublisherContextSpec.groovy

           

          As for a temporary workarround you can define your DSL code with a configure block:

           

          configure {
              it / 'publishers' << 'org.jenkinsci.plugins.stashNotifier.StashNotifier' {
                  includeBuildNumberInKey(true) // set false or remove item
                  commitSha1('') // set commit hash or remove item
              }
          }
          

          Daniel Christophis added a comment - - edited Same issue just occured to me. I think because of changes in StashNotifier plugin ( https://github.com/jenkinsci/stashnotifier-plugin) stashServerBaseUrl, stashUserName, stashUserPassword and ignoreUnverifiedSSLPeer are obsolete for job configuration in DSL.   In my opinion this must be fixed in Job-DSL-Plugin ( https://github.com/jenkinsci/job-dsl-plugin) See: https://github.com/jenkinsci/job-dsl-plugin/blob/master/job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/helpers/publisher/PublisherContext.groovy#L1028 and perhaps also: https://github.com/jenkinsci/job-dsl-plugin/blob/master/job-dsl-core/src/test/groovy/javaposse/jobdsl/dsl/helpers/publisher/PublisherContextSpec.groovy   As for a temporary workarround you can define your DSL code with a configure block:   configure { it / 'publishers' << 'org.jenkinsci.plugins.stashNotifier.StashNotifier' { includeBuildNumberInKey( true ) // set false or remove item commitSha1('') // set commit hash or remove item } }

          mcrooney added a comment -

          Thanks for the work-around! As requested by daspilker, adding that it would be fantastic to clean this up to remove the unreadable data issues, as well as add options for overriding the server and other options

          mcrooney added a comment - Thanks for the work-around! As requested by daspilker , adding that it would be fantastic to clean this up to remove the unreadable data issues, as well as add options for overriding the server and other options

          Code changed in jenkins
          User: Daniel Spilker
          Path:
          docs/Home.md
          docs/Migration.md
          job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/helpers/publisher/PublisherContext.groovy
          job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/helpers/publisher/StashNotifierContext.groovy
          job-dsl-core/src/test/groovy/javaposse/jobdsl/dsl/helpers/publisher/PublisherContextSpec.groovy
          http://jenkins-ci.org/commit/job-dsl-plugin/958ab0a08ff68f1fcacd981d27673dddb3c3abf8
          Log:
          enhanced support for the Stash Notifier Plugin
          deprecated support for the older versions of the Stash Notifier Plugin

          [FIXES JENKINS-29183]
          [FIXES JENKINS-42900]

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Spilker Path: docs/Home.md docs/Migration.md job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/helpers/publisher/PublisherContext.groovy job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/helpers/publisher/StashNotifierContext.groovy job-dsl-core/src/test/groovy/javaposse/jobdsl/dsl/helpers/publisher/PublisherContextSpec.groovy http://jenkins-ci.org/commit/job-dsl-plugin/958ab0a08ff68f1fcacd981d27673dddb3c3abf8 Log: enhanced support for the Stash Notifier Plugin deprecated support for the older versions of the Stash Notifier Plugin [FIXES JENKINS-29183] [FIXES JENKINS-42900]

          Code changed in jenkins
          User: Daniel Spilker
          Path:
          docs/Home.md
          docs/Migration.md
          job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/helpers/publisher/PublisherContext.groovy
          job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/helpers/publisher/StashNotifierContext.groovy
          job-dsl-core/src/test/groovy/javaposse/jobdsl/dsl/helpers/publisher/PublisherContextSpec.groovy
          http://jenkins-ci.org/commit/job-dsl-plugin/b03b26f7bba37dc08e391e27ecee7aaa8ff639e3
          Log:
          Merge branch 'JENKINS-42900'

          Compare: https://github.com/jenkinsci/job-dsl-plugin/compare/72a6e57eaa2b...b03b26f7bba3

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Spilker Path: docs/Home.md docs/Migration.md job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/helpers/publisher/PublisherContext.groovy job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/helpers/publisher/StashNotifierContext.groovy job-dsl-core/src/test/groovy/javaposse/jobdsl/dsl/helpers/publisher/PublisherContextSpec.groovy http://jenkins-ci.org/commit/job-dsl-plugin/b03b26f7bba37dc08e391e27ecee7aaa8ff639e3 Log: Merge branch ' JENKINS-42900 ' Compare: https://github.com/jenkinsci/job-dsl-plugin/compare/72a6e57eaa2b...b03b26f7bba3

          mcrooney added a comment -

          Thanks daspilker, you are my hero

          mcrooney added a comment - Thanks daspilker , you are my hero

            daspilker Daniel Spilker
            cruhl Chaz Ruhl
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: