I've recently taken over the deploy-plugin and bundled a new version. One 
of the commits that was included in the new version added a new variable 
called path which should later be used as an additional configuration 
option to overwrite the default context path. Here's the commit:
https://github.com/jenkinsci/deploy-plugin/commit/db254d7c8c70214c7da91308c50bedb25fbf4eb8#diff-b2a541c8af2e6626b795634cc9d7143dR48

The problem is that this caused a breaking change for users using the new 
plugin with their existing freestyle jobs:
https://issues.jenkins-ci.org/browse/JENKINS-58667

The problem is that the job config is not automatically updated and the 
following builds do not have the new variable populated with the default 
value but are instead null.

Not updated config which causes the failure:
<publishers>
  <hudson.plugins.deploy.DeployPublisher plugin="[email protected]">
    <adapters>
      <hudson.plugins.deploy.tomcat.Tomcat7xAdapter>
        <credentialsId>tomcat-credentials</credentialsId>
        <url>https://tomcat.internal.com:8120</url>
      </hudson.plugins.deploy.tomcat.Tomcat7xAdapter>
    </adapters>
    <contextPath></contextPath>
    <war>target/*.war</war>
    <onFailure>false</onFailure>
  </hudson.plugins.deploy.DeployPublisher>
</publishers>

The only way to fix this seems to be to force an update of the job config 
by simply clicking Configure->Save. This updates the job config and 
everything works smoothly (see the additional path element):
<publishers>
  <hudson.plugins.deploy.DeployPublisher plugin="[email protected]">
    <adapters>
      <hudson.plugins.deploy.tomcat.Tomcat7xAdapter>
        <credentialsId>tomcat-credentials</credentialsId>
        <url>https://tomcat.internal.com:8120</url>
        <path>/manager/text</path>
      </hudson.plugins.deploy.tomcat.Tomcat7xAdapter>
    </adapters>
    <war>target/*.war</war>
    <onFailure>false</onFailure>
  </hudson.plugins.deploy.DeployPublisher>
</publishers>

So my question is: Can this sort of problem be avoided/fixed? What is the 
proposed way to introduce new plugin variables with default values without 
breaking the job builds?

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/7f0e500c-5e8d-4e30-b693-332574718656%40googlegroups.com.

Reply via email to