提交 711b3325 编写于 作者: K Kohsuke Kawaguchi

[JENKINS-24380]

- Recorded the fix in changelog.
- Added a separate screen to show the unmigration instruction, which
  makes it easier for people to find it than search logs.
上级 6f0eb9be
......@@ -55,6 +55,11 @@ Upcoming changes</a>
<!-- Record your changes in the trunk here. -->
<div id="trunk" style="display:none"><!--=TRUNK-BEGIN=-->
<ul class=image>
<li class='major rfe'>
<b><tt>JENKINS_HOME</tt> layout change</b>: builds are now keyed by build numbers and not timestamps.
See <a href="https://wiki.jenkins-ci.org/display/JENKINS/JENKINS-24380+Migration">Wiki</a> for details
and downgrade.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-24380">issue 24380</a>)
<li class=bug>
Fingerprint compaction aggravated lazy-loading performance issues.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-19392">issue 19392</a>)
......@@ -123,7 +128,7 @@ Upcoming changes</a>
<ul class=image>
<li class=bug>
Always use forward slashes in path separators during in ZIP archives generated by Directory Browser
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-22514">issue 22514</a>)
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-22514">issue 22514</a>)
</ul>
<h3><a name=v1.590>What's new in 1.590</a> (2014/11/16)</h3>
<ul class=image>
......@@ -135,7 +140,7 @@ Upcoming changes</a>
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-25400">issue 25400</a>)
<li class=bug>
Fixed various real or potential resource leaks discovered by <a href="https://scan.coverity.com/projects/94/">Coverity Scan</code>
(<a href="https://github.com/jenkinsci/jenkins/pull/1434">pull request 1434</a>)
(<a href="https://github.com/jenkinsci/jenkins/pull/1434">pull request 1434</a>)
<li class=rfe>
API changes: Expose <code>AbstractProject.AbstractProjectDescriptor#validateLabelExpression</code> for plugins.
(<a href="https://github.com/jenkinsci/jenkins/pull/1456">pull request 1456</a>)
......@@ -144,7 +149,7 @@ Upcoming changes</a>
(<a href="https://github.com/jenkinsci/jenkins/pull/1458">pull request 1458</a>)
<li class=rfe>
API method to get non-null <code>Jenkins</code> instance with internal validation
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-23339">issue 23339</a>)
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-23339">issue 23339</a>)
</ul>
<h3><a name=v1.589>What's new in 1.589</a> (2014/11/09)</h3>
<ul class=image>
......@@ -190,7 +195,7 @@ Upcoming changes</a>
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-25019">issue 25019</a>)
<li class=bug>
Existing <code>FileParameter</code>s should be handled as different values to avoid merging of queued builds
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-19017">issue 19017</a>)
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-19017">issue 19017</a>)
</ul>
<h3><a name=v1.585>What's new in 1.585</a> (2014/10/19)</h3>
<ul class=image>
......@@ -210,22 +215,22 @@ Upcoming changes</a>
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-25065">issue 25065</a>)
<li class=bug>
Greater-than characters are not escaped in HTML outputs like e-mails
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-16184">issue 16184</a>)
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-16184">issue 16184</a>)
<li class=bug>
Thread starvation from <code>OldDataMonitor</code>.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-24763">issue 24763</a>)
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-24763">issue 24763</a>)
<li class=bug>
Integer overflow in quiet-down timeout calculation
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-24914">issue 24914</a>)
Integer overflow in quiet-down timeout calculation
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-24914">issue 24914</a>)
<li class=bug>
Don't put session IDs in URLs even when cookies are disabled.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-22358">issue 22358</a>)
<li class=rfe>
Show keep build log reason in tool tips
(<a href="https://github.com/jenkinsci/jenkins/pull/1422">pull request 1422</a>)
(<a href="https://github.com/jenkinsci/jenkins/pull/1422">pull request 1422</a>)
<li class=bug>
Do not disable projects, which do not support such operation (like Matrix configurations)
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-24340">issue 24340</a>)
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-24340">issue 24340</a>)
<li class=rfe>
Improved the scalability of SSH slaves plugin caused by global lock in <tt>SecureRandom</tt>
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-20108">issue 20108</a>)
......@@ -479,7 +484,7 @@ Upcoming changes</a>
<ul class=image>
<li class="rfe">
UI redesign: Use Helvetica as default font
(<a href="https://github.com/jenkinsci/jenkins/pull/1315">pull 1315</a>,
(<a href="https://github.com/jenkinsci/jenkins/pull/1315">pull 1315</a>,
<a href="https://issues.jenkins-ci.org/browse/JENKINS-23840">issue 23840</a>)
<li class="bug">
Synchronization issue during tool installation
......@@ -622,7 +627,7 @@ Upcoming changes</a>
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-20499">issue 20499</a>)
<li class="bug">
Fixed <code>NullPointerException</code> on plugin installations when invalid update center is set
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-20031">issue 20031</a>)
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-20031">issue 20031</a>)
<li class="bug">
Use DISABLED_ANIME icon while building a disabled project
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-8358">issue 8358</a>)
......@@ -635,22 +640,22 @@ Upcoming changes</a>
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-18116">issue 18116</a>)
<li class="bug">
Properly close input streams in <code>FileParameterValue</code>
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-22693">issue 22693</a>)
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-22693">issue 22693</a>)
<li class="bug">
Incorrect failure age in the JUnit test results
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-18626">issue 18626</a>)
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-18626">issue 18626</a>)
<li class="bug">
Fixed deletion links for JVM Crash error logs
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-22617">issue 22617</a>)
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-22617">issue 22617</a>)
<li class="rfe">
Distinguish &quot;nodes for label offline&quot; from &quot;no nodes for label&quot;
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-17114">issue 17114</a>)
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-17114">issue 17114</a>)
<li class="rfe">
Add causes to queue item tool tip
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-19250">issue 19250</a>)
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-19250">issue 19250</a>)
<li class="rfe">
RPM: added JENKINS_HTTPS_KEYSTORE and JENKINS_HTTPS_KEYSTORE_PASSWORD options to Jenkins sysconfig file
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-11673">issue 11673</a>)
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-11673">issue 11673</a>)
<li class="bug">
RPM: Do not install jenkins.repo file
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-22690">issue 22690</a>)
......@@ -1000,7 +1005,7 @@ Upcoming changes</a>
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-19559">issue 19559</a>)
<li class=bug>
Fix autocompletion for items in folders.
(<a href="https://github.com/jenkinsci/jenkins/pull/1124">pull request 1124</a>)
(<a href="https://github.com/jenkinsci/jenkins/pull/1124">pull request 1124</a>)
</ul>
<h3><a name=v1.552>What's new in 1.552</a> (2014/02/24)</h3>
<ul class=image>
......@@ -1307,7 +1312,7 @@ Upcoming changes</a>
Added CLI commands that manipulate views
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-19996">issue 19996</a>)
<li class=rfe>
Improved the /cli help screen.
Improved the /cli help screen.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-20023">issue 20023</a>)
<li class=bug>
Polling-triggered jobs get scheduled en-mass on start-up if slaves aren't online yet.
......@@ -1377,7 +1382,7 @@ Upcoming changes</a>
<a href="https://issues.jenkins-ci.org/browse/JENKINS-18879">issue 18879</a>,
<a href="https://issues.jenkins-ci.org/browse/JENKINS-19619">issue 19619</a>)
<li class='major rfe'>
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
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-19945">issue 19945</a>)
<li class='major rfe'>
......@@ -1967,7 +1972,7 @@ Upcoming changes</a>
”My Views" links leads to 404 Not Found.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-17317">issue 17317</a>)
<li class=bug>
Quoting Issue with JDK Installer with Windows Installer.
Quoting Issue with JDK Installer with Windows Installer.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-5408">issue 5408</a>)
<li class=bug>
Restored compatibility in <code>ArtifactArchiver</code> signature; broken in 1.509 and could affect plugins.
......@@ -2043,7 +2048,7 @@ Upcoming changes</a>
ChangeLog should produce some output even if some (plugin) annotator fails
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-17084">issue 17084</a>)
<li class=bug>
View name should not allow "..".
View name should not allow "..".
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-16608">issue 16608</a>)
</ul>
<h3><a name=v1.508>What's new in 1.508</a> (2013/03/25)</h3>
......@@ -2075,7 +2080,7 @@ Upcoming changes</a>
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-16089">issue 16089</a>)
<li class=bug>
Wrong build result in post build steps after failed pre build step in maven projects.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-17177">issue 17177</a>)
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-17177">issue 17177</a>)
</ul>
<h3><a name=v1.506>What's new in 1.506</a> (2013/03/17)</h3>
<ul class=image>
......@@ -2264,7 +2269,7 @@ Upcoming changes</a>
<li class=bug>
Fixed NullPointerException when copying from existing Maven job
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-16499">issue 16499</a>)
</ul>
<h3><a name=v1.500>What's new in 1.500</a> (2013/01/26)</h3>
<ul class=image>
......
......@@ -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)^ <number>(\\d+)</number>(\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());
}
}
}
<!--
The MIT License
Copyright (c) 2014, CloudBees, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt">
<l:layout title="Jenkins">
<l:header />
<l:main-panel>
<p>
To reverse the effect of <a href="http://jenkins-ci.org/issue/24380">JENKINS-24380</a> fix, run the following command
on the server. See <a href="https://wiki.jenkins-ci.org/display/JENKINS/JENKINS-24380+Migration">Wiki page</a>
for more details:
</p>
<table style="width:100%">
<tr>
<td style="line-height:2em; width:80%">
<input type="text" value="${it.command}" style="width:100%"/>
</td>
<td style="line-height:2em">
<l:copyButton message="${%Copied}" text="${it.command}"/>
</td>
</tr>
</table>
</l:main-panel>
</l:layout>
</j:jelly>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册