| Background: We're using the Custom Tools Plugin to define misc custom tools in our Jenkins environment. Typically we use "Install automatically" and use the "Extract .zip/.tar.gz" installer to download the tool archive. The archive is typically hosted in our Nexus instance and we specify the exact version, like this: http://nexus.acme.org/content/repositories/releases/org/acme/jenkins/nifty-tool/1.0.0/nifty-tool-1.0.0.tar.gz (In this example we're pointing at a Maven artifact, but it could be any URL.) When there is a new version of the tool we just update the ULR and Jenkins will update automatically. Problem: The problem is when we want to downgrade to an earlier version. For example, we have http://nexus.acme.org/content/repositories/releases/org/acme/jenkins/nifty-tool/1.0.1/nifty-tool-1.0.1.tar.gz but want to change back to the old http://nexus.acme.org/content/repositories/releases/org/acme/jenkins/nifty-tool/1.0.0/nifty-tool-1.0.0.tar.gz In this case the older version is not automatically installed, but we need to manually go in on every slave and remove the .timestamp file to force a downgrade. Suggested Improvement: The current behavior where only a newer archive is doenloaded and installed is suitable when the URL doesn't change but one just updates the archive (overwriting the old file). But if the URL changes, the archive should be installed regardless of the timestamp. A different URL should always indicate a different archive. The change should be done in hudson.tool.FilePath.installIfNecessaryFrom(). The current javadoc says that if the timestamp of the archive doesn't match the local timestamp it is re-extracted, which is not fully correct. JENKINS-16215 changed this behavior so that the local timestamp value is use as if-modified-since header on the UrlConnection. So a downgrade to an earlier/older archive from an Http URL will never happen. A possible impl solution is to store the URL in the timestamp file and use that to check if the URL has changed. If it has, always re-extract regardless of the local timestamp. |