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

bapSshPublisher closure requires sshCredentials in Jenkins DSL.

      When using the closure bapSshPublisher in Jenkins DSL, sshCredentials is required even though it appears to be optional when creating a job through the Jenkins UI:

       
      configName(String value)                   - required
      Select an SSH configuration from the list configured in the global configuration of this Jenkins.
       
      sshCredentials {}                                 - required
      Set the credentials to use with this connection.If you want to use different credentials from those configured for this server, or if the credentials have not been specified for this server, then enable this option and set them here.

      The resulting job allows de-selection of credentials, but DSL requires it.  

      sshCredentials should optional when using bapSshPublisher in the Jenkins DSL, especially when there's a global configuration that is referenced through configName.  

          [JENKINS-43100] bapSshPublisher closure requires sshCredentials in Jenkins DSL.

          Same is true for sshLabel{}.

          And no, this is not minor. When ommitted or left empty, the DSL seed job fails, but when used (with "null" parameters for its methods) it does the wrong thing, leaving a non-functional job.

          Adding to this: The publisher part has proper Job-DSL definition, like

          publishers {
            publishOverSsh {
              ...
            }
          }

          which the wrapper part lacks, hence the need to use bapSshPostBuildWrapper or a configure block there.

          Dirk Heinrichs added a comment - Same is true for sshLabel{}. And no, this is not minor. When ommitted or left empty, the DSL seed job fails, but when used (with "null" parameters for its methods) it does the wrong thing, leaving a non-functional job. Adding to this: The publisher part has proper Job-DSL definition, like publishers {   publishOverSsh {     ...   } } which the wrapper part lacks, hence the need to use bapSshPostBuildWrapper or a configure block there.

          The problem is that jenkins.plugins.publish_over_ssh.BapSshPublisher defines all parameters in a @DataBoundConstructor. Constructor parameters are deemed required by the Structs plugin, which is used to implement the DSL. If a parameter is optional, a @DataBoundSetter should be used instead.

          This needs to fixed in publish-over-ssh-plugin and publish-over-plugin.

          Daniel Spilker added a comment - The problem is that jenkins.plugins.publish_over_ssh.BapSshPublisher defines all parameters in a @DataBoundConstructor . Constructor parameters are deemed required by the Structs plugin, which is used to implement the DSL. If a parameter is optional, a @DataBoundSetter should be used instead. This needs to fixed in publish-over-ssh-plugin and publish-over-plugin .

          For your information, all publish-over-ssh component type JENKINS issues related to the Publish Over SSH plugin have been transferred to Github: https://github.com/jenkinsci/publish-over-ssh-plugin/issues

          Here is the direct link to this issue in Github: https://github.com/jenkinsci/publish-over-ssh-plugin/issues/124
          And here is the link to a search for related issues: https://github.com/jenkinsci/publish-over-ssh-plugin/issues?q=%22JENKINS-43100%22

          (Note: this is an automated bulk comment)

          Gavin McDonald added a comment - For your information, all publish-over-ssh component type JENKINS issues related to the Publish Over SSH plugin have been transferred to Github: https://github.com/jenkinsci/publish-over-ssh-plugin/issues Here is the direct link to this issue in Github: https://github.com/jenkinsci/publish-over-ssh-plugin/issues/124 And here is the link to a search for related issues: https://github.com/jenkinsci/publish-over-ssh-plugin/issues?q=%22JENKINS-43100%22 (Note: this is an automated bulk comment)

          Closing ticket, please use the corresponding Github Issue as linked above.

          Gavin McDonald added a comment - Closing ticket, please use the corresponding Github Issue as linked above.

            jamietanna Jamie Tanna
            fzbassman Eric Wallengren
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: