Skip to content

Commit

Permalink
Merge branch 'master' into fix-radio-validation
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkEWaite authored Jan 6, 2024
2 parents e9b7c0b + 7392571 commit a73f0d8
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .mvn/extensions.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0 http://maven.apache.org/xsd/core-extensions-1.0.0.xsd">
<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0 https://maven.apache.org/xsd/core-extensions-1.0.0.xsd">
<extension>
<groupId>io.jenkins.tools.incrementals</groupId>
<artifactId>git-changelist-maven-extension</artifactId>
Expand Down
26 changes: 25 additions & 1 deletion core/src/main/java/hudson/WebAppMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.lang.reflect.InvocationTargetException;
import java.net.URL;
import java.net.URLClassLoader;
import java.nio.charset.Charset;
Expand Down Expand Up @@ -261,13 +262,36 @@ public void run() {
new HudsonFailedToLoad(e).publish(context, _home);
throw e;
} catch (Exception e) {
new HudsonFailedToLoad(e).publish(context, _home);
// Allow plugins to override error page on boot with custom BootFailure subclass thrown
Throwable error = unwrapException(e);
if (error instanceof InvocationTargetException) {
Throwable targetException = ((InvocationTargetException) error).getTargetException();

if (targetException instanceof BootFailure) {
((BootFailure) targetException).publish(context, _home);
} else {
new HudsonFailedToLoad(e).publish(context, _home);
}
} else {
new HudsonFailedToLoad(e).publish(context, _home);
}
} finally {
Jenkins instance = Jenkins.getInstanceOrNull();
if (!success && instance != null)
instance.cleanUp();
}
}

private Throwable unwrapException(Exception e) {
Throwable error = e;
while (error.getCause() != null) {
if (error.getCause() instanceof InvocationTargetException) {
return error.getCause();
}
error = error.getCause();
}
return error;
}
};
initThread.start();
} catch (BootFailure e) {
Expand Down
4 changes: 4 additions & 0 deletions core/src/main/resources/jenkins/install/platform-plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@
{ "name": "mailer", "suggested": true }
]
},
{
"category": "Appearance",
"plugins": [{ "name": "dark-theme", "suggested": true }]
},
{
"category": "Languages",
"plugins": [{ "name": "locale" }, { "name": "localization-zh-cn" }]
Expand Down
13 changes: 11 additions & 2 deletions test/src/test/java/hudson/slaves/JNLPLauncherTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,21 @@ private ArgumentListBuilder buildJnlpArgs(Computer c) throws Exception {
ArgumentListBuilder args = new ArgumentListBuilder();
args.add(new File(new File(System.getProperty("java.home")), "bin/java").getPath(), "-jar");
args.add(Which.jarFile(Launcher.class).getAbsolutePath());
// TODO deprecated mode
args.add("-jnlpUrl", j.getURL() + "computer/" + c.getName() + "/jenkins-agent.jnlp");
args.add("-url");
args.add(j.getURL());
args.add("-name");
args.add(c.getName());

if (c instanceof SlaveComputer) {
SlaveComputer sc = (SlaveComputer) c;
args.add("-secret");
args.add(sc.getJnlpMac());
ComputerLauncher launcher = sc.getLauncher();
if (launcher instanceof ComputerLauncherFilter) {
launcher = ((ComputerLauncherFilter) launcher).getCore();
} else if (launcher instanceof DelegatingComputerLauncher) {
launcher = ((DelegatingComputerLauncher) launcher).getLauncher();
}
if (launcher instanceof JNLPLauncher) {
args.add(((JNLPLauncher) launcher).getWorkDirSettings().toCommandLineArgs(sc));
}
Expand Down
3 changes: 2 additions & 1 deletion test/src/test/java/hudson/tasks/MavenTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
import org.jvnet.hudson.test.Issue;
import org.jvnet.hudson.test.JenkinsRule;
import org.jvnet.hudson.test.ToolInstallations;
import org.jvnet.hudson.test.recipes.WithTimeout;
import org.kohsuke.stapler.jelly.JellyFacet;

/**
Expand Down Expand Up @@ -190,7 +191,7 @@ private void verify() throws Exception {
assertNotNull(isp.installers.get(MavenInstaller.class));
}

@Test public void sensitiveParameters() throws Exception {
@Test @WithTimeout(300) public void sensitiveParameters() throws Exception {
FreeStyleProject project = j.createFreeStyleProject();
ParametersDefinitionProperty pdb = new ParametersDefinitionProperty(
new StringParameterDefinition("string", "defaultValue", "string description"),
Expand Down

0 comments on commit a73f0d8

Please sign in to comment.