提交 cd6c00f9 编写于 作者: D Daniel Beck

Merge tag 'jenkins-1.652' of github.com:jenkinsci/jenkins into 2.0

[maven-release-plugin] copy for tag jenkins-1.652

Conflicts:
	cli/pom.xml
	core/pom.xml
	core/src/main/resources/lib/form/checkbox.jelly
	pom.xml
	test/pom.xml
	war/pom.xml
......@@ -54,12 +54,21 @@ Upcoming changes</a>
<!-- Record your changes in the trunk here. -->
<div id="trunk" style="display:none"><!--=TRUNK-BEGIN=-->
<ul class=image>
<li class="bug">
Under some conditions Jenkins startup could fail because of incorrectly linked extensions; now recovering more gracefully.
(<a href-"https://issues.jenkins-ci.org/browse/JENKINS-25440">issue 25440</a>)
</ul>
</div><!--=TRUNK-END=-->
<h3><a name=v1.651>What's new in 1.651</a> (2016/02/28)</h3>
<ul class=image>
<li class="rfe">
Move periodic task log files from <code>JENKINS_HOME/*.log</code> to <code>JENKINS_HOME/logs/tasks/*.log</code> and rotate them periodically rather than overwrite every execution
Move periodic task log files from <code>JENKINS_HOME/*.log</code> to <code>JENKINS_HOME/logs/tasks/*.log</code> and rotate them periodically rather than overwrite every execution.
(<a href-"https://issues.jenkins-ci.org/browse/JENKINS-33068">issue 33068</a>)
<li class="bug">
Fix documentation of proxy configuration.
(<a href="https://github.com/jenkinsci/jenkins/pull/2060">pull 2060</a>)
</ul>
</div><!--=TRUNK-END=-->
<h3><a name=v1.650>What's new in 1.650</a> (2016/02/24)</h3>
<ul class=image>
<li class="major bug">
......
......@@ -39,7 +39,7 @@ THE SOFTWARE.
<properties>
<staplerFork>true</staplerFork>
<stapler.version>1.239</stapler.version>
<stapler.version>1.240</stapler.version>
<spring.version>2.5.6.SEC03</spring.version>
<groovy.version>1.8.9</groovy.version>
</properties>
......
......@@ -282,7 +282,6 @@ public abstract class ExtensionFinder implements ExtensionPoint {
LOGGER.log(Level.SEVERE, "Failed to create Guice container from all the plugins",e);
// failing to load all bindings are disastrous, so recover by creating minimum that works
// by just including the core
// TODO this recovery is pretty much useless; startup crashes anyway
container = Guice.createInjector(new SezpozModule(loadSezpozIndices(Jenkins.class.getClassLoader())));
}
......@@ -479,7 +478,11 @@ public abstract class ExtensionFinder implements ExtensionPoint {
m.invoke(ecl, c);
c.getConstructors();
c.getMethods();
c.getFields();
for (Field f : c.getFields()) {
if (f.getAnnotation(javax.inject.Inject.class) != null || f.getAnnotation(com.google.inject.Inject.class) != null) {
resolve(f.getType());
}
}
LOGGER.log(Level.FINER, "{0} looks OK", c);
while (c != Object.class) {
c.getGenericSuperclass();
......
......@@ -27,6 +27,7 @@ import hudson.Extension;
import hudson.ExtensionList;
import hudson.FilePath;
import hudson.Util;
import hudson.slaves.WorkspaceList;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
......@@ -89,6 +90,7 @@ public class WorkspaceCleanupThread extends AsyncPeriodicWork {
listener.getLogger().println("Deleting " + ws + " on " + node.getDisplayName());
try {
ws.deleteRecursive();
WorkspaceList.tempDir(ws).deleteRecursive();
} catch (IOException x) {
x.printStackTrace(listener.error("Failed to delete " + ws + " on " + node.getDisplayName()));
} catch (InterruptedException x) {
......
......@@ -26,6 +26,7 @@ package hudson.slaves;
import hudson.FilePath;
import hudson.Functions;
import hudson.model.Computer;
import hudson.model.DirectoryBrowserSupport;
import java.io.Closeable;
import java.util.Date;
......@@ -283,6 +284,25 @@ public final class WorkspaceList {
};
}
/**
* Locates a conventional temporary directory to be associated with a workspace.
* <p>This directory is suitable for temporary files to be deleted later in the course of a build,
* or caches and local repositories which should persist across builds done in the same workspace.
* (If multiple workspaces are present for a single job built concurrently, via {@link #allocate(FilePath)}, each will get its own temporary directory.)
* <p>It may also be used for security-sensitive files which {@link DirectoryBrowserSupport} ought not serve,
* acknowledging that these will be readable by builds of other jobs done on the same node.
* <p>Each plugin using this directory is responsible for specifying sufficiently unique subdirectory/file names.
* {@link FilePath#createTempFile} may be used for this purpose if desired.
* <p>The resulting directory may not exist; you may call {@link FilePath#mkdirs} on it if you need it to.
* It may be deleted alongside the workspace itself during cleanup actions.
* @param ws a directory such as a build workspace
* @return a sibling directory, for example {@code …/something@tmp} for {@code …/something}
* @since 1.652
*/
public static FilePath tempDir(FilePath ws) {
return ws.sibling(ws.getName() + COMBINATOR + "tmp");
}
private static final Logger LOGGER = Logger.getLogger(WorkspaceList.class.getName());
/**
......
......@@ -44,6 +44,9 @@ THE SOFTWARE.
<st:attribute name="onclick" />
<st:attribute name="class" />
<st:attribute name="negative" />
<st:attribute name="readonly">
If set to true, this will take precedence over the onclick attribute and prevent the state of the checkbox from being changed.
</st:attribute>
<st:attribute name="field">
Used for databinding. TBD.
</st:attribute>
......@@ -63,7 +66,7 @@ THE SOFTWARE.
name="${name}"
value="${attrs.value}"
title="${attrs.tooltip}"
onclick="${attrs.onclick}" id="${attrs.id}" class="${attrs.class} ${attrs.negative!=null ? 'negative' : null} ${attrs.checkUrl!=null?'validated':''}"
onclick="${attrs.readonly=='true' ? 'return false;' : attrs.onclick}" id="${attrs.id}" class="${attrs.class} ${attrs.negative!=null ? 'negative' : null} ${attrs.checkUrl!=null?'validated':''}"
checkUrl="${attrs.checkUrl}" checkDependsOn="${attrs.checkDependsOn}" json="${attrs.json}"
checked="${value ? 'true' : null}"/>
<j:if test="${attrs.title!=null}">
......
......@@ -58,7 +58,7 @@ THE SOFTWARE.
<connection>scm:git:git://github.com/jenkinsci/jenkins.git</connection>
<developerConnection>scm:git:ssh://git@github.com/jenkinsci/jenkins.git</developerConnection>
<url>https://github.com/jenkinsci/jenkins</url>
<tag>HEAD</tag>
<tag>jenkins-1.652</tag>
</scm>
<distributionManagement>
......
......@@ -65,6 +65,12 @@ THE SOFTWARE.
<artifactId>jenkins-test-harness</artifactId>
<version>2.5</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>${project.groupId}</groupId>
<artifactId>jenkins-war</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
......
......@@ -31,6 +31,7 @@ import com.gargoylesoftware.htmlunit.html.HtmlPage;
import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.JenkinsRule;
import org.jvnet.hudson.test.JenkinsRule.WebClient;
import java.util.List;
......@@ -47,11 +48,15 @@ public class ManagementLinkTest {
*/
@Test
public void links() throws Exception {
HtmlPage page = j.createWebClient().goTo("manage");
List<?> anchors = DomNodeUtil.selectNodes(page, "id('management-links')//*[@class='link']/a[not(@onclick)]");
assertTrue(anchors.size()>=8);
for(HtmlAnchor e : (List<HtmlAnchor>) anchors) {
e.click();
WebClient wc = j.createWebClient();
for (int i=0; ; i++) {
HtmlPage page = wc.goTo("manage");
List<?> anchors = DomNodeUtil.selectNodes(page, "id('management-links')//*[@class='link']/a[not(@onclick)]");
assertTrue(anchors.size()>=8);
if (i==anchors.size()) return; // done
((HtmlAnchor)anchors.get(i)).click();
}
}
}
......@@ -28,6 +28,7 @@ import hudson.FilePath;
import hudson.remoting.VirtualChannel;
import hudson.scm.NullSCM;
import hudson.slaves.DumbSlave;
import hudson.slaves.WorkspaceList;
import hudson.util.StreamTaskListener;
import java.io.File;
......@@ -180,6 +181,19 @@ public class WorkspaceCleanupThreadTest {
assertFalse(ws.exists());
}
@Issue("JENKINS-27152")
@Test
public void deleteTemporaryDirectory() throws Exception {
FreeStyleProject p = r.createFreeStyleProject();
FilePath ws = createOldWorkspaceOn(r.jenkins, p);
FilePath tmp = WorkspaceList.tempDir(ws);
tmp.child("stuff").write("content", null);
createOldWorkspaceOn(r.createOnlineSlave(), p);
performCleanup();
assertFalse(ws.exists());
assertFalse("temporary directory should be cleaned up as well", tmp.exists());
}
private FilePath createOldWorkspaceOn(Node slave, FreeStyleProject p) throws Exception {
p.setAssignedNode(slave);
FreeStyleBuild b1 = r.assertBuildStatusSuccess(p.scheduleBuild2(0));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册