diff --git a/changelog.html b/changelog.html
index 62718805e90c0bf0c17acf8a07d6d27cabb7bb20..824da3ec755928401a81507d9894a03552ffa3d1 100644
--- a/changelog.html
+++ b/changelog.html
@@ -55,6 +55,11 @@ Upcoming changes
+ -
+ JENKINS_HOME layout change: builds are now keyed by build numbers and not timestamps.
+ See Wiki for details
+ and downgrade.
+ (issue 24380)
-
Fingerprint compaction aggravated lazy-loading performance issues.
(issue 19392)
@@ -123,7 +128,7 @@ Upcoming changes
-
Always use forward slashes in path separators during in ZIP archives generated by Directory Browser
- (issue 22514)
+ (issue 22514)
@@ -190,7 +195,7 @@ Upcoming changes
(issue 25019)
-
Existing
FileParameter
s should be handled as different values to avoid merging of queued builds
- (issue 19017)
+ (issue 19017)
@@ -210,22 +215,22 @@ Upcoming changes
(issue 25065)
-
Greater-than characters are not escaped in HTML outputs like e-mails
- (issue 16184)
+ (issue 16184)
-
Thread starvation from
OldDataMonitor
.
- (issue 24763)
+ (issue 24763)
-
- Integer overflow in quiet-down timeout calculation
- (issue 24914)
+ Integer overflow in quiet-down timeout calculation
+ (issue 24914)
-
Don't put session IDs in URLs even when cookies are disabled.
(issue 22358)
-
Show keep build log reason in tool tips
- (pull request 1422)
+ (pull request 1422)
-
Do not disable projects, which do not support such operation (like Matrix configurations)
- (issue 24340)
+ (issue 24340)
-
Improved the scalability of SSH slaves plugin caused by global lock in SecureRandom
(issue 20108)
@@ -479,7 +484,7 @@ Upcoming changes
@@ -1307,7 +1312,7 @@ Upcoming changes
Added CLI commands that manipulate views
(issue 19996)
-
- Improved the /cli help screen.
+ Improved the /cli help screen.
(issue 20023)
-
Polling-triggered jobs get scheduled en-mass on start-up if slaves aren't online yet.
@@ -1377,7 +1382,7 @@ Upcoming changes
issue 18879,
issue 19619)
-
- Upgrade bundled iplugin versions: ssh-slaves to 1.4, ssh-credentials to 1.5.3 and
+ Upgrade bundled iplugin versions: ssh-slaves to 1.4, ssh-credentials to 1.5.3 and
credentials to 1.8.3
(issue 19945)
-
@@ -1967,7 +1972,7 @@ Upcoming changes
”My Views" links leads to 404 Not Found.
(issue 17317)
-
- Quoting Issue with JDK Installer with Windows Installer.
+ Quoting Issue with JDK Installer with Windows Installer.
(issue 5408)
-
Restored compatibility in
ArtifactArchiver
signature; broken in 1.509 and could affect plugins.
@@ -2043,7 +2048,7 @@ Upcoming changes
ChangeLog should produce some output even if some (plugin) annotator fails
(issue 17084)
-
- View name should not allow "..".
+ View name should not allow "..".
(issue 16608)
@@ -2075,7 +2080,7 @@ Upcoming changes
(issue 16089)
-
Wrong build result in post build steps after failed pre build step in maven projects.
- (issue 17177)
+ (issue 17177)
@@ -2264,7 +2269,7 @@ Upcoming changes
-
Fixed NullPointerException when copying from existing Maven job
(issue 16499)
-
+
diff --git a/core/src/main/java/jenkins/model/RunIdMigrator.java b/core/src/main/java/jenkins/model/RunIdMigrator.java
index 61fe4c48ae4c317eb5acf2017c59b004e9129219..4097fdea0f9f763bbd9cd44959c8371b72adbb5d 100644
--- a/core/src/main/java/jenkins/model/RunIdMigrator.java
+++ b/core/src/main/java/jenkins/model/RunIdMigrator.java
@@ -24,8 +24,10 @@
package jenkins.model;
+import hudson.Extension;
import hudson.Util;
import hudson.model.Job;
+import hudson.model.RootAction;
import hudson.model.Run;
import hudson.util.AtomicFileWriter;
import hudson.util.StreamTaskListener;
@@ -58,6 +60,8 @@ import org.apache.commons.lang.time.FastDateFormat;
import org.apache.tools.ant.BuildException;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
+import org.kohsuke.stapler.HttpResponse;
+import org.kohsuke.stapler.StaplerProxy;
import org.kohsuke.stapler.framework.io.WriterOutputStream;
import static java.util.logging.Level.*;
@@ -158,26 +162,29 @@ public final class RunIdMigrator {
LOGGER.log(INFO, "Migrating build records in {0}", dir);
doMigrate(dir);
save(dir);
- if (jenkinsHome != null && offeredToUnmigrate.add(jenkinsHome)) {
- StringBuilder cp = new StringBuilder();
- for (Class> c : new Class>[] {RunIdMigrator.class, /* TODO how to calculate transitive dependencies automatically? */Charsets.class, WriterOutputStream.class, BuildException.class, FastDateFormat.class}) {
- URL location = c.getProtectionDomain().getCodeSource().getLocation();
- String locationS = location.toString();
- if (location.getProtocol().equals("file")) {
- try {
- locationS = new File(location.toURI()).getAbsolutePath();
- } catch (URISyntaxException x) {
- // never mind
- }
- }
- if (cp.length() > 0) {
- cp.append(File.pathSeparator);
+ if (jenkinsHome != null && offeredToUnmigrate.add(jenkinsHome))
+ LOGGER.log(WARNING, "Build record migration is one-way. If you need to downgrade Jenkins, run: {0}", getUnmigrationCommandLine(jenkinsHome));
+ return true;
+ }
+
+ private static String getUnmigrationCommandLine(File jenkinsHome) {
+ StringBuilder cp = new StringBuilder();
+ for (Class> c : new Class>[] {RunIdMigrator.class, /* TODO how to calculate transitive dependencies automatically? */Charsets.class, WriterOutputStream.class, BuildException.class, FastDateFormat.class}) {
+ URL location = c.getProtectionDomain().getCodeSource().getLocation();
+ String locationS = location.toString();
+ if (location.getProtocol().equals("file")) {
+ try {
+ locationS = new File(location.toURI()).getAbsolutePath();
+ } catch (URISyntaxException x) {
+ // never mind
}
- cp.append(locationS);
}
- LOGGER.log(WARNING, "Build record migration is one-way. If you need to downgrade Jenkins, run: java -classpath {0} {1} \"{2}\"", new Object[] {cp, RunIdMigrator.class.getName(), jenkinsHome});
+ if (cp.length() > 0) {
+ cp.append(File.pathSeparator);
+ }
+ cp.append(locationS);
}
- return true;
+ return String.format("java -classpath \"%s\" %s \"%s\"", cp, RunIdMigrator.class.getName(), jenkinsHome);
}
private static final Pattern NUMBER_ELT = Pattern.compile("(?m)^ (\\d+)(\r?\n)");
@@ -367,4 +374,34 @@ public final class RunIdMigrator {
System.err.println(builds + " has been restored to its original format");
}
+ /**
+ * Expose unmigration instruction to the user.
+ */
+ @Extension
+ public static class UnmigrationInstruction implements RootAction, StaplerProxy {
+ @Override
+ public String getIconFileName() {
+ return null;
+ }
+
+ @Override
+ public String getDisplayName() {
+ return null;
+ }
+
+ @Override
+ public String getUrlName() {
+ return "JENKINS-24380";
+ }
+
+ @Override
+ public Object getTarget() {
+ Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER);
+ return this;
+ }
+
+ public String getCommand() {
+ return RunIdMigrator.getUnmigrationCommandLine(Jenkins.getInstance().getRootDir());
+ }
+ }
}
diff --git a/core/src/main/resources/jenkins/model/RunIdMigrator/UnmigrationInstruction/index.jelly b/core/src/main/resources/jenkins/model/RunIdMigrator/UnmigrationInstruction/index.jelly
new file mode 100644
index 0000000000000000000000000000000000000000..6385169b5dee33b39c778ca14c1769234d5040e9
--- /dev/null
+++ b/core/src/main/resources/jenkins/model/RunIdMigrator/UnmigrationInstruction/index.jelly
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+ To reverse the effect of JENKINS-24380 fix, run the following command
+ on the server. See Wiki page
+ for more details:
+
+
+
+
+