提交 6e6ca263 编写于 作者: J Jesse Glick

Merge branch 'master' into BuildStep-Job

......@@ -54,6 +54,14 @@ Upcoming changes</a>
<!-- Record your changes in the trunk here. -->
<div id="trunk" style="display:none"><!--=TRUNK-BEGIN=-->
<ul class=image>
<li class=>
</ul>
</div><!--=TRUNK-END=-->
<!-- these changes are controlled by the release process. DO NOT MODIFY -->
<div id="rc" style="display:none;"><!--=BEGIN=-->
<h3><a name=v1.576>What's new in 1.576</a> <!--=DATE=--></h3>
<ul class=image>
<li class="bug">
Worked around "incompatible InnerClasses attribute" bug in IBM J9 VM
......@@ -76,6 +84,9 @@ Upcoming changes</a>
<li class="rfe">
Added support for host:port format in X-Forwarded-Host header.
(<a href="https://github.com/jenkinsci/jenkins/commit/19d8b80bb2f33e4877c7170bcca8bfa318ebe77d">commit 19d8b80</a>)
<li class="rfe">
API to launch processes without printing the command line.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-23027">issue 23027</a>)
<li class="rfe">
Added option to increase impact of test failures on the weather report.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-24006">issue 24006</a>)
......@@ -90,11 +101,8 @@ Upcoming changes</a>
Modernize tabBar and bigtable. Makes the project view look better. Same for Plugin Manager.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-24030">issue 24030</a>)
</ul>
</div><!--=TRUNK-END=-->
<!-- these changes are controlled by the release process. DO NOT MODIFY -->
<div id="rc" style="display:none;"><!--=BEGIN=-->
<h3><a name=v1.575>What's new in 1.575</a> <!--=DATE=--></h3>
</div><!--=END=-->
<h3><a name=v1.575>What's new in 1.575</a> (2014/08/10)</h3>
<ul class=image>
<li class="rfe">
Move option to fingerprint artifacts to Archive the Artifacts, Advanced options.
......@@ -139,7 +147,6 @@ Upcoming changes</a>
Restrict access to SCM trigger status page to administrators.
(<a href="https://github.com/jenkinsci/jenkins/pull/1327">pull 1282</a>)
</ul>
</div><!--=END=-->
<h3><a name=v1.574>What's new in 1.574</a> (2014/07/27)</h3>
<ul class=image>
<li class="rfe">
......
......@@ -5,7 +5,7 @@
<parent>
<artifactId>pom</artifactId>
<groupId>org.jenkins-ci.main</groupId>
<version>1.576-SNAPSHOT</version>
<version>1.577-SNAPSHOT</version>
</parent>
<artifactId>cli</artifactId>
......
......@@ -28,7 +28,7 @@ public class ConnectionTest extends Assert {
}
@Test
public void testEncyrpt() throws Throwable {
public void testEncrypt() throws Throwable {
final SecretKey sessionKey = new SecretKeySpec(new byte[16],"AES");
Thread t1 = new Thread() {
......
......@@ -29,7 +29,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>pom</artifactId>
<version>1.576-SNAPSHOT</version>
<version>1.577-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
......@@ -51,7 +51,7 @@ THE SOFTWARE.
<dependency>
<groupId>org.jenkins-ci.plugins.icon-shim</groupId>
<artifactId>icon-set</artifactId>
<version>1.0.2</version>
<version>1.0.3</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
......
......@@ -146,6 +146,7 @@ public abstract class Launcher {
public final class ProcStarter {
protected List<String> commands;
protected boolean[] masks;
private boolean quiet;
protected FilePath pwd;
protected OutputStream stdout = NULL_OUTPUT_STREAM, stderr;
protected InputStream stdin = NULL_INPUT_STREAM;
......@@ -212,6 +213,25 @@ public abstract class Launcher {
return masks;
}
/**
* Allows {@link #maskedPrintCommandLine(List, boolean[], FilePath)} to be suppressed from {@link hudson.Launcher.LocalLauncher#launch(hudson.Launcher.ProcStarter)}.
* Useful when the actual command being printed is noisy and unreadable and the caller would rather print diagnostic information in a customized way.
* @param quiet to suppress printing the command line when starting the process; false to keep default behavior of printing
* @return this
* @since 1.576
*/
public ProcStarter quiet(boolean quiet) {
this.quiet = quiet;
return this;
}
/**
* @since 1.576
*/
public boolean quiet() {
return quiet;
}
public ProcStarter pwd(FilePath workDir) {
this.pwd = workDir;
return this;
......@@ -371,7 +391,7 @@ public abstract class Launcher {
* Copies a {@link ProcStarter}.
*/
public ProcStarter copy() {
ProcStarter rhs = new ProcStarter().cmds(commands).pwd(pwd).masks(masks).stdin(stdin).stdout(stdout).stderr(stderr).envs(envs);
ProcStarter rhs = new ProcStarter().cmds(commands).pwd(pwd).masks(masks).stdin(stdin).stdout(stdout).stderr(stderr).envs(envs).quiet(quiet);
rhs.reverseStdin = this.reverseStdin;
rhs.reverseStderr = this.reverseStderr;
rhs.reverseStdout = this.reverseStdout;
......@@ -768,7 +788,9 @@ public abstract class Launcher {
@Override
public Proc launch(ProcStarter ps) throws IOException {
maskedPrintCommandLine(ps.commands, ps.masks, ps.pwd);
if (!ps.quiet) {
maskedPrintCommandLine(ps.commands, ps.masks, ps.pwd);
}
EnvVars jobEnv = inherit(ps.envs);
......@@ -890,7 +912,7 @@ public abstract class Launcher {
final String workDir = ps.pwd==null ? null : ps.pwd.getRemote();
try {
return new ProcImpl(getChannel().call(new RemoteLaunchCallable(ps.commands, ps.masks, ps.envs, in, ps.reverseStdin, out, ps.reverseStdout, err, ps.reverseStderr, workDir, listener)));
return new ProcImpl(getChannel().call(new RemoteLaunchCallable(ps.commands, ps.masks, ps.envs, in, ps.reverseStdin, out, ps.reverseStdout, err, ps.reverseStderr, ps.quiet, workDir, listener)));
} catch (InterruptedException e) {
throw (IOException)new InterruptedIOException().initCause(e);
}
......@@ -1085,8 +1107,9 @@ public abstract class Launcher {
private final String workDir;
private final TaskListener listener;
private final boolean reverseStdin, reverseStdout, reverseStderr;
private final boolean quiet;
RemoteLaunchCallable(List<String> cmd, boolean[] masks, String[] env, InputStream in, boolean reverseStdin, OutputStream out, boolean reverseStdout, OutputStream err, boolean reverseStderr, String workDir, TaskListener listener) {
RemoteLaunchCallable(List<String> cmd, boolean[] masks, String[] env, InputStream in, boolean reverseStdin, OutputStream out, boolean reverseStdout, OutputStream err, boolean reverseStderr, boolean quiet, String workDir, TaskListener listener) {
this.cmd = new ArrayList<String>(cmd);
this.masks = masks;
this.env = env;
......@@ -1098,11 +1121,12 @@ public abstract class Launcher {
this.reverseStdin = reverseStdin;
this.reverseStdout = reverseStdout;
this.reverseStderr = reverseStderr;
this.quiet = quiet;
}
public RemoteProcess call() throws IOException {
Launcher.ProcStarter ps = new LocalLauncher(listener).launch();
ps.cmds(cmd).masks(masks).envs(env).stdin(in).stdout(out).stderr(err);
ps.cmds(cmd).masks(masks).envs(env).stdin(in).stdout(out).stderr(err).quiet(quiet);
if(workDir!=null) ps.pwd(workDir);
if (reverseStdin) ps.writeStdin();
if (reverseStdout) ps.readStdout();
......
......@@ -217,8 +217,9 @@ public final class RunMap<R extends Run<?,R>> extends AbstractLazyLoadRunMap<R>
try {
R b = cons.create(d);
b.onLoad();
if (LOGGER.isLoggable(FINEST))
LOGGER.log(FINEST,"Loaded " + b.getFullDisplayName(),new ThisIsHowItsLoaded());
if (LOGGER.isLoggable(FINEST)) {
LOGGER.log(FINEST, "Loaded " + b.getFullDisplayName() + " in " + Thread.currentThread().getName(), new ThisIsHowItsLoaded());
}
return b;
} catch (Run.InvalidDirectoryNameException x) {
Level lvl;
......
......@@ -340,6 +340,9 @@ public class ArtifactArchiver extends Recorder implements SimpleBuildStep {
if (aa != null) {
aa.setFingerprint(true);
}
if (f.getTargets().isEmpty()) { // no other reason to be here
p.getPublishersList().remove(f);
}
p.save();
}
} catch (IOException x) {
......
......@@ -35,7 +35,8 @@ THE SOFTWARE.
<table style="margin-top: 1em; margin-left:1em;">
<j:forEach var="act" items="${it.prominentActions}">
<t:summary icon="${act.iconFileName}" href="${act.urlName}">
<j:set var="icon" value="${act.iconClassName != null ? act.iconClassName : act.iconFileName}"/>
<t:summary icon="${icon}" href="${act.urlName}">
${act.displayName}
</t:summary>
</j:forEach>
......
......@@ -84,8 +84,9 @@ THE SOFTWARE.
<table style="padding-left: 2em;" id="management-links">
<j:forEach var="m" items="${it.managementLinks}">
<l:hasPermission permission="${m.requiredPermission}">
<j:if test="${m.iconFileName!=null}">
<local:feature icon="${m.iconFileName}" href="${m.urlName}" title="${m.displayName}" requiresConfirmation="${m.requiresConfirmation}">
<j:set var="icon" value="${m.iconClassName != null ? m.iconClassName : m.iconFileName}"/>
<j:if test="${icon!=null}">
<local:feature icon="${icon}" href="${m.urlName}" title="${m.displayName}" requiresConfirmation="${m.requiresConfirmation}">
<j:out value="${m.description}"/>
<st:include it="${m}" page="info.jelly" optional="true"/>
</local:feature>
......
......@@ -37,8 +37,9 @@ THE SOFTWARE.
the action object itself is available in the 'action' variable
-->
<st:include page="action.jelly" from="${action}" optional="true">
<j:if test="${action.iconFileName!=null}">
<l:task icon="${h.getIconFilePath(action)}" title="${action.displayName}"
<j:set var="icon" value="${action.iconClassName != null ? action.iconClassName + ' icon-md' : action.iconFileName}"/>
<j:if test="${icon!=null}">
<l:task icon="${icon}" title="${action.displayName}"
href="${h.getActionUrl(it.url,action)}" contextMenu="${h.isContextMenuVisible(action)}"/>
</j:if>
</st:include>
......
......@@ -34,8 +34,39 @@ THE SOFTWARE.
</st:documentation>
<td data="${it.ordinal()}">
<j:if test="${attrs.it!=null}">
<l:icon class="${it.iconClassName} ${iconSizeClass}" alt="${it.description}"
tooltip="${it.description}" style="${attrs.style}" />
<j:set var="iconClassName" value="${it.iconClassName}"/>
<j:if test="${iconClassName == null}">
<j:set var="iconClassName" value="${icons.toNormalizedIconNameClass(it.image)}"/>
</j:if>
<j:choose>
<j:when test="${iconClassName != null}">
<l:icon class="${iconClassName} ${iconSizeClass}" alt="${it.description}"
tooltip="${it.description}" style="${attrs.style}" />
</j:when>
<j:otherwise>
<!-- "it" is not a hudson.model.BallColor. Let's try figure out the icon from its URL. -->
<j:set var="iconUrl" value="${it.getImageOf(iconSize)}"/>
<j:if test="${iconUrl.startsWith(imagesURL)}">
<!-- Normalize the icon URL -->
<j:set var="iconUrl" value="${iconUrl.substring(imagesURL.length() + 1)}"/>
</j:if>
<!-- See if we can get an Icon def from the URL -->
<j:set var="icon" value="${icons.getIconByUrl(iconUrl)}"/>
<j:choose>
<j:when test="${icon != null}">
<!-- We found the Icon def -->
<l:icon class="${icon.classSpec}" alt="${it.description}" tooltip="${it.description}" style="${attrs.style}" />
</j:when>
<j:otherwise>
<!-- We don't seem to have this icon in the IconSet... fallback again... -->
<j:set var="iconUrl" value="${it.getImageOf(iconSize)}"/>
<l:icon src="${iconUrl}" alt="${it.description}" tooltip="${it.description}" style="${attrs.style}" />
</j:otherwise>
</j:choose>
</j:otherwise>
</j:choose>
</j:if>
</td>
</j:jelly>
......@@ -58,7 +58,11 @@ THE SOFTWARE.
that, we try deriving it by URL (assuming it's a full icon path). If all that fails,
we just fall back to the old method by passing a 'src' attribute to the <icon> tag.
-->
<j:set var="iconMetadata" value="${icons.getIconByClassSpec(icons.toNormalizedIconNameClass(icon) + ' icon-xlg')}"/>
<j:set var="iconMetadata" value="${icons.getIconByClassSpec(icon + ' icon-xlg')}"/>
<j:if test="${iconMetadata == null}">
<!-- Icon could be provided as a simple iconFileName e.g. "settings.png" -->
<j:set var="iconMetadata" value="${icons.getIconByClassSpec(icons.toNormalizedIconNameClass(icon) + ' icon-xlg')}"/>
</j:if>
<j:if test="${iconMetadata == null}">
<j:set var="iconMetadata" value="${icons.getIconByUrl(icon)}"/>
</j:if>
......@@ -71,7 +75,8 @@ THE SOFTWARE.
<l:icon class="${iconMetadata.classSpec}"/>
</j:when>
<j:otherwise>
<l:icon width="24" height="24" style="margin: 2px;" alt="" src="${icon}"/>
<l:icon src="${icon.startsWith('/') ? resURL+icon : imagesURL+'/48x48/'+icon}"
alt="" style="width: 48px; height: 48px; margin-right:1em;" />
</j:otherwise>
</j:choose>
</a>
......@@ -83,7 +88,7 @@ THE SOFTWARE.
</j:when>
<j:otherwise>
<l:icon src="${icon.startsWith('/') ? resURL+icon : imagesURL+'/48x48/'+icon}"
alt="" width="48" height="48" style="margin-right:1em" />
alt="" style="width: 48px; height: 48px; margin-right:1em;" />
</j:otherwise>
</j:choose>
</j:otherwise>
......
......@@ -105,7 +105,12 @@ THE SOFTWARE.
-->
<j:set var="iconMetadata" value="${icons.getIconByClassSpec(attrs.icon)}"/>
<j:if test="${iconMetadata == null}">
<j:set var="iconMetadata" value="${icons.getIconByUrl(icon)}"/>
<!-- Icon could be provided as a simple iconFileName e.g. "settings.png" -->
<j:set var="iconMetadata" value="${icons.getIconByClassSpec(icons.toNormalizedIconNameClass(attrs.icon) + ' icon-md')}"/>
</j:if>
<j:if test="${iconMetadata == null}">
<!-- Icon could be provided as an absolute iconFileName e.g. "/plugin/foo/abc.png" -->
<j:set var="iconMetadata" value="${icons.getIconByUrl(attrs.icon)}"/>
</j:if>
<j:set var="icon" value="${rootURL}${icon.startsWith('images/') || icon.startsWith('plugin/') ? h.resourcePath : ''}/${icon}"/>
......
jenkins (1.575) unstable; urgency=low
* See http://jenkins-ci.org/changelog for more details.
-- Kohsuke Kawaguchi <kk@kohsuke.org> Sun, 10 Aug 2014 09:39:14 -0700
jenkins (1.574) unstable; urgency=low
* See http://jenkins-ci.org/changelog for more details.
......
......@@ -11,7 +11,7 @@
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<name>Jenkins plugin POM</name>
<version>1.576-SNAPSHOT</version>
<version>1.577-SNAPSHOT</version>
<packaging>pom</packaging>
<!--
......@@ -39,19 +39,19 @@
<groupId>org.jenkins-ci.main</groupId>
<artifactId>jenkins-war</artifactId>
<type>war</type>
<version>1.576-SNAPSHOT</version>
<version>1.577-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>jenkins-core</artifactId>
<version>1.576-SNAPSHOT</version>
<version>1.577-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>jenkins-test-harness</artifactId>
<version>1.576-SNAPSHOT</version>
<version>1.577-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<!--
......
......@@ -33,7 +33,7 @@ THE SOFTWARE.
<groupId>org.jenkins-ci.main</groupId>
<artifactId>pom</artifactId>
<version>1.576-SNAPSHOT</version>
<version>1.577-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Jenkins main module</name>
......
......@@ -29,7 +29,7 @@ THE SOFTWARE.
<parent>
<artifactId>pom</artifactId>
<groupId>org.jenkins-ci.main</groupId>
<version>1.576-SNAPSHOT</version>
<version>1.577-SNAPSHOT</version>
</parent>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>jenkins-test-harness</artifactId>
......@@ -43,7 +43,7 @@ THE SOFTWARE.
<concurrency>2</concurrency> <!-- may use e.g. 2C for 2 × (number of cores) -->
<mavenDebug>false</mavenDebug>
<ignore.random.failures>false</ignore.random.failures>
<jacocoSurefireArgs></jacocoSurefireArgs><!-- empty by default -->
<jacocoSurefireArgs /><!-- empty by default -->
</properties>
<dependencies>
......
......@@ -23,24 +23,28 @@
*/
package hudson;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import hudson.model.AbstractBuild;
import hudson.model.AbstractProject;
import hudson.model.FreeStyleBuild;
import hudson.model.FreeStyleProject;
import hudson.model.Node;
import hudson.model.ParametersDefinitionProperty;
import hudson.model.Slave;
import hudson.model.StringParameterDefinition;
import hudson.model.TaskListener;
import hudson.tasks.BatchFile;
import hudson.tasks.BuildStepDescriptor;
import hudson.tasks.Builder;
import hudson.tasks.CommandInterpreter;
import hudson.tasks.Shell;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.Bug;
import org.jvnet.hudson.test.Issue;
import org.jvnet.hudson.test.JenkinsRule;
public class LauncherTest {
......@@ -48,7 +52,7 @@ public class LauncherTest {
@Rule
public JenkinsRule rule = new JenkinsRule();
@Bug(19488)
@Issue("JENKINS-19488")
@Test
public void correctlyExpandEnvVars() throws Exception {
FreeStyleProject project = rule.createFreeStyleProject();
......@@ -65,10 +69,10 @@ public class LauncherTest {
FreeStyleBuild build = project.scheduleBuild2(0).get();
assertThat(log(build), containsString("aaa aaaccc ccc"));
rule.assertLogContains("aaa aaaccc ccc", build);
}
@Bug(19926)
@Issue("JENKINS-19926")
@Test
public void overwriteSystemEnvVars() throws Exception {
Map<String, String> env = new HashMap<String,String>();
......@@ -86,11 +90,67 @@ public class LauncherTest {
FreeStyleBuild build = project.scheduleBuild2(0).get();
assertThat(log(build), containsString("original value and new value"));
rule.assertLogContains("original value and new value", build);
}
@SuppressWarnings("deprecation")
private String log(FreeStyleBuild build) throws IOException {
return build.getLog();
@Issue("JENKINS-23027")
@Test public void quiet() throws Exception {
Slave s = rule.createSlave();
boolean windows = Functions.isWindows();
FreeStyleProject p = rule.createFreeStyleProject();
p.getBuildersList().add(windows ? new BatchFile("echo printed text") : new Shell("echo printed text"));
for (Node n : new Node[] {rule.jenkins, s}) {
rule.assertLogContains(windows ? "cmd /c" : "sh -xe", runOn(p, n));
}
p.getBuildersList().clear(); // TODO .replace does not seem to work
p.getBuildersList().add(windows ? new QuietBatchFile("echo printed text") : new QuietShell("echo printed text"));
for (Node n : new Node[] {rule.jenkins, s}) {
rule.assertLogNotContains(windows ? "cmd /c" : "sh -xe", runOn(p, n));
}
}
private FreeStyleBuild runOn(FreeStyleProject p, Node n) throws Exception {
p.setAssignedNode(n);
FreeStyleBuild b = rule.buildAndAssertSuccess(p);
rule.assertLogContains("printed text", b);
return b;
}
private static final class QuietLauncher extends Launcher.DecoratedLauncher {
QuietLauncher(Launcher inner) {
super(inner);
}
@Override public Proc launch(ProcStarter starter) throws IOException {
return super.launch(starter.quiet(true));
}
}
private static final class QuietShell extends Shell {
QuietShell(String command) {
super(command);
}
@Override public boolean perform(AbstractBuild<?,?> build, Launcher launcher, TaskListener listener) throws InterruptedException {
return super.perform(build, new QuietLauncher(launcher), listener);
}
@Extension public static final class DescriptorImpl extends Shell.DescriptorImpl {
@Override public String getDisplayName() {
return "QuietShell";
}
}
}
private static final class QuietBatchFile extends BatchFile {
QuietBatchFile(String command) {
super(command);
}
@Override public boolean perform(AbstractBuild<?,?> build, Launcher launcher, TaskListener listener) throws InterruptedException {
return super.perform(build, new QuietLauncher(launcher), listener);
}
@Extension public static final class DescriptorImpl extends BuildStepDescriptor<Builder> {
@Override public String getDisplayName() {
return "QuietBatchFile";
}
@SuppressWarnings("rawtypes")
@Override public boolean isApplicable(Class<? extends AbstractProject> jobType) {
return true;
}
}
}
}
......@@ -238,6 +238,7 @@ public class ArtifactArchiverTest {
String xml = p.getConfigFile().asString();
assertFalse(xml, xml.contains("<recordBuildArtifacts>"));
assertTrue(xml, xml.contains("<fingerprint>true</fingerprint>"));
assertFalse(xml, xml.contains("<hudson.tasks.Fingerprinter>"));
ArtifactArchiver aa = p.getPublishersList().get(ArtifactArchiver.class);
assertTrue(aa.isFingerprint());
FreeStyleBuild b1 = j.buildAndAssertSuccess(p);
......
......@@ -28,7 +28,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>pom</artifactId>
<version>1.576-SNAPSHOT</version>
<version>1.577-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册