From 96f1d88155fad0c1bf5417c84200d5ab0d97edff Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Wed, 22 Sep 2021 16:15:08 +0000 Subject: [PATCH 01/66] [SECURITY-2475] --- bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bom/pom.xml b/bom/pom.xml index 3f8ef1ceee1e..6f64b8747692 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -81,7 +81,7 @@ THE SOFTWARE. commons-httpclient commons-httpclient - 3.1-jenkins-2 + 3.1-jenkins-3 org.jenkins-ci.main From 2e7b3a4c025b3dfb6398e84a93622848e5104363 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Wed, 22 Sep 2021 16:15:18 +0000 Subject: [PATCH 02/66] [SECURITY-2452] --- core/src/main/java/hudson/model/Cause.java | 15 +++--- .../model/Cause/RemoteCause/description.jelly | 27 +++++++++++ .../Cause/RemoteCause/description.properties | 1 + .../hudson/model/Cause/description.jelly | 2 +- .../hudson/model/CauseSECURITY2452Test.java | 48 +++++++++++++++++++ 5 files changed, 83 insertions(+), 10 deletions(-) create mode 100644 core/src/main/resources/hudson/model/Cause/RemoteCause/description.jelly create mode 100644 core/src/main/resources/hudson/model/Cause/RemoteCause/description.properties create mode 100644 test/src/test/java/hudson/model/CauseSECURITY2452Test.java diff --git a/core/src/main/java/hudson/model/Cause.java b/core/src/main/java/hudson/model/Cause.java index 9a4df33a16d2..53c8acbb32e2 100644 --- a/core/src/main/java/hudson/model/Cause.java +++ b/core/src/main/java/hudson/model/Cause.java @@ -30,7 +30,6 @@ import hudson.console.ModelHyperlinkNote; import hudson.diagnosis.OldDataMonitor; import hudson.util.XStream2; -import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; @@ -65,9 +64,11 @@ public abstract class Cause { /** * One-line human-readable text of the cause. * - *

- * By default, this method is used to render HTML as well. + * Historically, this method's return value was used to render HTML on the UI as well. + * Since October 2021, the return value is interpreted as text. + * To have rich HTML output on the UI, provide a custom {@code description.jelly} view for your subclass. */ + // TODO finalize version numbers @Exported(visibility=3) public abstract String getShortDescription(); @@ -483,13 +484,9 @@ public RemoteCause(String host, String note) { @Override public String getShortDescription() { if(note != null) { - try { - return Messages.Cause_RemoteCause_ShortDescriptionWithNote(Util.xmlEscape(addr), Jenkins.get().getMarkupFormatter().translate(note)); - } catch (IOException x) { - // ignore - } + return Messages.Cause_RemoteCause_ShortDescriptionWithNote(addr, note); } - return Messages.Cause_RemoteCause_ShortDescription(Util.xmlEscape(addr)); + return Messages.Cause_RemoteCause_ShortDescription(addr); } @Exported(visibility = 3) diff --git a/core/src/main/resources/hudson/model/Cause/RemoteCause/description.jelly b/core/src/main/resources/hudson/model/Cause/RemoteCause/description.jelly new file mode 100644 index 000000000000..57d84a3d7190 --- /dev/null +++ b/core/src/main/resources/hudson/model/Cause/RemoteCause/description.jelly @@ -0,0 +1,27 @@ + + + + ${%blurb(it.addr, it.note)} + diff --git a/core/src/main/resources/hudson/model/Cause/RemoteCause/description.properties b/core/src/main/resources/hudson/model/Cause/RemoteCause/description.properties new file mode 100644 index 000000000000..5274b4ad9f9d --- /dev/null +++ b/core/src/main/resources/hudson/model/Cause/RemoteCause/description.properties @@ -0,0 +1 @@ +blurb = Started by remote host {0} with note: {1} diff --git a/core/src/main/resources/hudson/model/Cause/description.jelly b/core/src/main/resources/hudson/model/Cause/description.jelly index cc10129381d0..c2c8a2748d56 100644 --- a/core/src/main/resources/hudson/model/Cause/description.jelly +++ b/core/src/main/resources/hudson/model/Cause/description.jelly @@ -23,5 +23,5 @@ THE SOFTWARE. --> - + ${it.shortDescription} diff --git a/test/src/test/java/hudson/model/CauseSECURITY2452Test.java b/test/src/test/java/hudson/model/CauseSECURITY2452Test.java new file mode 100644 index 000000000000..b1abe15ddc42 --- /dev/null +++ b/test/src/test/java/hudson/model/CauseSECURITY2452Test.java @@ -0,0 +1,48 @@ +package hudson.model; + +import org.junit.Assert; +import org.junit.Rule; +import org.junit.Test; +import org.jvnet.hudson.test.Issue; +import org.jvnet.hudson.test.JenkinsRule; + +// TODO Merge into CauseTest after release +public class CauseSECURITY2452Test { + + @Rule + public JenkinsRule j = new JenkinsRule(); + + @Test + @Issue("SECURITY-2452") + public void basicCauseIsSafe() throws Exception { + final FreeStyleProject fs = j.createFreeStyleProject(); + { + final FreeStyleBuild build = j.waitForCompletion(fs.scheduleBuild2(0, new SimpleCause("safe")).get()); + + final JenkinsRule.WebClient wc = j.createWebClient(); + final String content = wc.getPage(build).getWebResponse().getContentAsString(); + Assert.assertTrue(content.contains("Simple cause: safe")); + } + { + final FreeStyleBuild build = j.waitForCompletion(fs.scheduleBuild2(0, new SimpleCause("")).get()); + + final JenkinsRule.WebClient wc = j.createWebClient(); + final String content = wc.getPage(build).getWebResponse().getContentAsString(); + Assert.assertFalse(content.contains("Simple cause: Date: Wed, 22 Sep 2021 16:15:26 +0000 Subject: [PATCH 03/66] [SECURITY-2424] --- core/src/main/java/jenkins/model/Jenkins.java | 20 +++ .../hudson/model/Messages.properties | 1 + .../jenkins/model/JenkinsSEC2424Test.java | 73 ++++++++++ .../hudson/cli/CopyJobCommandSEC2424Test.java | 89 +++++++++++++ .../cli/CreateJobCommandSEC2424Test.java | 96 ++++++++++++++ .../cli/CreateNodeCommandSEC2424Test.java | 125 ++++++++++++++++++ .../model/FreeStyleProjectSEC2424Test.java | 92 +++++++++++++ .../java/jenkins/model/NodesSEC2424Test.java | 101 ++++++++++++++ 8 files changed, 597 insertions(+) create mode 100644 core/src/test/java/jenkins/model/JenkinsSEC2424Test.java create mode 100644 test/src/test/java/hudson/cli/CopyJobCommandSEC2424Test.java create mode 100644 test/src/test/java/hudson/cli/CreateJobCommandSEC2424Test.java create mode 100644 test/src/test/java/hudson/cli/CreateNodeCommandSEC2424Test.java create mode 100644 test/src/test/java/hudson/model/FreeStyleProjectSEC2424Test.java create mode 100644 test/src/test/java/jenkins/model/NodesSEC2424Test.java diff --git a/core/src/main/java/jenkins/model/Jenkins.java b/core/src/main/java/jenkins/model/Jenkins.java index 98cdca3e218b..ec8db539f60b 100644 --- a/core/src/main/java/jenkins/model/Jenkins.java +++ b/core/src/main/java/jenkins/model/Jenkins.java @@ -4161,6 +4161,13 @@ public static void checkGoodName(String name) throws Failure { throw new Failure(Messages.Hudson_UnsafeChar(ch)); } + if (SystemProperties.getBoolean(NAME_VALIDATION_REJECTS_TRAILING_DOT_PROP, true)) { + // SECURITY-2424 on Windows the trailing dot can be used to create ambiguity + if (name.trim().endsWith(".")) { + throw new Failure(Messages.Hudson_TrailingDot()); + } + } + // looks good } @@ -5413,6 +5420,19 @@ public boolean shouldShowStackTrace() { */ private static final String WORKSPACE_DIRNAME = SystemProperties.getString(Jenkins.class.getName() + "." + "workspaceDirName", "workspace"); + /** + * Name of the system property escape hatch for SECURITY-2424. It allows to have back the legacy (and vulnerable) + * behavior allowing a "good name" to end with a dot. This could be used to exploit two names colliding in the file + * system to extract information. The files ending with a dot are only a problem on Windows. + * + * The default value is true. + * + * For detailed documentation: https://docs.microsoft.com/en-us/troubleshoot/windows-client/shell-experience/file-folder-name-whitespace-characters + * @see #checkGoodName(String) + */ + @Restricted(NoExternalUse.class) + public static final String NAME_VALIDATION_REJECTS_TRAILING_DOT_PROP = Jenkins.class.getName() + "." + "nameValidationRejectsTrailingDot"; + /** * Default value of job's builds dir. * @see #getRawBuildsDir() diff --git a/core/src/main/resources/hudson/model/Messages.properties b/core/src/main/resources/hudson/model/Messages.properties index 6981bc4b3a3a..819624adc319 100644 --- a/core/src/main/resources/hudson/model/Messages.properties +++ b/core/src/main/resources/hudson/model/Messages.properties @@ -139,6 +139,7 @@ Hudson.NotJDKDir={0} doesn\u2019t look like a JDK directory Hudson.Permissions.Title=Overall Hudson.USER_CONTENT_README=Files in this directory will be served under your http://yourjenkins/userContent/ Hudson.UnsafeChar=\u2018{0}\u2019 is an unsafe character +Hudson.TrailingDot=A name cannot end with \u2018.\u2019 Hudson.ViewAlreadyExists=A view already exists with the name "{0}" Hudson.ViewName=All Hudson.NotANumber=Not a number diff --git a/core/src/test/java/jenkins/model/JenkinsSEC2424Test.java b/core/src/test/java/jenkins/model/JenkinsSEC2424Test.java new file mode 100644 index 000000000000..e4fbab81ca34 --- /dev/null +++ b/core/src/test/java/jenkins/model/JenkinsSEC2424Test.java @@ -0,0 +1,73 @@ +/* + * The MIT License + * + * Copyright (c) 2014 + * + * 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. + */ +package jenkins.model; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import hudson.model.Failure; +import hudson.model.Messages; +import org.junit.Test; +import org.jvnet.hudson.test.Issue; + +public class JenkinsSEC2424Test { + @Test + @Issue("SECURITY-2424") + public void doesNotAcceptNameWithTrailingDot_regular() { + try { + Jenkins.checkGoodName("job."); + fail("Names with dot should not be accepted"); + } catch (Failure e) { + assertEquals(Messages.Hudson_TrailingDot(), e.getMessage()); + } + } + + @Test + @Issue("SECURITY-2424") + public void doesNotAcceptNameWithTrailingDot_withSpaces() { + try { + Jenkins.checkGoodName("job. "); + fail("Names with dot should not be accepted"); + } catch (Failure e) { + assertEquals(Messages.Hudson_TrailingDot(), e.getMessage()); + } + } + + @Test + @Issue("SECURITY-2424") + public void doesNotAcceptNameWithTrailingDot_exceptIfEscapeHatchIsSet() { + String propName = Jenkins.NAME_VALIDATION_REJECTS_TRAILING_DOT_PROP; + String initialValue = System.getProperty(propName); + System.setProperty(propName, "false"); + try { + Jenkins.checkGoodName("job."); + } finally { + if (initialValue == null) { + System.clearProperty(propName); + } else { + System.setProperty(propName, initialValue); + } + } + } +} diff --git a/test/src/test/java/hudson/cli/CopyJobCommandSEC2424Test.java b/test/src/test/java/hudson/cli/CopyJobCommandSEC2424Test.java new file mode 100644 index 000000000000..b3cf3bfe5e09 --- /dev/null +++ b/test/src/test/java/hudson/cli/CopyJobCommandSEC2424Test.java @@ -0,0 +1,89 @@ +/* + * The MIT License + * + * Copyright 2012 Jesse Glick. + * + * 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. + */ + +package hudson.cli; + +import static hudson.cli.CLICommandInvoker.Matcher.failedWith; +import static hudson.cli.CLICommandInvoker.Matcher.succeededSilently; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.containsString; + +import hudson.model.Messages; +import jenkins.model.Jenkins; +import org.hamcrest.Matchers; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.jvnet.hudson.test.Issue; +import org.jvnet.hudson.test.JenkinsRule; + +//TODO merge back to CopyJobCommandTest after security release +public class CopyJobCommandSEC2424Test { + + @Rule public JenkinsRule j = new JenkinsRule(); + private CLICommand copyJobCommand; + private CLICommandInvoker command; + + @Before public void setUp() { + copyJobCommand = new CopyJobCommand(); + command = new CLICommandInvoker(j, copyJobCommand); + } + + @Issue("SECURITY-2424") + @Test public void cannotCopyJobWithTrailingDot_regular() throws Exception { + assertThat(j.jenkins.getItems(), Matchers.hasSize(0)); + j.createFreeStyleProject("job1"); + assertThat(j.jenkins.getItems(), Matchers.hasSize(1)); + + CLICommandInvoker.Result result = command.invokeWithArgs("job1", "job1."); + assertThat(result.stderr(), containsString(Messages.Hudson_TrailingDot())); + assertThat(result, failedWith(1)); + + assertThat(j.jenkins.getItems(), Matchers.hasSize(1)); + } + + @Issue("SECURITY-2424") + @Test public void cannotCopyJobWithTrailingDot_exceptIfEscapeHatchIsSet() throws Exception { + String propName = Jenkins.NAME_VALIDATION_REJECTS_TRAILING_DOT_PROP; + String initialValue = System.getProperty(propName); + System.setProperty(propName, "false"); + try { + assertThat(j.jenkins.getItems(), Matchers.hasSize(0)); + j.createFreeStyleProject("job1"); + assertThat(j.jenkins.getItems(), Matchers.hasSize(1)); + + CLICommandInvoker.Result result = command.invokeWithArgs("job1", "job1."); + assertThat(result, succeededSilently()); + + assertThat(j.jenkins.getItems(), Matchers.hasSize(2)); + } + finally { + if (initialValue == null) { + System.clearProperty(propName); + } else { + System.setProperty(propName, initialValue); + } + } + } +} diff --git a/test/src/test/java/hudson/cli/CreateJobCommandSEC2424Test.java b/test/src/test/java/hudson/cli/CreateJobCommandSEC2424Test.java new file mode 100644 index 000000000000..8d8a0e2f49f3 --- /dev/null +++ b/test/src/test/java/hudson/cli/CreateJobCommandSEC2424Test.java @@ -0,0 +1,96 @@ +/* + * The MIT License + * + * Copyright 2014 Jesse Glick. + * + * 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. + */ + +package hudson.cli; + +import static hudson.cli.CLICommandInvoker.Matcher.failedWith; +import static hudson.cli.CLICommandInvoker.Matcher.succeededSilently; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.containsString; + +import hudson.model.Messages; +import java.io.ByteArrayInputStream; +import java.nio.charset.StandardCharsets; +import jenkins.model.Jenkins; +import org.hamcrest.Matchers; +import org.junit.Rule; +import org.junit.Test; +import org.jvnet.hudson.test.Issue; +import org.jvnet.hudson.test.JenkinsRule; + + +//TODO merge back to CreateJobCommandTest after security release +public class CreateJobCommandSEC2424Test { + + @Rule public JenkinsRule r = new JenkinsRule(); + + @Issue("SECURITY-2424") + @Test public void cannotCreateJobWithTrailingDot_withoutOtherJob() { + CLICommand cmd = new CreateJobCommand(); + CLICommandInvoker invoker = new CLICommandInvoker(r, cmd); + assertThat(r.jenkins.getItems(), Matchers.hasSize(0)); + + CLICommandInvoker.Result result = invoker.withStdin(new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8))).invokeWithArgs("job1."); + assertThat(result.stderr(), containsString(Messages.Hudson_TrailingDot())); + assertThat(result, failedWith(1)); + + assertThat(r.jenkins.getItems(), Matchers.hasSize(0)); + } + + @Issue("SECURITY-2424") + @Test public void cannotCreateJobWithTrailingDot_withExistingJob() { + CLICommand cmd = new CreateJobCommand(); + CLICommandInvoker invoker = new CLICommandInvoker(r, cmd); + assertThat(r.jenkins.getItems(), Matchers.hasSize(0)); + assertThat(invoker.withStdin(new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8))).invokeWithArgs("job1"), succeededSilently()); + assertThat(r.jenkins.getItems(), Matchers.hasSize(1)); + + CLICommandInvoker.Result result = invoker.withStdin(new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8))).invokeWithArgs("job1."); + assertThat(result.stderr(), containsString(Messages.Hudson_TrailingDot())); + assertThat(result, failedWith(1)); + + assertThat(r.jenkins.getItems(), Matchers.hasSize(1)); + } + + @Issue("SECURITY-2424") + @Test public void cannotCreateJobWithTrailingDot_exceptIfEscapeHatchIsSet() { + String propName = Jenkins.NAME_VALIDATION_REJECTS_TRAILING_DOT_PROP; + String initialValue = System.getProperty(propName); + System.setProperty(propName, "false"); + try { + CLICommand cmd = new CreateJobCommand(); + CLICommandInvoker invoker = new CLICommandInvoker(r, cmd); + assertThat(r.jenkins.getItems(), Matchers.hasSize(0)); + assertThat(invoker.withStdin(new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8))).invokeWithArgs("job1."), succeededSilently()); + assertThat(r.jenkins.getItems(), Matchers.hasSize(1)); + } + finally { + if (initialValue == null) { + System.clearProperty(propName); + } else { + System.setProperty(propName, initialValue); + } + } + } +} diff --git a/test/src/test/java/hudson/cli/CreateNodeCommandSEC2424Test.java b/test/src/test/java/hudson/cli/CreateNodeCommandSEC2424Test.java new file mode 100644 index 000000000000..8d99978f39e2 --- /dev/null +++ b/test/src/test/java/hudson/cli/CreateNodeCommandSEC2424Test.java @@ -0,0 +1,125 @@ +/* + * The MIT License + * + * Copyright 2013 Red Hat, 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. + */ + +package hudson.cli; + +import static hudson.cli.CLICommandInvoker.Matcher.failedWith; +import static hudson.cli.CLICommandInvoker.Matcher.hasNoStandardOutput; +import static hudson.cli.CLICommandInvoker.Matcher.succeededSilently; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.containsString; +import static org.junit.Assert.assertEquals; + +import hudson.model.Messages; +import java.io.ByteArrayInputStream; +import java.nio.charset.StandardCharsets; +import jenkins.model.Jenkins; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.jvnet.hudson.test.Issue; +import org.jvnet.hudson.test.JenkinsRule; + + +//TODO merge back to CreateNodeCommandTest after security release +public class CreateNodeCommandSEC2424Test { + + private CLICommandInvoker command; + + @Rule public final JenkinsRule j = new JenkinsRule(); + + @Before public void setUp() { + + command = new CLICommandInvoker(j, new CreateNodeCommand()); + } + + @Test + @Issue("SECURITY-2424") + public void cannotCreateNodeWithTrailingDot_withoutOtherNode() { + int nodeListSizeBefore = j.jenkins.getNodes().size(); + + CLICommandInvoker.Result result = command + .withStdin(new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8))) + .invokeWithArgs("nodeA.") + ; + + assertThat(result.stderr(), containsString(Messages.Hudson_TrailingDot())); + assertThat(result, hasNoStandardOutput()); + assertThat(result, failedWith(1)); + + // ensure not side effects + assertEquals(nodeListSizeBefore, j.jenkins.getNodes().size()); + } + + @Test + @Issue("SECURITY-2424") + public void cannotCreateNodeWithTrailingDot_withExistingNode() { + int nodeListSizeBefore = j.jenkins.getNodes().size(); + + assertThat(command.withStdin(new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8))).invokeWithArgs("nodeA"), succeededSilently()); + assertEquals(nodeListSizeBefore + 1, j.jenkins.getNodes().size()); + + CLICommandInvoker.Result result = command + .withStdin(new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8))) + .invokeWithArgs("nodeA.") + ; + + assertThat(result.stderr(), containsString(Messages.Hudson_TrailingDot())); + assertThat(result, hasNoStandardOutput()); + assertThat(result, failedWith(1)); + + // ensure not side effects + assertEquals(nodeListSizeBefore + 1, j.jenkins.getNodes().size()); + } + + @Test + @Issue("SECURITY-2424") + public void cannotCreateNodeWithTrailingDot_exceptIfEscapeHatchIsSet() { + String propName = Jenkins.NAME_VALIDATION_REJECTS_TRAILING_DOT_PROP; + String initialValue = System.getProperty(propName); + System.setProperty(propName, "false"); + try { + int nodeListSizeBefore = j.jenkins.getNodes().size(); + + assertThat(command.withStdin(new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8))).invokeWithArgs("nodeA"), succeededSilently()); + assertEquals(nodeListSizeBefore + 1, j.jenkins.getNodes().size()); + + CLICommandInvoker.Result result = command + .withStdin(new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8))) + .invokeWithArgs("nodeA.") + ; + + assertThat(result, succeededSilently()); + + assertEquals(nodeListSizeBefore + 2, j.jenkins.getNodes().size()); + } + finally { + if (initialValue == null) { + System.clearProperty(propName); + } else { + System.setProperty(propName, initialValue); + } + } + } +} diff --git a/test/src/test/java/hudson/model/FreeStyleProjectSEC2424Test.java b/test/src/test/java/hudson/model/FreeStyleProjectSEC2424Test.java new file mode 100644 index 000000000000..cf204a196859 --- /dev/null +++ b/test/src/test/java/hudson/model/FreeStyleProjectSEC2424Test.java @@ -0,0 +1,92 @@ +/* + * The MIT License + * + * Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi + * + * 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. + */ +package hudson.model; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.hasSize; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import java.io.ByteArrayInputStream; +import jenkins.model.Jenkins; +import org.junit.Rule; +import org.junit.Test; +import org.jvnet.hudson.test.Issue; +import org.jvnet.hudson.test.JenkinsRule; + +//TODO merge back to FreeStyleProjectTest after security release +public class FreeStyleProjectSEC2424Test { + + @Rule + public JenkinsRule j = new JenkinsRule(); + + @Test + @Issue("SECURITY-2424") + public void cannotCreateJobWithTrailingDot_withoutOtherJob() throws Exception { + assertThat(j.jenkins.getItems(), hasSize(0)); + try { + j.jenkins.createProjectFromXML("jobA.", new ByteArrayInputStream("".getBytes())); + fail("Adding the job should have thrown an exception during checkGoodName"); + } + catch (Failure e) { + assertEquals(Messages.Hudson_TrailingDot(), e.getMessage()); + } + assertThat(j.jenkins.getItems(), hasSize(0)); + } + + @Test + @Issue("SECURITY-2424") + public void cannotCreateJobWithTrailingDot_withExistingJob() throws Exception { + assertThat(j.jenkins.getItems(), hasSize(0)); + j.createFreeStyleProject("jobA"); + assertThat(j.jenkins.getItems(), hasSize(1)); + try { + j.jenkins.createProjectFromXML("jobA.", new ByteArrayInputStream("".getBytes())); + fail("Adding the job should have thrown an exception during checkGoodName"); + } + catch (Failure e) { + assertEquals(Messages.Hudson_TrailingDot(), e.getMessage()); + } + assertThat(j.jenkins.getItems(), hasSize(1)); + } + + @Issue("SECURITY-2424") + @Test public void cannotCreateJobWithTrailingDot_exceptIfEscapeHatchIsSet() throws Exception { + String propName = Jenkins.NAME_VALIDATION_REJECTS_TRAILING_DOT_PROP; + String initialValue = System.getProperty(propName); + System.setProperty(propName, "false"); + try { + assertThat(j.jenkins.getItems(), hasSize(0)); + j.jenkins.createProjectFromXML("jobA.", new ByteArrayInputStream("".getBytes())); + } + finally { + if (initialValue == null) { + System.clearProperty(propName); + } else { + System.setProperty(propName, initialValue); + } + } + assertThat(j.jenkins.getItems(), hasSize(1)); + } +} diff --git a/test/src/test/java/jenkins/model/NodesSEC2424Test.java b/test/src/test/java/jenkins/model/NodesSEC2424Test.java new file mode 100644 index 000000000000..c1040bb0c469 --- /dev/null +++ b/test/src/test/java/jenkins/model/NodesSEC2424Test.java @@ -0,0 +1,101 @@ +/* + * The MIT License + * + * Copyright 2018 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. + */ + +package jenkins.model; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.hasSize; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import hudson.model.Failure; +import hudson.model.Messages; +import hudson.slaves.DumbSlave; +import org.junit.Rule; +import org.junit.Test; +import org.jvnet.hudson.test.Issue; +import org.jvnet.hudson.test.JenkinsRule; + +//TODO merge back to NodesTest after security release +public class NodesSEC2424Test { + + @Rule + public JenkinsRule r = new JenkinsRule(); + + @Test + @Issue("SECURITY-2424") + public void cannotCreateNodeWithTrailingDot_withoutOtherNode() throws Exception { + assertThat(r.jenkins.getNodes(), hasSize(0)); + + DumbSlave node = new DumbSlave("nodeA.", "temp", r.createComputerLauncher(null)); + try { + r.jenkins.addNode(node); + fail("Adding the node should have thrown an exception during checkGoodName"); + } catch (Failure e) { + assertEquals(Messages.Hudson_TrailingDot(), e.getMessage()); + } + + assertThat(r.jenkins.getNodes(), hasSize(0)); + } + + @Test + @Issue("SECURITY-2424") + public void cannotCreateNodeWithTrailingDot_withExistingNode() throws Exception { + assertThat(r.jenkins.getNodes(), hasSize(0)); + r.createSlave("nodeA", "", null); + assertThat(r.jenkins.getNodes(), hasSize(1)); + + DumbSlave node = new DumbSlave("nodeA.", "temp", r.createComputerLauncher(null)); + try { + r.jenkins.addNode(node); + fail("Adding the node should have thrown an exception during checkGoodName"); + } catch (Failure e) { + assertEquals(Messages.Hudson_TrailingDot(), e.getMessage()); + } + + assertThat(r.jenkins.getNodes(), hasSize(1)); + } + + @Test + @Issue("SECURITY-2424") + public void cannotCreateNodeWithTrailingDot_exceptIfEscapeHatchIsSet() throws Exception { + String propName = Jenkins.NAME_VALIDATION_REJECTS_TRAILING_DOT_PROP; + String initialValue = System.getProperty(propName); + System.setProperty(propName, "false"); + try { + assertThat(r.jenkins.getNodes(), hasSize(0)); + + DumbSlave node = new DumbSlave("nodeA.", "temp", r.createComputerLauncher(null)); + r.jenkins.addNode(node); + + assertThat(r.jenkins.getNodes(), hasSize(1)); + } finally { + if (initialValue == null) { + System.clearProperty(propName); + } else { + System.setProperty(propName, initialValue); + } + } + } +} From 3f679fc12d073676a4441d3fa8b5fff34c07662f Mon Sep 17 00:00:00 2001 From: Wadeck Date: Wed, 22 Sep 2021 16:15:36 +0000 Subject: [PATCH 04/66] [SECURITY-2481] --- .../hudson/model/DirectoryBrowserSupport.java | 36 ++++++- .../DirectoryBrowserSupportSEC2481Test.java | 101 ++++++++++++++++++ 2 files changed, 136 insertions(+), 1 deletion(-) create mode 100644 test/src/test/java/hudson/model/DirectoryBrowserSupportSEC2481Test.java diff --git a/core/src/main/java/hudson/model/DirectoryBrowserSupport.java b/core/src/main/java/hudson/model/DirectoryBrowserSupport.java index 7cebfd5d1efc..7ce1db734b09 100644 --- a/core/src/main/java/hudson/model/DirectoryBrowserSupport.java +++ b/core/src/main/java/hudson/model/DirectoryBrowserSupport.java @@ -26,6 +26,8 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import hudson.FilePath; import hudson.Util; + +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; @@ -52,6 +54,7 @@ import java.util.stream.Stream; import javax.servlet.ServletException; import javax.servlet.http.HttpServletResponse; + import jenkins.model.Jenkins; import jenkins.security.MasterToSlaveCallable; import jenkins.security.ResourceDomainConfiguration; @@ -82,6 +85,11 @@ public final class DirectoryBrowserSupport implements HttpResponse { @SuppressFBWarnings(value = "MS_SHOULD_BE_FINAL", justification = "Accessible via System Groovy Scripts") public static boolean ALLOW_SYMLINK_ESCAPE = SystemProperties.getBoolean(DirectoryBrowserSupport.class.getName() + ".allowSymlinkEscape"); + /** + * Escape hatch for the protection against SECURITY-2481. If enabled, the absolute paths on Windows will be allowed. + */ + static final String ALLOW_ABSOLUTE_PATH_PROPERTY_NAME = DirectoryBrowserSupport.class.getName() + ".allowAbsolutePath"; + public final ModelObject owner; public final String title; @@ -243,7 +251,20 @@ private void serveFile(StaplerRequest req, StaplerResponse rsp, VirtualFile root String rest = _rest.toString(); // this is the base file/directory - VirtualFile baseFile = base.isEmpty() ? root : root.child(base); + VirtualFile baseFile; + if (base.isEmpty()) { + baseFile = root; + } else { + if (!SystemProperties.getBoolean(ALLOW_ABSOLUTE_PATH_PROPERTY_NAME, false)) { + boolean isAbsolute = root.run(new IsAbsolute(base)); + if (isAbsolute) { + LOGGER.info(() -> "SECURITY-2481 The path provided in the URL (" + base + ") is absolute and thus is refused."); + rsp.sendError(HttpServletResponse.SC_NOT_FOUND); + return; + } + } + baseFile = root.child(base); + } if (baseFile.hasSymlink(getNoFollowLinks())) { rsp.sendError(HttpServletResponse.SC_NOT_FOUND); @@ -397,6 +418,19 @@ private void serveFile(StaplerRequest req, StaplerResponse rsp, VirtualFile root } } + private static final class IsAbsolute extends MasterToSlaveCallable { + private final String fragment; + + IsAbsolute(String fragment) { + this.fragment = fragment; + } + + @Override + public Boolean call() throws IOException { + return new File(fragment).isAbsolute(); + } + } + private List> keepReadabilityOnlyOnDescendants(VirtualFile root, boolean patternUsed, List> pathFragmentsList){ Stream> pathFragmentsStream = pathFragmentsList.stream().map((List pathFragments) -> { List mappedFragments = new ArrayList<>(pathFragments.size()); diff --git a/test/src/test/java/hudson/model/DirectoryBrowserSupportSEC2481Test.java b/test/src/test/java/hudson/model/DirectoryBrowserSupportSEC2481Test.java new file mode 100644 index 000000000000..34b20b2ba2db --- /dev/null +++ b/test/src/test/java/hudson/model/DirectoryBrowserSupportSEC2481Test.java @@ -0,0 +1,101 @@ +/* + * The MIT License + * + * Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi + * + * 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. + */ +package hudson.model; + +import com.gargoylesoftware.htmlunit.Page; +import hudson.Functions; +import org.apache.commons.io.FileUtils; +import org.hamcrest.CoreMatchers; +import org.hamcrest.MatcherAssert; +import org.junit.Assume; +import org.junit.Rule; +import org.junit.Test; +import org.jvnet.hudson.test.Issue; +import org.jvnet.hudson.test.JenkinsRule; + +import java.io.File; +import java.nio.charset.StandardCharsets; + +//TODO merge back to DirectoryBrowserSupportTest +public class DirectoryBrowserSupportSEC2481Test { + + @Rule + public JenkinsRule j = new JenkinsRule(); + + @Test + @Issue("SECURITY-2481") + public void windows_cannotViewAbsolutePath() throws Exception { + Assume.assumeTrue("can only be tested this on Windows", Functions.isWindows()); + + File targetTmpFile = File.createTempFile("sec2481", "tmp"); + String content = "random data provided as fixed value"; + FileUtils.writeStringToFile(targetTmpFile, content, StandardCharsets.UTF_8); + + JenkinsRule.WebClient wc = j.createWebClient().withThrowExceptionOnFailingStatusCode(false); + Page page = wc.goTo("userContent/" + targetTmpFile.getAbsolutePath() + "/*view*", null); + + MatcherAssert.assertThat(page.getWebResponse().getStatusCode(), CoreMatchers.equalTo(404)); + } + + @Test + @Issue("SECURITY-2481") + public void windows_canViewAbsolutePath_withEscapeHatch() throws Exception { + Assume.assumeTrue("can only be tested this on Windows", Functions.isWindows()); + + String originalValue = System.getProperty(DirectoryBrowserSupport.ALLOW_ABSOLUTE_PATH_PROPERTY_NAME); + System.setProperty(DirectoryBrowserSupport.ALLOW_ABSOLUTE_PATH_PROPERTY_NAME, "true"); + try { + File targetTmpFile = File.createTempFile("sec2481", "tmp"); + String content = "random data provided as fixed value"; + FileUtils.writeStringToFile(targetTmpFile, content, StandardCharsets.UTF_8); + + JenkinsRule.WebClient wc = j.createWebClient().withThrowExceptionOnFailingStatusCode(false); + Page page = wc.goTo("userContent/" + targetTmpFile.getAbsolutePath() + "/*view*", null); + + MatcherAssert.assertThat(page.getWebResponse().getStatusCode(), CoreMatchers.equalTo(200)); + MatcherAssert.assertThat(page.getWebResponse().getContentAsString(), CoreMatchers.containsString(content)); + } finally { + if (originalValue == null) { + System.clearProperty(DirectoryBrowserSupport.ALLOW_ABSOLUTE_PATH_PROPERTY_NAME); + } else { + System.setProperty(DirectoryBrowserSupport.ALLOW_ABSOLUTE_PATH_PROPERTY_NAME, originalValue); + } + } + + } + + @Test + public void canViewRelativePath() throws Exception { + File testFile = new File(j.jenkins.getRootDir(), "userContent/test.txt"); + String content = "random data provided as fixed value"; + + FileUtils.writeStringToFile(testFile, content, StandardCharsets.UTF_8); + + JenkinsRule.WebClient wc = j.createWebClient().withThrowExceptionOnFailingStatusCode(false); + Page page = wc.goTo("userContent/test.txt/*view*", null); + + MatcherAssert.assertThat(page.getWebResponse().getStatusCode(), CoreMatchers.equalTo(200)); + MatcherAssert.assertThat(page.getWebResponse().getContentAsString(), CoreMatchers.containsString(content)); + } +} From dc30e28789ec22904a373982e79accd6e334dbd9 Mon Sep 17 00:00:00 2001 From: Jenkins Release Bot <66998184+jenkins-release-bot@users.noreply.github.com> Date: Tue, 5 Oct 2021 10:56:29 +0000 Subject: [PATCH 05/66] [maven-release-plugin] prepare release jenkins-2.315 --- bom/pom.xml | 2 +- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bom/pom.xml b/bom/pom.xml index 6f64b8747692..128797b4238f 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main jenkins-parent - ${revision}${changelist} + 2.315 jenkins-bom diff --git a/cli/pom.xml b/cli/pom.xml index 3838594a564f..8be513f4cf5d 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main jenkins-parent - ${revision}${changelist} + 2.315 cli diff --git a/core/pom.xml b/core/pom.xml index e1650bb3c681..4ed32e62243b 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main jenkins-parent - ${revision}${changelist} + 2.315 jenkins-core diff --git a/pom.xml b/pom.xml index 0e47e472c38b..2b295b6089f3 100644 --- a/pom.xml +++ b/pom.xml @@ -34,7 +34,7 @@ THE SOFTWARE. org.jenkins-ci.main jenkins-parent - ${revision}${changelist} + 2.315 pom Jenkins main module @@ -61,7 +61,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - ${scmTag} + jenkins-2.315 diff --git a/test/pom.xml b/test/pom.xml index 64e10892a19b..d71748811536 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main jenkins-parent - ${revision}${changelist} + 2.315 jenkins-test diff --git a/war/pom.xml b/war/pom.xml index b0eeef8b5b53..5136d4904423 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main jenkins-parent - ${revision}${changelist} + 2.315 jenkins-war From 6a02856fb4d220f7af3e7eee2c5e45eeb3461b2b Mon Sep 17 00:00:00 2001 From: Jenkins Release Bot <66998184+jenkins-release-bot@users.noreply.github.com> Date: Tue, 5 Oct 2021 10:56:49 +0000 Subject: [PATCH 06/66] [maven-release-plugin] prepare for next development iteration --- bom/pom.xml | 2 +- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 6 +++--- test/pom.xml | 2 +- war/pom.xml | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bom/pom.xml b/bom/pom.xml index 128797b4238f..6f64b8747692 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main jenkins-parent - 2.315 + ${revision}${changelist} jenkins-bom diff --git a/cli/pom.xml b/cli/pom.xml index 8be513f4cf5d..3838594a564f 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main jenkins-parent - 2.315 + ${revision}${changelist} cli diff --git a/core/pom.xml b/core/pom.xml index 4ed32e62243b..e1650bb3c681 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main jenkins-parent - 2.315 + ${revision}${changelist} jenkins-core diff --git a/pom.xml b/pom.xml index 2b295b6089f3..b8d03c8843e3 100644 --- a/pom.xml +++ b/pom.xml @@ -34,7 +34,7 @@ THE SOFTWARE. org.jenkins-ci.main jenkins-parent - 2.315 + ${revision}${changelist} pom Jenkins main module @@ -61,7 +61,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - jenkins-2.315 + ${scmTag} @@ -70,7 +70,7 @@ THE SOFTWARE. - 2.315 + 2.316 -SNAPSHOT - High + diff --git a/core/src/main/java/hudson/model/AbstractCIBase.java b/core/src/main/java/hudson/model/AbstractCIBase.java index f2e28f8ea0d1..05d4f6fcd382 100644 --- a/core/src/main/java/hudson/model/AbstractCIBase.java +++ b/core/src/main/java/hudson/model/AbstractCIBase.java @@ -28,6 +28,7 @@ import edu.umd.cs.findbugs.annotations.CheckForNull; +import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import hudson.security.AccessControlled; import hudson.slaves.ComputerListener; @@ -57,6 +58,7 @@ public abstract class AbstractCIBase extends Node implements ItemGroup Date: Sat, 9 Oct 2021 10:36:32 +0200 Subject: [PATCH 10/66] revert spotbugs config --- core/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/pom.xml b/core/pom.xml index e194b788d1c4..e1650bb3c681 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -43,7 +43,7 @@ THE SOFTWARE. 2.2 2.8.2 - + High From 2a5d26004635330f5d2e52b93ce171b02f40e9e8 Mon Sep 17 00:00:00 2001 From: Stefan Spieker Date: Sun, 10 Oct 2021 11:07:55 +0200 Subject: [PATCH 11/66] Use java 8 built in string comparator (#5770) --- core/src/main/java/org/jenkins/ui/icon/Icon.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/core/src/main/java/org/jenkins/ui/icon/Icon.java b/core/src/main/java/org/jenkins/ui/icon/Icon.java index fffbd01dab82..3162ea222c2c 100644 --- a/core/src/main/java/org/jenkins/ui/icon/Icon.java +++ b/core/src/main/java/org/jenkins/ui/icon/Icon.java @@ -269,7 +269,7 @@ public static String toNormalizedCSSSelector(String classNames) { classNameTokL.toArray(classNameTokA); // Sort classNameTokA - Arrays.sort(classNameTokA, new StringComparator()); + Arrays.sort(classNameTokA, Comparator.comparing(String::toString)); // Build the compound name StringBuilder stringBuilder = new StringBuilder(); @@ -305,12 +305,4 @@ public static String toNormalizedIconUrl(String url) { return originalUrl; } - - private static class StringComparator implements Comparator { - - @Override - public int compare(String s1, String s2) { - return s1.compareTo(s2); - } - } } From 7ae5d0e022a68abb03e131557fc3a9e38bdd18ac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 10 Oct 2021 10:08:04 +0100 Subject: [PATCH 12/66] Bump spotless-maven-plugin from 2.15.0 to 2.17.0 (#5783) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index df9a1336b0be..bde86ef74197 100644 --- a/pom.xml +++ b/pom.xml @@ -101,7 +101,7 @@ THE SOFTWARE. 1.25 5.8.1 - 2.15.0 + 2.17.0 + - + @@ -70,18 +71,5 @@ THE SOFTWARE. - - From d393280acd51ff78d65460839b24ae54f8365947 Mon Sep 17 00:00:00 2001 From: Stefan Spieker Date: Sun, 10 Oct 2021 11:09:58 +0200 Subject: [PATCH 17/66] Removed superflous throws (#5765) --- .../java/hudson/CustomPluginManagerTest.java | 2 +- .../test/java/hudson/ExtensionListTest.java | 12 +++++----- test/src/test/java/hudson/LauncherTest.java | 2 +- .../test/java/hudson/PluginManagerTest.java | 2 +- .../src/test/java/hudson/ProcStarterTest.java | 4 ++-- .../java/hudson/bugs/DateConversionTest.java | 2 +- .../java/hudson/cli/BuildCommandTest.java | 2 +- test/src/test/java/hudson/cli/CLITest.java | 2 +- .../cli/CancelQuietDownCommandTest.java | 6 ++--- .../hudson/cli/ClearQueueCommandTest.java | 4 ++-- .../hudson/cli/ConnectNodeCommandTest.java | 4 ++-- .../java/hudson/cli/ConsoleCommandTest.java | 2 +- .../hudson/cli/CreateNodeCommandTest.java | 6 ++--- .../hudson/cli/DeleteBuildsCommandTest.java | 2 +- .../hudson/cli/DisconnectNodeCommandTest.java | 2 +- .../java/hudson/cli/GetNodeCommandTest.java | 4 ++-- .../java/hudson/cli/GroovyshCommandTest.java | 2 +- .../test/java/hudson/cli/HelpCommandTest.java | 2 +- .../hudson/cli/InstallPluginCommandTest.java | 2 +- .../hudson/cli/ListPluginsCommandTest.java | 4 ++-- .../hudson/cli/OfflineNodeCommandTest.java | 6 ++--- .../hudson/cli/OnlineNodeCommandTest.java | 4 ++-- .../java/hudson/cli/QuietDownCommandTest.java | 18 +++++++-------- .../cli/ReloadConfigurationCommandTest.java | 4 ++-- .../java/hudson/cli/ReloadJobCommandTest.java | 2 +- .../cli/SetBuildDescriptionCommandTest.java | 2 +- .../hudson/cli/UpdateNodeCommandTest.java | 4 ++-- .../cli/WaitNodeOfflineCommandTest.java | 2 +- .../hudson/cli/WaitNodeOnlineCommandTest.java | 2 +- .../hudson/console/ConsoleAnnotatorTest.java | 10 ++++---- .../hudson/console/ConsoleLogFilterTest.java | 4 ++-- .../java/hudson/console/UrlAnnotatorTest.java | 2 +- .../diagnosis/TooManyJobsButNoViewTest.java | 2 +- .../init/impl/GroovyInitScriptTest.java | 2 +- .../model/AbortedFreeStyleBuildTest.java | 5 ++-- .../java/hudson/model/AbstractBuildTest.java | 8 +++---- .../java/hudson/model/BuildExecutionTest.java | 3 +-- .../src/test/java/hudson/model/CauseTest.java | 2 +- .../hudson/model/DependencyGraphTest.java | 2 +- .../java/hudson/model/DescriptorTest.java | 15 ++++++------ .../test/java/hudson/model/ExecutorTest.java | 2 +- .../model/FingerprintCleanupThreadTest.java | 10 ++++---- .../test/java/hudson/model/HudsonTest.java | 2 +- .../java/hudson/model/ItemGroupMixInTest.java | 8 +++---- .../java/hudson/model/JobPropertyTest.java | 2 +- test/src/test/java/hudson/model/JobTest.java | 4 ++-- .../java/hudson/model/ManagementLinkTest.java | 2 +- .../test/java/hudson/model/MyViewTest.java | 2 +- .../ParametersDefinitionPropertyTest.java | 2 +- .../java/hudson/model/PeriodicWorkTest.java | 2 +- .../test/java/hudson/model/ProjectTest.java | 10 ++++---- .../src/test/java/hudson/model/QueueTest.java | 23 +++++++++---------- test/src/test/java/hudson/model/RunTest.java | 4 ++-- .../test/java/hudson/model/SimpleJobTest.java | 4 ++-- .../hudson/model/UpdateCenterCustomTest.java | 4 ++-- .../java/hudson/model/UpdateCenterTest.java | 2 +- .../java/hudson/model/UpdateSiteTest.java | 7 +++--- .../java/hudson/model/UserIdMigratorTest.java | 6 ++--- test/src/test/java/hudson/model/UserTest.java | 4 ++-- .../java/hudson/model/ViewPropertyTest.java | 3 +-- test/src/test/java/hudson/model/ViewTest.java | 15 ++++++------ .../model/WorkspaceCleanupThreadTest.java | 4 ++-- .../labels/LabelAtomSecurity1986Test.java | 16 ++++++------- .../model/labels/LabelExpressionTest.java | 7 +++--- .../model/listeners/ItemListenerTest.java | 4 ++-- ...ildKeepsRunningWhenFaultySubTasksTest.java | 3 +-- .../hudson/model/queue/LoadPredictorTest.java | 2 +- .../hudson/model/queue/WideExecutionTest.java | 2 +- .../pages/SystemConfigurationTestCase.java | 2 +- .../hudson/scm/AbstractScmTagActionTest.java | 3 +-- test/src/test/java/hudson/scm/ScmTest.java | 3 +-- .../security/AccessDeniedException3Test.java | 2 +- .../security/ExtendedReadPermissionTest.java | 2 +- .../HudsonPrivateSecurityRealmTest.java | 2 +- .../hudson/security/SecurityRealmTest.java | 3 +-- .../test/java/hudson/slaves/CloudTest.java | 4 ++-- .../java/hudson/slaves/JNLPLauncherTest.java | 4 ++-- .../java/hudson/slaves/NodePropertyTest.java | 3 +-- .../hudson/slaves/NodeProvisionerTest.java | 2 +- .../java/hudson/slaves/PingThreadTest.java | 2 +- .../java/hudson/slaves/SlaveComputerTest.java | 6 ++--- .../hudson/tasks/ArtifactArchiverTest.java | 2 +- .../test/java/hudson/tasks/BatchFileTest.java | 11 ++++----- .../java/hudson/tasks/BuildTriggerTest.java | 2 +- .../java/hudson/tasks/FingerprinterTest.java | 5 ++-- .../src/test/java/hudson/tasks/ShellTest.java | 3 +-- .../tools/BatchCommandInstallerTest.java | 2 +- .../hudson/tools/CommandInstallerTest.java | 2 +- .../tools/ToolLocationNodePropertyTest.java | 3 +-- .../hudson/triggers/SafeTimerTaskTest.java | 5 ++-- .../java/hudson/util/BootFailureTest.java | 2 +- .../hudson/util/LineEndingConversionTest.java | 4 ++-- .../util/RobustReflectionConverterTest.java | 2 +- 93 files changed, 192 insertions(+), 212 deletions(-) diff --git a/test/src/test/java/hudson/CustomPluginManagerTest.java b/test/src/test/java/hudson/CustomPluginManagerTest.java index 76084aca2cad..0b702dcc73a5 100644 --- a/test/src/test/java/hudson/CustomPluginManagerTest.java +++ b/test/src/test/java/hudson/CustomPluginManagerTest.java @@ -58,7 +58,7 @@ class RuleRunnerImpl extends JenkinsRecipe.Runner private String oldValue; @Override - public void setup(JenkinsRule jenkinsRule, WithCustomLocalPluginManager recipe) throws Exception { + public void setup(JenkinsRule jenkinsRule, WithCustomLocalPluginManager recipe) { jenkinsRule.useLocalPluginManager = true; oldValue = System.getProperty(PluginManager.CUSTOM_PLUGIN_MANAGER); System.setProperty(PluginManager.CUSTOM_PLUGIN_MANAGER, recipe.value().getName()); diff --git a/test/src/test/java/hudson/ExtensionListTest.java b/test/src/test/java/hudson/ExtensionListTest.java index 9c655bdbba25..2c5ff67dad7f 100644 --- a/test/src/test/java/hudson/ExtensionListTest.java +++ b/test/src/test/java/hudson/ExtensionListTest.java @@ -46,7 +46,7 @@ public static class Cat implements Animal { @Test - public void autoDiscovery() throws Exception { + public void autoDiscovery() { ExtensionList list = ExtensionList.lookup(Animal.class); assertEquals(2,list.size()); assertNotNull(list.get(Dog.class)); @@ -55,14 +55,14 @@ public void autoDiscovery() throws Exception { @Test @WithoutJenkins - public void nullJenkinsInstance() throws Exception { + public void nullJenkinsInstance() { ExtensionList list = ExtensionList.lookup(Animal.class); assertEquals(0, list.size()); assertFalse(list.iterator().hasNext()); } @Test - public void extensionListView() throws Exception { + public void extensionListView() { // this is how legacy list like UserNameResolver.LIST gets created. List LIST = ExtensionListView.createList(Animal.class); @@ -117,7 +117,7 @@ public static final class DescriptorImpl extends FishDescriptor {} * Verifies that the automated {@link Descriptor} lookup works. */ @Test - public void descriptorLookup() throws Exception { + public void descriptorLookup() { Descriptor d = new Sishamo().getDescriptor(); DescriptorExtensionList> list = j.jenkins.getDescriptorList(Fish.class); @@ -127,7 +127,7 @@ public void descriptorLookup() throws Exception { } @Test - public void fishDiscovery() throws Exception { + public void fishDiscovery() { // imagine that this is a static instance, like it is in many LIST static field in Hudson. DescriptorList LIST = new DescriptorList<>(Fish.class); @@ -156,7 +156,7 @@ public void fishDiscovery() throws Exception { } @Test - public void legacyDescriptorList() throws Exception { + public void legacyDescriptorList() { // created in a legacy fashion without any tie to ExtensionList DescriptorList LIST = new DescriptorList<>(); diff --git a/test/src/test/java/hudson/LauncherTest.java b/test/src/test/java/hudson/LauncherTest.java index 44aae68b760d..8f67d8fdb1fb 100644 --- a/test/src/test/java/hudson/LauncherTest.java +++ b/test/src/test/java/hudson/LauncherTest.java @@ -254,7 +254,7 @@ private Object writeReplace() { } @FunctionalInterface private interface ProcStarterCustomizer { - void run(Launcher.ProcStarter ps, OutputStream os1, OutputStream os2, TaskListener os2Listener) throws Exception; + void run(Launcher.ProcStarter ps, OutputStream os1, OutputStream os2, TaskListener os2Listener); } private void assertMultipleStdioCalls(String message, Node node, boolean emitStderr, ProcStarterCustomizer psCustomizer, boolean outputIn2) throws Exception { message = node.getDisplayName() + ": " + message; diff --git a/test/src/test/java/hudson/PluginManagerTest.java b/test/src/test/java/hudson/PluginManagerTest.java index a885bc6349ce..79b737b0b162 100644 --- a/test/src/test/java/hudson/PluginManagerTest.java +++ b/test/src/test/java/hudson/PluginManagerTest.java @@ -512,7 +512,7 @@ private void dynamicLoadAndDisable(String plugin) throws IOException, Interrupte @Issue("JENKINS-44898") @WithPlugin("plugin-first.hpi") @Test - public void findResourceForPluginFirstClassLoader() throws Exception { + public void findResourceForPluginFirstClassLoader() { PluginWrapper w = r.jenkins.getPluginManager().getPlugin("plugin-first"); assertNotNull(w); diff --git a/test/src/test/java/hudson/ProcStarterTest.java b/test/src/test/java/hudson/ProcStarterTest.java index 9ee6c81bde99..0ebf9a93e7f1 100644 --- a/test/src/test/java/hudson/ProcStarterTest.java +++ b/test/src/test/java/hudson/ProcStarterTest.java @@ -120,7 +120,7 @@ public static class DescriptorImpl extends TestWrapperDescriptor { public static class DecoratedWrapper extends BuildWrapper { @Override - public Launcher decorateLauncher(AbstractBuild build, Launcher launcher, BuildListener listener) throws IOException, InterruptedException, Run.RunnerAbortedException { + public Launcher decorateLauncher(AbstractBuild build, Launcher launcher, BuildListener listener) throws Run.RunnerAbortedException { final BuildListener l = listener; return new DecoratedLauncher(launcher) { @Override @@ -133,7 +133,7 @@ public Proc launch(Launcher.ProcStarter starter) throws IOException { } @Override - public Environment setUp(AbstractBuild build, Launcher launcher, BuildListener listener) throws IOException, InterruptedException { + public Environment setUp(AbstractBuild build, Launcher launcher, BuildListener listener) { return new Environment() { }; } diff --git a/test/src/test/java/hudson/bugs/DateConversionTest.java b/test/src/test/java/hudson/bugs/DateConversionTest.java index b74caecbdf12..7070da95907e 100644 --- a/test/src/test/java/hudson/bugs/DateConversionTest.java +++ b/test/src/test/java/hudson/bugs/DateConversionTest.java @@ -51,7 +51,7 @@ public void test() throws Exception { for(int i=0;i<10;i++) { futures.add(es.submit(new Callable() { @Override - public Object call() throws Exception { + public Object call() { for( int i=0; i<10000; i++ ) dc.fromString("2008-08-26 15:40:14.568 GMT-03:00"); return null; diff --git a/test/src/test/java/hudson/cli/BuildCommandTest.java b/test/src/test/java/hudson/cli/BuildCommandTest.java index b8df194baa38..7e03e9fe0baf 100644 --- a/test/src/test/java/hudson/cli/BuildCommandTest.java +++ b/test/src/test/java/hudson/cli/BuildCommandTest.java @@ -96,7 +96,7 @@ public void async() throws Exception { OneShotEvent completed = new OneShotEvent(); p.getBuildersList().add(new TestBuilder() { @Override - public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { + public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException { started.signal(); completed.block(); return true; diff --git a/test/src/test/java/hudson/cli/CLITest.java b/test/src/test/java/hudson/cli/CLITest.java index f4b02f71bf2a..c84e39c9a986 100644 --- a/test/src/test/java/hudson/cli/CLITest.java +++ b/test/src/test/java/hudson/cli/CLITest.java @@ -236,7 +236,7 @@ public HttpResponses.HttpResponseException doDynamic(StaplerRequest req, Stapler // Custom written redirect so no traces of Jenkins are present in headers return new HttpResponses.HttpResponseException() { @Override - public void generateResponse(StaplerRequest req, StaplerResponse rsp, Object node) throws IOException, ServletException { + public void generateResponse(StaplerRequest req, StaplerResponse rsp, Object node) throws IOException { rsp.setHeader("Location", url); rsp.setContentType("text/html"); rsp.setStatus(HttpURLConnection.HTTP_MOVED_TEMP); diff --git a/test/src/test/java/hudson/cli/CancelQuietDownCommandTest.java b/test/src/test/java/hudson/cli/CancelQuietDownCommandTest.java index db6487c66912..50a73eeceee1 100644 --- a/test/src/test/java/hudson/cli/CancelQuietDownCommandTest.java +++ b/test/src/test/java/hudson/cli/CancelQuietDownCommandTest.java @@ -59,7 +59,7 @@ public void setUp() { } @Test - public void cancelQuietDownShouldFailWithoutAdministerPermission() throws Exception { + public void cancelQuietDownShouldFailWithoutAdministerPermission() { final CLICommandInvoker.Result result = command .authorizedTo(Jenkins.READ) .invoke(); @@ -69,7 +69,7 @@ public void cancelQuietDownShouldFailWithoutAdministerPermission() throws Except } @Test - public void cancelQuietDownShouldSuccessOnNoQuietDownedJenkins() throws Exception { + public void cancelQuietDownShouldSuccessOnNoQuietDownedJenkins() { final CLICommandInvoker.Result result = command .authorizedTo(Jenkins.READ, Jenkins.ADMINISTER) .invoke(); @@ -78,7 +78,7 @@ public void cancelQuietDownShouldSuccessOnNoQuietDownedJenkins() throws Exceptio } @Test - public void cancelQuietDownShouldSuccessOnQuietDownedJenkins() throws Exception { + public void cancelQuietDownShouldSuccessOnQuietDownedJenkins() { j.jenkins.doQuietDown(); QuietDownCommandTest.assertJenkinsInQuietMode(j); final CLICommandInvoker.Result result = command diff --git a/test/src/test/java/hudson/cli/ClearQueueCommandTest.java b/test/src/test/java/hudson/cli/ClearQueueCommandTest.java index dad099b923b4..8a7d384dc8aa 100644 --- a/test/src/test/java/hudson/cli/ClearQueueCommandTest.java +++ b/test/src/test/java/hudson/cli/ClearQueueCommandTest.java @@ -54,7 +54,7 @@ public void setUp() { command = new CLICommandInvoker(j, "clear-queue"); } - @Test public void clearQueueShouldFailWithoutAdministerPermission() throws Exception { + @Test public void clearQueueShouldFailWithoutAdministerPermission() { final CLICommandInvoker.Result result = command .authorizedTo(Jenkins.READ).invoke(); @@ -64,7 +64,7 @@ public void setUp() { } @Test - public void clearQueueShouldSucceedOnEmptyQueue() throws Exception { + public void clearQueueShouldSucceedOnEmptyQueue() { assertThat(j.jenkins.getQueue().isEmpty(), equalTo(true)); final CLICommandInvoker.Result result = command diff --git a/test/src/test/java/hudson/cli/ConnectNodeCommandTest.java b/test/src/test/java/hudson/cli/ConnectNodeCommandTest.java index bbdfef3576f5..56a21d36bf24 100644 --- a/test/src/test/java/hudson/cli/ConnectNodeCommandTest.java +++ b/test/src/test/java/hudson/cli/ConnectNodeCommandTest.java @@ -65,7 +65,7 @@ public class ConnectNodeCommandTest { assertThat(result.stderr(), not(containsString("ERROR: " + CLICommand.CLI_LISTPARAM_SUMMARY_ERROR_TEXT))); } - @Test public void connectNodeShouldFailIfNodeDoesNotExist() throws Exception { + @Test public void connectNodeShouldFailIfNodeDoesNotExist() { final CLICommandInvoker.Result result = command .authorizedTo(Computer.CONNECT, Jenkins.READ) .invokeWithArgs("never_created"); @@ -172,7 +172,7 @@ public class ConnectNodeCommandTest { assertThat(slave2.toComputer().isOnline(), equalTo(true)); } - @Test public void connectNodeShouldSucceedOnMaster() throws Exception { + @Test public void connectNodeShouldSucceedOnMaster() { final Computer masterComputer = j.jenkins.getComputer(""); CLICommandInvoker.Result result = command diff --git a/test/src/test/java/hudson/cli/ConsoleCommandTest.java b/test/src/test/java/hudson/cli/ConsoleCommandTest.java index 34443790f502..19eecb1d103d 100644 --- a/test/src/test/java/hudson/cli/ConsoleCommandTest.java +++ b/test/src/test/java/hudson/cli/ConsoleCommandTest.java @@ -94,7 +94,7 @@ public class ConsoleCommandTest { assertThat(result.stdout(), containsString("echo 1")); } - @Test public void consoleShouldFailWhenProjectDoesNotExist() throws Exception { + @Test public void consoleShouldFailWhenProjectDoesNotExist() { final CLICommandInvoker.Result result = command .authorizedTo(Jenkins.READ, Item.READ, Item.BUILD) diff --git a/test/src/test/java/hudson/cli/CreateNodeCommandTest.java b/test/src/test/java/hudson/cli/CreateNodeCommandTest.java index 52c7da227927..a241f1e74402 100644 --- a/test/src/test/java/hudson/cli/CreateNodeCommandTest.java +++ b/test/src/test/java/hudson/cli/CreateNodeCommandTest.java @@ -55,7 +55,7 @@ public class CreateNodeCommandTest { command = new CLICommandInvoker(j, new CreateNodeCommand()); } - @Test public void createNodeShouldFailWithoutComputerCreatePermission() throws Exception { + @Test public void createNodeShouldFailWithoutComputerCreatePermission() { final CLICommandInvoker.Result result = command .authorizedTo(Jenkins.READ) @@ -68,7 +68,7 @@ public class CreateNodeCommandTest { assertThat(result, failedWith(6)); } - @Test public void createNode() throws Exception { + @Test public void createNode() { final CLICommandInvoker.Result result = command .authorizedTo(Computer.CREATE, Jenkins.READ) @@ -83,7 +83,7 @@ public class CreateNodeCommandTest { assertThat(updated.getNumExecutors(), equalTo(42)); } - @Test public void createNodeSpecifyingNameExplicitly() throws Exception { + @Test public void createNodeSpecifyingNameExplicitly() { final CLICommandInvoker.Result result = command .authorizedTo(Computer.CREATE, Jenkins.READ) diff --git a/test/src/test/java/hudson/cli/DeleteBuildsCommandTest.java b/test/src/test/java/hudson/cli/DeleteBuildsCommandTest.java index 9b8a71ac7757..ef5139cdbb82 100644 --- a/test/src/test/java/hudson/cli/DeleteBuildsCommandTest.java +++ b/test/src/test/java/hudson/cli/DeleteBuildsCommandTest.java @@ -81,7 +81,7 @@ public class DeleteBuildsCommandTest { assertThat(result.stderr(), containsString("ERROR: user is missing the Run/Delete permission")); } - @Test public void deleteBuildsShouldFailIfJobDoesNotExist() throws Exception { + @Test public void deleteBuildsShouldFailIfJobDoesNotExist() { final CLICommandInvoker.Result result = command .authorizedTo(Jenkins.READ, Item.READ, Run.DELETE) .invokeWithArgs("never_created", "1"); diff --git a/test/src/test/java/hudson/cli/DisconnectNodeCommandTest.java b/test/src/test/java/hudson/cli/DisconnectNodeCommandTest.java index 414acce22349..1b358bdde49c 100644 --- a/test/src/test/java/hudson/cli/DisconnectNodeCommandTest.java +++ b/test/src/test/java/hudson/cli/DisconnectNodeCommandTest.java @@ -71,7 +71,7 @@ public void disconnectNodeShouldFailWithoutComputerDisconnectPermission() throws } @Test - public void disconnectNodeShouldFailIfNodeDoesNotExist() throws Exception { + public void disconnectNodeShouldFailIfNodeDoesNotExist() { final CLICommandInvoker.Result result = command .authorizedTo(Computer.DISCONNECT, Jenkins.READ) .invokeWithArgs("never_created"); diff --git a/test/src/test/java/hudson/cli/GetNodeCommandTest.java b/test/src/test/java/hudson/cli/GetNodeCommandTest.java index e9876a558023..3a7f12525da1 100644 --- a/test/src/test/java/hudson/cli/GetNodeCommandTest.java +++ b/test/src/test/java/hudson/cli/GetNodeCommandTest.java @@ -83,7 +83,7 @@ public class GetNodeCommandTest { assertThat(result, succeeded()); } - @Test public void getNodeShouldFailIfNodeDoesNotExist() throws Exception { + @Test public void getNodeShouldFailIfNodeDoesNotExist() { final CLICommandInvoker.Result result = command .authorizedTo(Computer.EXTENDED_READ, Jenkins.READ) @@ -97,7 +97,7 @@ public class GetNodeCommandTest { @Issue("SECURITY-281") @Test - public void getNodeShouldFailForBuiltInNode() throws Exception { + public void getNodeShouldFailForBuiltInNode() { CLICommandInvoker.Result result = command.authorizedTo(Computer.EXTENDED_READ, Jenkins.READ).invokeWithArgs(""); assertThat(result.stderr(), containsString("No such node ''")); assertThat(result, failedWith(3)); diff --git a/test/src/test/java/hudson/cli/GroovyshCommandTest.java b/test/src/test/java/hudson/cli/GroovyshCommandTest.java index ac3cec83ed26..7f3ed79f211c 100644 --- a/test/src/test/java/hudson/cli/GroovyshCommandTest.java +++ b/test/src/test/java/hudson/cli/GroovyshCommandTest.java @@ -41,7 +41,7 @@ public class GroovyshCommandTest { @Rule public JenkinsRule r = new JenkinsRule(); @Issue("JENKINS-17929") - @Test public void authentication() throws Exception { + @Test public void authentication() { CLICommandInvoker.Result result = new CLICommandInvoker(r, new GroovyshCommand()) .authorizedTo(Jenkins.READ, Jenkins.ADMINISTER) .withStdin(new StringInputStream("println(jenkins.model.Jenkins.instance.getClass().name)\n:quit\n")) diff --git a/test/src/test/java/hudson/cli/HelpCommandTest.java b/test/src/test/java/hudson/cli/HelpCommandTest.java index 457ffe522928..58696329a25f 100644 --- a/test/src/test/java/hudson/cli/HelpCommandTest.java +++ b/test/src/test/java/hudson/cli/HelpCommandTest.java @@ -137,7 +137,7 @@ protected void printUsageSummary(PrintStream stderr) { } @Override - protected int run() throws Exception { + protected int run() { throw new UnsupportedOperationException(); } } diff --git a/test/src/test/java/hudson/cli/InstallPluginCommandTest.java b/test/src/test/java/hudson/cli/InstallPluginCommandTest.java index 8192239b53ca..f6364f360b0b 100644 --- a/test/src/test/java/hudson/cli/InstallPluginCommandTest.java +++ b/test/src/test/java/hudson/cli/InstallPluginCommandTest.java @@ -40,7 +40,7 @@ public class InstallPluginCommandTest { @Issue("JENKINS-41745") @Test - public void fromStdin() throws Exception { + public void fromStdin() { assertNull(r.jenkins.getPluginManager().getPlugin("token-macro")); assertThat(new CLICommandInvoker(r, "install-plugin"). withStdin(InstallPluginCommandTest.class.getResourceAsStream("/plugins/token-macro.hpi")). diff --git a/test/src/test/java/hudson/cli/ListPluginsCommandTest.java b/test/src/test/java/hudson/cli/ListPluginsCommandTest.java index d8dcef361728..7bd7e2df7d2b 100644 --- a/test/src/test/java/hudson/cli/ListPluginsCommandTest.java +++ b/test/src/test/java/hudson/cli/ListPluginsCommandTest.java @@ -41,7 +41,7 @@ public class ListPluginsCommandTest { public JenkinsRule j = new JenkinsRule(); @Test - public void listPluginsExpectedUsage() throws Exception { + public void listPluginsExpectedUsage() { assertNull(j.jenkins.getPluginManager().getPlugin("token-macro")); CLICommandInvoker.Result result = new CLICommandInvoker(j, new ListPluginsCommand()) .invoke(); @@ -64,7 +64,7 @@ public void listPluginsExpectedUsage() throws Exception { @Test @Issue("SECURITY-771") - public void onlyAccessibleForAdmin() throws Exception { + public void onlyAccessibleForAdmin() { CLICommandInvoker.Result result = new CLICommandInvoker(j, new ListPluginsCommand()) .authorizedTo(Jenkins.READ) .invoke(); diff --git a/test/src/test/java/hudson/cli/OfflineNodeCommandTest.java b/test/src/test/java/hudson/cli/OfflineNodeCommandTest.java index 3f62cbb13cea..fc950ddfa6f1 100644 --- a/test/src/test/java/hudson/cli/OfflineNodeCommandTest.java +++ b/test/src/test/java/hudson/cli/OfflineNodeCommandTest.java @@ -76,7 +76,7 @@ public void offlineNodeShouldFailWithoutComputerDisconnectPermission() throws Ex } @Test - public void offlineNodeShouldFailIfNodeDoesNotExist() throws Exception { + public void offlineNodeShouldFailIfNodeDoesNotExist() { final CLICommandInvoker.Result result = command .authorizedTo(Computer.DISCONNECT, Jenkins.READ) .invokeWithArgs("never_created"); @@ -451,7 +451,7 @@ public void offlineNodeManyShouldSucceedEvenANodeIsSpecifiedTwiceWithCause() thr } @Test - public void offlineNodeShouldSucceedOnMaster() throws Exception { + public void offlineNodeShouldSucceedOnMaster() { final Computer masterComputer = Jenkins.get().getComputer(""); final CLICommandInvoker.Result result = command @@ -465,7 +465,7 @@ public void offlineNodeShouldSucceedOnMaster() throws Exception { } @Test - public void offlineNodeShouldSucceedOnMasterWithCause() throws Exception { + public void offlineNodeShouldSucceedOnMasterWithCause() { final Computer masterComputer = Jenkins.get().getComputer(""); final CLICommandInvoker.Result result = command diff --git a/test/src/test/java/hudson/cli/OnlineNodeCommandTest.java b/test/src/test/java/hudson/cli/OnlineNodeCommandTest.java index 1699e1734ffc..47cc0b22c485 100644 --- a/test/src/test/java/hudson/cli/OnlineNodeCommandTest.java +++ b/test/src/test/java/hudson/cli/OnlineNodeCommandTest.java @@ -78,7 +78,7 @@ public class OnlineNodeCommandTest { assertThat(result.stderr(), containsString("ERROR: user is missing the Agent/Connect permission")); } - @Test public void onlineNodeShouldFailIfNodeDoesNotExist() throws Exception { + @Test public void onlineNodeShouldFailIfNodeDoesNotExist() { final CLICommandInvoker.Result result = command .authorizedTo(Computer.CONNECT, Jenkins.READ) .invokeWithArgs("never_created"); @@ -284,7 +284,7 @@ public class OnlineNodeCommandTest { assertThat(slave2.toComputer().isOnline(), equalTo(true)); } - @Test public void onlineNodeShouldSucceedOnMaster() throws Exception { + @Test public void onlineNodeShouldSucceedOnMaster() { final Computer masterComputer = j.jenkins.getComputer(""); CLICommandInvoker.Result result = command diff --git a/test/src/test/java/hudson/cli/QuietDownCommandTest.java b/test/src/test/java/hudson/cli/QuietDownCommandTest.java index 5909575ef2a7..b79fc6df88f1 100644 --- a/test/src/test/java/hudson/cli/QuietDownCommandTest.java +++ b/test/src/test/java/hudson/cli/QuietDownCommandTest.java @@ -72,7 +72,7 @@ public void setUp() { } @Test - public void quietDownShouldFailWithoutAdministerPermission() throws Exception { + public void quietDownShouldFailWithoutAdministerPermission() { final CLICommandInvoker.Result result = command .authorizedTo(Jenkins.READ) .invoke(); @@ -82,7 +82,7 @@ public void quietDownShouldFailWithoutAdministerPermission() throws Exception { } @Test - public void quietDownShouldSuccess() throws Exception { + public void quietDownShouldSuccess() { final CLICommandInvoker.Result result = command .authorizedTo(Jenkins.READ, Jenkins.ADMINISTER) .invoke(); @@ -91,7 +91,7 @@ public void quietDownShouldSuccess() throws Exception { } @Test - public void quietDownShouldSuccessWithBlock() throws Exception { + public void quietDownShouldSuccessWithBlock() { final CLICommandInvoker.Result result = command .authorizedTo(Jenkins.READ, Jenkins.ADMINISTER) .invokeWithArgs("-block"); @@ -100,7 +100,7 @@ public void quietDownShouldSuccessWithBlock() throws Exception { } @Test - public void quietDownShouldSuccessWithTimeout() throws Exception { + public void quietDownShouldSuccessWithTimeout() { final CLICommandInvoker.Result result = command .authorizedTo(Jenkins.READ, Jenkins.ADMINISTER) .invokeWithArgs("-timeout", "0"); @@ -109,7 +109,7 @@ public void quietDownShouldSuccessWithTimeout() throws Exception { } @Test - public void quietDownShouldSuccessWithReason() throws Exception { + public void quietDownShouldSuccessWithReason() { final CLICommandInvoker.Result result = command .authorizedTo(Jenkins.READ, Jenkins.ADMINISTER) .invokeWithArgs("-reason", TEST_REASON); @@ -119,7 +119,7 @@ public void quietDownShouldSuccessWithReason() throws Exception { } @Test - public void quietDownShouldSuccessWithBlockAndTimeout() throws Exception { + public void quietDownShouldSuccessWithBlockAndTimeout() { final CLICommandInvoker.Result result = command .authorizedTo(Jenkins.READ, Jenkins.ADMINISTER) .invokeWithArgs("-block", "-timeout", "0"); @@ -128,7 +128,7 @@ public void quietDownShouldSuccessWithBlockAndTimeout() throws Exception { } @Test - public void quietDownShouldSuccessWithBlockAndTimeoutAndReason() throws Exception { + public void quietDownShouldSuccessWithBlockAndTimeoutAndReason() { final CLICommandInvoker.Result result = command .authorizedTo(Jenkins.READ, Jenkins.ADMINISTER) .invokeWithArgs("-block", "-timeout", "0", "-reason", TEST_REASON); @@ -138,7 +138,7 @@ public void quietDownShouldSuccessWithBlockAndTimeoutAndReason() throws Exceptio } @Test - public void quietDownShouldFailWithEmptyTimeout() throws Exception { + public void quietDownShouldFailWithEmptyTimeout() { final CLICommandInvoker.Result result = command .authorizedTo(Jenkins.READ, Jenkins.ADMINISTER) .invokeWithArgs("-timeout"); @@ -148,7 +148,7 @@ public void quietDownShouldFailWithEmptyTimeout() throws Exception { } @Test - public void quietDownShouldSuccessOnAlreadyQuietDownedJenkins() throws Exception { + public void quietDownShouldSuccessOnAlreadyQuietDownedJenkins() { j.jenkins.doQuietDown(); assertJenkinsInQuietMode(); final CLICommandInvoker.Result result = command diff --git a/test/src/test/java/hudson/cli/ReloadConfigurationCommandTest.java b/test/src/test/java/hudson/cli/ReloadConfigurationCommandTest.java index 17c12ed413e8..d84c55b49591 100644 --- a/test/src/test/java/hudson/cli/ReloadConfigurationCommandTest.java +++ b/test/src/test/java/hudson/cli/ReloadConfigurationCommandTest.java @@ -69,7 +69,7 @@ public class ReloadConfigurationCommandTest { } @Test - public void reloadConfigurationShouldFailWithoutAdministerPermission() throws Exception { + public void reloadConfigurationShouldFailWithoutAdministerPermission() { j.jenkins.setAuthorizationStrategy(new MockAuthorizationStrategy().grant(Jenkins.READ).everywhere().toAuthenticated()); final CLICommandInvoker.Result result = command.invoke(); @@ -175,7 +175,7 @@ public void reloadDescriptorConfig() throws Exception { assertThat(desc.getDefaultSuffix(), equalTo("@newSuffix")); } - private void reloadJenkinsConfigurationViaCliAndWait() throws Exception { + private void reloadJenkinsConfigurationViaCliAndWait() { final CLICommandInvoker.Result result = command.invoke(); assertThat(result, succeededSilently()); diff --git a/test/src/test/java/hudson/cli/ReloadJobCommandTest.java b/test/src/test/java/hudson/cli/ReloadJobCommandTest.java index ff39aa982a8f..85c1b2d7e6e7 100644 --- a/test/src/test/java/hudson/cli/ReloadJobCommandTest.java +++ b/test/src/test/java/hudson/cli/ReloadJobCommandTest.java @@ -113,7 +113,7 @@ public class ReloadJobCommandTest { assertThat(project.scheduleBuild2(0).get().getLog(), containsString("echo 2")); } - @Test public void reloadJobShouldFailIfJobDoesNotExist() throws Exception { + @Test public void reloadJobShouldFailIfJobDoesNotExist() { final CLICommandInvoker.Result result = command .authorizedTo(Item.READ, Item.CONFIGURE, Jenkins.READ) diff --git a/test/src/test/java/hudson/cli/SetBuildDescriptionCommandTest.java b/test/src/test/java/hudson/cli/SetBuildDescriptionCommandTest.java index b76ebb458020..7027b6c250c0 100644 --- a/test/src/test/java/hudson/cli/SetBuildDescriptionCommandTest.java +++ b/test/src/test/java/hudson/cli/SetBuildDescriptionCommandTest.java @@ -110,7 +110,7 @@ public class SetBuildDescriptionCommandTest { assertThat(build.getDescription(), equalTo(" ")); } - @Test public void setBuildDescriptionShouldFailIfJobDoesNotExist() throws Exception { + @Test public void setBuildDescriptionShouldFailIfJobDoesNotExist() { final CLICommandInvoker.Result result = command .authorizedTo(Run.UPDATE, Item.READ, Jenkins.READ) .invokeWithArgs("never_created"); diff --git a/test/src/test/java/hudson/cli/UpdateNodeCommandTest.java b/test/src/test/java/hudson/cli/UpdateNodeCommandTest.java index 7a8b7d18148e..fc5e7fab6dee 100644 --- a/test/src/test/java/hudson/cli/UpdateNodeCommandTest.java +++ b/test/src/test/java/hudson/cli/UpdateNodeCommandTest.java @@ -88,7 +88,7 @@ public class UpdateNodeCommandTest { assertThat(updatedSlave.getNumExecutors(), equalTo(42)); } - @Test public void updateNodeShouldFailIfNodeDoesNotExist() throws Exception { + @Test public void updateNodeShouldFailIfNodeDoesNotExist() { final CLICommandInvoker.Result result = command .authorizedTo(Computer.CONFIGURE, Jenkins.READ) @@ -103,7 +103,7 @@ public class UpdateNodeCommandTest { @Issue("SECURITY-281") @Test - public void updateNodeShouldFailForMaster() throws Exception { + public void updateNodeShouldFailForMaster() { CLICommandInvoker.Result result = command.authorizedTo(Computer.CONFIGURE, Jenkins.READ).withStdin(Computer.class.getResourceAsStream("node.xml")).invokeWithArgs(""); assertThat(result.stderr(), containsString("No such node ''")); assertThat(result, failedWith(3)); diff --git a/test/src/test/java/hudson/cli/WaitNodeOfflineCommandTest.java b/test/src/test/java/hudson/cli/WaitNodeOfflineCommandTest.java index c0a08c1c4a97..87f29d59c848 100644 --- a/test/src/test/java/hudson/cli/WaitNodeOfflineCommandTest.java +++ b/test/src/test/java/hudson/cli/WaitNodeOfflineCommandTest.java @@ -59,7 +59,7 @@ public void setUp() { } @Test - public void waitNodeOfflineShouldFailIfNodeDoesNotExist() throws Exception { + public void waitNodeOfflineShouldFailIfNodeDoesNotExist() { final CLICommandInvoker.Result result = command .authorizedTo(Jenkins.READ) .invokeWithArgs("never_created"); diff --git a/test/src/test/java/hudson/cli/WaitNodeOnlineCommandTest.java b/test/src/test/java/hudson/cli/WaitNodeOnlineCommandTest.java index 4023c799d1c1..89faed241a1f 100644 --- a/test/src/test/java/hudson/cli/WaitNodeOnlineCommandTest.java +++ b/test/src/test/java/hudson/cli/WaitNodeOnlineCommandTest.java @@ -58,7 +58,7 @@ public void setUp() { } @Test - public void waitNodeOnlineShouldFailIfNodeDoesNotExist() throws Exception { + public void waitNodeOnlineShouldFailIfNodeDoesNotExist() { final CLICommandInvoker.Result result = command .authorizedTo(Jenkins.READ) .invokeWithArgs("never_created"); diff --git a/test/src/test/java/hudson/console/ConsoleAnnotatorTest.java b/test/src/test/java/hudson/console/ConsoleAnnotatorTest.java index 95bf5c2dd239..163466b1a0e8 100644 --- a/test/src/test/java/hudson/console/ConsoleAnnotatorTest.java +++ b/test/src/test/java/hudson/console/ConsoleAnnotatorTest.java @@ -59,7 +59,7 @@ public class ConsoleAnnotatorTest { FreeStyleProject p = r.createFreeStyleProject(); p.getBuildersList().add(new TestBuilder() { @Override - public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { + public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) { listener.getLogger().println("---"); listener.getLogger().println("ooo"); listener.getLogger().println("ooo"); @@ -112,7 +112,7 @@ public ConsoleAnnotator annotate(FreeStyleBuild build, MarkupTex FreeStyleProject p = r.createFreeStyleProject(); p.getBuildersList().add(new TestBuilder() { @Override - public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { + public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) { listener.getLogger().print("abc\n"); listener.getLogger().print(HyperlinkNote.encodeTo("http://infradna.com/","def")+"\n"); return true; @@ -173,7 +173,7 @@ String next() throws IOException { FreeStyleProject p = r.createFreeStyleProject(); p.getBuildersList().add(new TestBuilder() { @Override - public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { + public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException { lock.phase(0); // make sure the build is now properly started lock.phase(2); @@ -336,7 +336,7 @@ public ConsoleAnnotator newInstance(Object context) { FreeStyleProject p = r.createFreeStyleProject(); p.getBuildersList().add(new TestBuilder() { @Override - public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { + public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) { listener.getLogger().println("&"); return true; } @@ -377,7 +377,7 @@ public PollingSCM() throws UnsupportedEncodingException { } @Override - protected PollingResult compareRemoteRevisionWith(AbstractProject project, Launcher launcher, FilePath workspace, TaskListener listener, SCMRevisionState baseline) throws IOException, InterruptedException { + protected PollingResult compareRemoteRevisionWith(AbstractProject project, Launcher launcher, FilePath workspace, TaskListener listener, SCMRevisionState baseline) throws IOException { listener.annotate(new DollarMark()); listener.getLogger().println("hello from polling"); return new PollingResult(Change.NONE); diff --git a/test/src/test/java/hudson/console/ConsoleLogFilterTest.java b/test/src/test/java/hudson/console/ConsoleLogFilterTest.java index ad7155902678..a23e5998b921 100644 --- a/test/src/test/java/hudson/console/ConsoleLogFilterTest.java +++ b/test/src/test/java/hudson/console/ConsoleLogFilterTest.java @@ -33,12 +33,12 @@ public class ConsoleLogFilterTest { @TestExtension public static class Impl extends ConsoleLogFilter { @Override - public OutputStream decorateLogger(Run build, OutputStream logger) throws IOException, InterruptedException { + public OutputStream decorateLogger(Run build, OutputStream logger) { return logger; } @Override - public OutputStream decorateLogger(final Computer c, OutputStream out) throws IOException, InterruptedException { + public OutputStream decorateLogger(final Computer c, OutputStream out) { return new LineTransformationOutputStream.Delegating(out) { @Override protected void eol(byte[] b, int len) throws IOException { diff --git a/test/src/test/java/hudson/console/UrlAnnotatorTest.java b/test/src/test/java/hudson/console/UrlAnnotatorTest.java index 8fdc2e9947f9..8a1112089f6b 100644 --- a/test/src/test/java/hudson/console/UrlAnnotatorTest.java +++ b/test/src/test/java/hudson/console/UrlAnnotatorTest.java @@ -47,7 +47,7 @@ public boolean perform(AbstractBuild build, Launcher launcher, BuildListen * Mark up of URL should consider surrounding markers, if any. */ @Test - public void test2() throws Exception { + public void test2() { MarkupText m = new MarkupText("{abc='http://url/',def='ghi'}"); new UrlAnnotator().newInstance(null).annotate(null,m); String html = m.toString(false); diff --git a/test/src/test/java/hudson/diagnosis/TooManyJobsButNoViewTest.java b/test/src/test/java/hudson/diagnosis/TooManyJobsButNoViewTest.java index f93691290c00..2417d9b064f7 100644 --- a/test/src/test/java/hudson/diagnosis/TooManyJobsButNoViewTest.java +++ b/test/src/test/java/hudson/diagnosis/TooManyJobsButNoViewTest.java @@ -34,7 +34,7 @@ public class TooManyJobsButNoViewTest { @Rule public JenkinsRule r = new JenkinsRule(); private TooManyJobsButNoView mon; - @Before public void setUp() throws Exception { + @Before public void setUp() { mon = AdministrativeMonitor.all().get(TooManyJobsButNoView.class); } diff --git a/test/src/test/java/hudson/init/impl/GroovyInitScriptTest.java b/test/src/test/java/hudson/init/impl/GroovyInitScriptTest.java index 6ea912bea469..c502fa1042a1 100644 --- a/test/src/test/java/hudson/init/impl/GroovyInitScriptTest.java +++ b/test/src/test/java/hudson/init/impl/GroovyInitScriptTest.java @@ -38,7 +38,7 @@ public class GroovyInitScriptTest { @Issue("JENKINS-17933") @LocalData - @Test public void errorsHandled() throws Exception { + @Test public void errorsHandled() { assertEquals("true", System.getProperty("started")); /* TODO Jenkins.logRecords empty during a test, and adding a handler to root logger in JenkinsRule.before() does not work: assertTrue(log, log.contains("Nonexistent")); diff --git a/test/src/test/java/hudson/model/AbortedFreeStyleBuildTest.java b/test/src/test/java/hudson/model/AbortedFreeStyleBuildTest.java index a9fa24f3ee90..59cdc0037c67 100644 --- a/test/src/test/java/hudson/model/AbortedFreeStyleBuildTest.java +++ b/test/src/test/java/hudson/model/AbortedFreeStyleBuildTest.java @@ -3,7 +3,6 @@ import static org.junit.Assert.assertEquals; import hudson.Launcher; -import java.io.IOException; import org.junit.Rule; import org.junit.Test; import org.jvnet.hudson.test.Issue; @@ -36,7 +35,7 @@ public void interruptAsFailure() throws Exception { project.getBuildWrappersList().add(wrapper); project.getBuildersList().add(new TestBuilder() { @Override - public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { + public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException { Executor.currentExecutor().interrupt(Result.FAILURE); throw new InterruptedException(); } @@ -48,7 +47,7 @@ public boolean perform(AbstractBuild build, Launcher launcher, BuildListen private static class AbortingBuilder extends TestBuilder { @Override - public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { + public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException { throw new InterruptedException(); } } diff --git a/test/src/test/java/hudson/model/AbstractBuildTest.java b/test/src/test/java/hudson/model/AbstractBuildTest.java index 967bf4d82fa5..43dc7c8f1a56 100644 --- a/test/src/test/java/hudson/model/AbstractBuildTest.java +++ b/test/src/test/java/hudson/model/AbstractBuildTest.java @@ -101,7 +101,7 @@ public static class ErroneousJobProperty extends JobProperty { public static final String ERROR_MESSAGE = "This publisher fails by design"; @Override - public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { + public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws IOException { throw new IOException(ERROR_MESSAGE); } @@ -132,7 +132,7 @@ public void rawConsoleOutput() throws Exception { FreeStyleProject p = j.createFreeStyleProject(); p.getBuildersList().add(new TestBuilder() { - @Override public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { + @Override public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) { listener.getLogger().println(out); return true; } @@ -276,7 +276,7 @@ public void trimValidDisplayName() throws Exception { } private static class ThrowBuilder extends Builder { - @Override public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { + @Override public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) { throw new NullPointerException(); } @TestExtension("doNotInterruptBuildAbruptlyWhenExceptionThrownFromBuildStep") @@ -299,7 +299,7 @@ public BuildStepMonitor getRequiredMonitorService() { } @Override - public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { + public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException { if (build.number == 1) { e1.signal(); // signal that build #1 is in publisher } else if (build.number == 2) { diff --git a/test/src/test/java/hudson/model/BuildExecutionTest.java b/test/src/test/java/hudson/model/BuildExecutionTest.java index bb8713b26bd9..e9326d318def 100644 --- a/test/src/test/java/hudson/model/BuildExecutionTest.java +++ b/test/src/test/java/hudson/model/BuildExecutionTest.java @@ -31,7 +31,6 @@ import hudson.slaves.WorkspaceList; import hudson.tasks.BuildStepMonitor; import hudson.tasks.Notifier; -import java.io.IOException; import org.junit.Rule; import org.junit.Test; import org.jvnet.hudson.test.Issue; @@ -57,7 +56,7 @@ private static class BrokenPublisher extends Notifier { @Override public boolean needsToRunAfterFinalized() { throw new IllegalStateException("oops"); } - @Override public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { + @Override public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) { return true; } @Override public BuildStepMonitor getRequiredMonitorService() { diff --git a/test/src/test/java/hudson/model/CauseTest.java b/test/src/test/java/hudson/model/CauseTest.java index df8065545724..5058d73d6017 100644 --- a/test/src/test/java/hudson/model/CauseTest.java +++ b/test/src/test/java/hudson/model/CauseTest.java @@ -96,7 +96,7 @@ public class CauseTest { @Issue("JENKINS-48467") - @Test public void userIdCausePrintTest() throws Exception { + @Test public void userIdCausePrintTest() { ByteArrayOutputStream baos = new ByteArrayOutputStream(); TaskListener listener = new StreamTaskListener(baos); diff --git a/test/src/test/java/hudson/model/DependencyGraphTest.java b/test/src/test/java/hudson/model/DependencyGraphTest.java index 2bfb72eb8a7d..e37712cda353 100644 --- a/test/src/test/java/hudson/model/DependencyGraphTest.java +++ b/test/src/test/java/hudson/model/DependencyGraphTest.java @@ -123,7 +123,7 @@ public boolean shouldTriggerBuild(AbstractBuild build, TaskListener listener, */ @LocalData @Issue("JENKINS-5265") @Test - public void testItemReadPermission() throws Exception { + public void testItemReadPermission() { // Rebuild dependency graph as anonymous user: j.jenkins.rebuildDependencyGraph(); try { diff --git a/test/src/test/java/hudson/model/DescriptorTest.java b/test/src/test/java/hudson/model/DescriptorTest.java index d9bda700f8d1..8f6c000cc432 100644 --- a/test/src/test/java/hudson/model/DescriptorTest.java +++ b/test/src/test/java/hudson/model/DescriptorTest.java @@ -36,7 +36,6 @@ import hudson.tasks.BuildStepDescriptor; import hudson.tasks.Builder; import hudson.tasks.Shell; -import java.io.IOException; import java.util.Arrays; import java.util.List; import java.util.concurrent.Callable; @@ -58,7 +57,7 @@ public class DescriptorTest { public @Rule JenkinsRule rule = new JenkinsRule(); @Issue("JENKINS-12307") - @Test public void getItemTypeDescriptorOrDie() throws Exception { + @Test public void getItemTypeDescriptorOrDie() { Describable instance = new Shell("echo hello"); Descriptor descriptor = instance.getDescriptor(); PropertyType propertyType = descriptor.getPropertyType(instance, "command"); @@ -91,7 +90,7 @@ private static final class BuilderImpl extends Builder { BuilderImpl(String id) { this.id = id; } - @Override public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { + @Override public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) { listener.getLogger().println("running " + getDescriptor().getId()); return true; } @@ -108,7 +107,7 @@ private static final class DescriptorImpl extends BuildStepDescriptor { @Override public String getId() { return id; } - @Override public Builder newInstance(StaplerRequest req, JSONObject formData) throws Descriptor.FormException { + @Override public Builder newInstance(StaplerRequest req, JSONObject formData) { return new BuilderImpl(id); } @Override public boolean isApplicable(Class jobType) { @@ -145,7 +144,7 @@ public static class B1 extends Builder { @DataBoundConstructor public B1(List ds) { this.ds = ds; } - @Override public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { + @Override public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) { listener.getLogger().println(ds); return true; } @@ -181,7 +180,7 @@ public D3D(String id) { @Override public String getId() { return id; } - @Override public D3 newInstance(StaplerRequest req, JSONObject formData) throws Descriptor.FormException { + @Override public D3 newInstance(StaplerRequest req, JSONObject formData) { return new D3(id); } } @@ -192,7 +191,7 @@ public static class B2 extends Builder { @DataBoundConstructor public B2(List ds) { this.ds = ds; } - @Override public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { + @Override public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) { listener.getLogger().println(ds); return true; } @@ -200,7 +199,7 @@ public static class B2 extends Builder { } @Test - public void presentStacktraceFromFormException() throws Exception { + public void presentStacktraceFromFormException() { NullPointerException cause = new NullPointerException(); final Descriptor.FormException fe = new Descriptor.FormException("My Message", cause, "fake"); FailingHttpStatusCodeException ex = assertThrows(FailingHttpStatusCodeException.class, () -> diff --git a/test/src/test/java/hudson/model/ExecutorTest.java b/test/src/test/java/hudson/model/ExecutorTest.java index 0f695fd32fe3..3ef9cf3a4d24 100644 --- a/test/src/test/java/hudson/model/ExecutorTest.java +++ b/test/src/test/java/hudson/model/ExecutorTest.java @@ -43,7 +43,7 @@ public void whenAnExecutorDiesHardANewExecutorTakesItsPlace() throws Exception { j.jenkins.getQueue().schedule(new QueueTest.TestTask(new AtomicInteger()) { @Override - public Queue.Executable createExecutable() throws IOException { + public Queue.Executable createExecutable() { throw new IllegalStateException("oops"); } }, 0); diff --git a/test/src/test/java/hudson/model/FingerprintCleanupThreadTest.java b/test/src/test/java/hudson/model/FingerprintCleanupThreadTest.java index 3da78959157e..c1d173e8f3e6 100644 --- a/test/src/test/java/hudson/model/FingerprintCleanupThreadTest.java +++ b/test/src/test/java/hudson/model/FingerprintCleanupThreadTest.java @@ -86,7 +86,7 @@ public void testFingerprintFileIsEmpty() throws IOException { } @Test - public void testGetRecurrencePeriod() throws IOException { + public void testGetRecurrencePeriod() { FingerprintCleanupThread cleanupThread = new FingerprintCleanupThread(); assertEquals("Wrong recurrence period.", PeriodicWork.DAY, cleanupThread.getRecurrencePeriod()); } @@ -248,7 +248,7 @@ protected File getRootDir() { } @Override - protected Fingerprint loadFingerprint(File fingerprintFile) throws IOException { + protected Fingerprint loadFingerprint(File fingerprintFile) { return fingerprintToLoad; } @@ -288,11 +288,11 @@ private static class TestFingerprint extends Fingerprint { private boolean isAlive = true; - TestFingerprint() throws IOException { + TestFingerprint() { super(ptr, "foo", Util.fromHexString(Util.getDigestOf("foo"))); } - TestFingerprint(boolean isAlive) throws IOException { + TestFingerprint(boolean isAlive) { super(ptr, "foo", Util.fromHexString(Util.getDigestOf("foo"))); this.isAlive = isAlive; } @@ -335,7 +335,7 @@ public void iterateAndCleanupFingerprints(TaskListener taskListener) { } @Override - protected Fingerprint getFingerprint(Fingerprint fp) throws IOException { + protected Fingerprint getFingerprint(Fingerprint fp) { return new Fingerprint(ptr, "foo", Util.fromHexString(Util.getDigestOf("foo"))); } diff --git a/test/src/test/java/hudson/model/HudsonTest.java b/test/src/test/java/hudson/model/HudsonTest.java index e06a8ae232c6..f7093a04fc15 100644 --- a/test/src/test/java/hudson/model/HudsonTest.java +++ b/test/src/test/java/hudson/model/HudsonTest.java @@ -191,7 +191,7 @@ public void deleteHudsonComputer() throws Exception { */ @Test @Email("http://www.nabble.com/1.286-version-and-description-The-requested-resource-%28%29-is-not--available.-td22233801.html") - public void legacyDescriptorLookup() throws Exception { + public void legacyDescriptorLookup() { Descriptor dummy = new Descriptor(HudsonTest.class) {}; BuildStep.PUBLISHERS.addRecorder(dummy); diff --git a/test/src/test/java/hudson/model/ItemGroupMixInTest.java b/test/src/test/java/hudson/model/ItemGroupMixInTest.java index 1d6ac469e6f1..08ca57fbb1dc 100644 --- a/test/src/test/java/hudson/model/ItemGroupMixInTest.java +++ b/test/src/test/java/hudson/model/ItemGroupMixInTest.java @@ -69,7 +69,7 @@ public class ItemGroupMixInTest { @Issue("JENKINS-20951") @LocalData - @Test public void xmlFileReadCannotResolveClassException() throws Exception { + @Test public void xmlFileReadCannotResolveClassException() { MockFolder d = r.jenkins.getItemByFullName("d", MockFolder.class); assertNotNull(d); Collection items = d.getItems(); @@ -121,7 +121,7 @@ public void xmlFileFailsToLoad() throws Exception { @LocalData @Issue("JENKINS-22811") @Test - public void xmlFileReadExceptionOnLoad() throws Exception { + public void xmlFileReadExceptionOnLoad() { MockFolder d = r.jenkins.getItemByFullName("d", MockFolder.class); assertNotNull(d); Collection items = d.getItems(); @@ -230,7 +230,7 @@ public void copy_checkGoodName() throws Failure, IOException { @Issue("JENKINS-61956") @Test - public void createProject_checkGoodName() throws Failure, IOException { + public void createProject_checkGoodName() throws Failure { final String badName = "calvin@jenkins"; Failure exception = assertThrows(Failure.class, () -> { r.jenkins.createProject(MockFolder.class, badName); }); @@ -239,7 +239,7 @@ public void createProject_checkGoodName() throws Failure, IOException { @Issue("JENKINS-61956") @Test - public void createProjectFromXML_checkGoodName() throws Failure, IOException { + public void createProjectFromXML_checkGoodName() throws Failure { final String badName = "calvin@jenkins"; final String xml = "\n" + diff --git a/test/src/test/java/hudson/model/JobPropertyTest.java b/test/src/test/java/hudson/model/JobPropertyTest.java index b3384eba3302..ec3f254d15b6 100644 --- a/test/src/test/java/hudson/model/JobPropertyTest.java +++ b/test/src/test/java/hudson/model/JobPropertyTest.java @@ -145,7 +145,7 @@ public static class InvisibleImpl extends JobProperty> { InvisibleImpl() {} @Override - public JobProperty reconfigure(StaplerRequest req, JSONObject form) throws FormException { + public JobProperty reconfigure(StaplerRequest req, JSONObject form) { return this; } diff --git a/test/src/test/java/hudson/model/JobTest.java b/test/src/test/java/hudson/model/JobTest.java index 63371487e102..89d7b7dd6c22 100644 --- a/test/src/test/java/hudson/model/JobTest.java +++ b/test/src/test/java/hudson/model/JobTest.java @@ -265,7 +265,7 @@ private static void tryConfigDotXml(JenkinsRule.WebClient wc, int status, String } @LocalData @Issue("JENKINS-6371") - @Test public void getArtifactsUpTo() throws Exception { + @Test public void getArtifactsUpTo() { // There was a bug where intermediate directories were counted, // so too few artifacts were returned. Run r = j.jenkins.getItemByFullName("testJob", Job.class).getLastCompletedBuild(); @@ -313,7 +313,7 @@ private static void tryConfigDotXml(JenkinsRule.WebClient wc, int status, String j.assertBuildStatusSuccess(p.scheduleBuild2(0)); assertEquals(6, p.getLastSuccessfulBuild().getNumber()); assertEquals(3, RunLoadCounter.assertMaxLoads(p, 1, new Callable() { - @Override public Integer call() throws Exception { + @Override public Integer call() { return p.getLastFailedBuild().getNumber(); } }).intValue()); diff --git a/test/src/test/java/hudson/model/ManagementLinkTest.java b/test/src/test/java/hudson/model/ManagementLinkTest.java index 343006aa6811..e047e8ca150a 100644 --- a/test/src/test/java/hudson/model/ManagementLinkTest.java +++ b/test/src/test/java/hudson/model/ManagementLinkTest.java @@ -63,7 +63,7 @@ public void links() throws Exception { } @Test @Issue("JENKINS-33683") - public void invisibleLinks() throws Exception { + public void invisibleLinks() { assertNull(j.jenkins.getDynamic("and_fail_trying")); } diff --git a/test/src/test/java/hudson/model/MyViewTest.java b/test/src/test/java/hudson/model/MyViewTest.java index 385919427098..efac83311e09 100644 --- a/test/src/test/java/hudson/model/MyViewTest.java +++ b/test/src/test/java/hudson/model/MyViewTest.java @@ -97,7 +97,7 @@ public void testDoCreateItem() throws Exception{ } @Test - public void testGetItems() throws IOException, InterruptedException{ + public void testGetItems() throws IOException { User user = User.getOrCreateByIdOrFullName("User1"); GlobalMatrixAuthorizationStrategy auth = new GlobalMatrixAuthorizationStrategy(); rule.jenkins.setAuthorizationStrategy(auth); diff --git a/test/src/test/java/hudson/model/ParametersDefinitionPropertyTest.java b/test/src/test/java/hudson/model/ParametersDefinitionPropertyTest.java index 95a6c5c73942..0f06cd43a7f6 100644 --- a/test/src/test/java/hudson/model/ParametersDefinitionPropertyTest.java +++ b/test/src/test/java/hudson/model/ParametersDefinitionPropertyTest.java @@ -84,7 +84,7 @@ public ParameterValue createValue(StaplerRequest req) { public static class DescriptorImpl extends ParameterDescriptor { @Override - public ParameterDefinition newInstance(StaplerRequest req, JSONObject formData) throws FormException { + public ParameterDefinition newInstance(StaplerRequest req, JSONObject formData) { return new KrazyParameterDefinition(formData.getString("name"), formData.getString("description"), formData.getString("field").toLowerCase(Locale.ENGLISH)); } diff --git a/test/src/test/java/hudson/model/PeriodicWorkTest.java b/test/src/test/java/hudson/model/PeriodicWorkTest.java index 45b300cede9e..de76308fa2ff 100644 --- a/test/src/test/java/hudson/model/PeriodicWorkTest.java +++ b/test/src/test/java/hudson/model/PeriodicWorkTest.java @@ -45,7 +45,7 @@ public long getInitialDelay() { } @Override - protected void doRun() throws Exception { + protected void doRun() { doneSignal.countDown(); } } diff --git a/test/src/test/java/hudson/model/ProjectTest.java b/test/src/test/java/hudson/model/ProjectTest.java index b0e42d50dc47..de0e6134f963 100644 --- a/test/src/test/java/hudson/model/ProjectTest.java +++ b/test/src/test/java/hudson/model/ProjectTest.java @@ -513,7 +513,7 @@ public void testGetRelationship() throws Exception{ upstream.getPublishersList().add(new ArtifactArchiver("change.log")); downstream.getPublishersList().add(new Fingerprinter("change.log", false)); downstream.getBuildersList().add(new TestBuilder() { - @Override public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { + @Override public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) { for (Run.Artifact a: upstream.getLastBuild().getArtifacts()) { Util.copyFile(a.getFile(), new File(build.getWorkspace().child(a.getFileName()).getRemote())); } @@ -828,7 +828,7 @@ public RequiresWorkspaceSCM(boolean hasChange) { } @Override - public boolean pollChanges(AbstractProject project, Launcher launcher, FilePath workspace, TaskListener listener) throws IOException, InterruptedException { + public boolean pollChanges(AbstractProject project, Launcher launcher, FilePath workspace, TaskListener listener) { return hasChange; } @@ -841,7 +841,7 @@ public boolean requiresWorkspaceForPolling(){ } @Override - protected PollingResult compareRemoteRevisionWith(AbstractProject project, Launcher launcher, FilePath workspace, TaskListener listener, SCMRevisionState baseline) throws IOException, InterruptedException { + protected PollingResult compareRemoteRevisionWith(AbstractProject project, Launcher launcher, FilePath workspace, TaskListener listener, SCMRevisionState baseline) { if(!hasChange) { return PollingResult.NO_CHANGES; } @@ -853,7 +853,7 @@ protected PollingResult compareRemoteRevisionWith(AbstractProject project, Launc public static class AlwaysChangedSCM extends NullSCM { @Override - public boolean pollChanges(AbstractProject project, Launcher launcher, FilePath workspace, TaskListener listener) throws IOException, InterruptedException { + public boolean pollChanges(AbstractProject project, Launcher launcher, FilePath workspace, TaskListener listener) { return true; } @@ -863,7 +863,7 @@ public boolean requiresWorkspaceForPolling(){ } @Override - protected PollingResult compareRemoteRevisionWith(AbstractProject project, Launcher launcher, FilePath workspace, TaskListener listener, SCMRevisionState baseline) throws IOException, InterruptedException { + protected PollingResult compareRemoteRevisionWith(AbstractProject project, Launcher launcher, FilePath workspace, TaskListener listener, SCMRevisionState baseline) { return PollingResult.SIGNIFICANT; } diff --git a/test/src/test/java/hudson/model/QueueTest.java b/test/src/test/java/hudson/model/QueueTest.java index 97002cc419a8..c384cb1cb99b 100644 --- a/test/src/test/java/hudson/model/QueueTest.java +++ b/test/src/test/java/hudson/model/QueueTest.java @@ -111,7 +111,6 @@ import java.util.Map; import java.util.Set; import java.util.concurrent.CancellationException; -import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.TimeUnit; @@ -198,7 +197,7 @@ public class QueueTest { */ @LocalData @Test - public void recover_from_legacy_list() throws Exception { + public void recover_from_legacy_list() { Queue q = r.jenkins.getQueue(); // loaded the legacy queue.xml from test LocalData located in @@ -269,7 +268,7 @@ public void queue_id_to_run_mapping() throws Exception { FreeStyleProject p = r.createFreeStyleProject(); p.getBuildersList().add(new TestBuilder() { @Override - public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { + public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException { seq.phase(0); // first, we let one build going seq.phase(2); @@ -293,7 +292,7 @@ public boolean perform(AbstractBuild build, Launcher launcher, BuildListen public static final class FileItemPersistenceTestServlet extends HttpServlet { private static final long serialVersionUID = 1L; - @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { resp.setContentType("text/html"); resp.getWriter().println( "
" + @@ -302,7 +301,7 @@ public static final class FileItemPersistenceTestServlet extends HttpServlet { ); } - @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException { try { ServletFileUpload f = new ServletFileUpload(new DiskFileItemFactory()); List v = f.parseRequest(req); @@ -354,7 +353,7 @@ public static final class FileItemPersistenceTestServlet extends HttpServlet { // Make build sleep a while so it blocks new builds project.getBuildersList().add(new TestBuilder() { @Override - public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { + public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException { buildStarted.signal(); buildShouldComplete.block(); return true; @@ -489,7 +488,7 @@ public boolean perform(AbstractBuild build, Launcher launcher, BuildListen } @Issue("JENKINS-41127") - @Test public void flyweightTasksUnwantedConcurrency() throws Exception { + @Test public void flyweightTasksUnwantedConcurrency() { Label label = r.jenkins.getSelfLabel(); AtomicInteger cnt = new AtomicInteger(); TestFlyweightTask task1 = new TestFlyweightTask(cnt, label); @@ -624,7 +623,7 @@ static class TestTask implements Queue.Task { @Override public String getDisplayName() {return "Test";} @Override public ResourceList getResourceList() {return new ResourceList();} protected void doRun() {} - @Override public Executable createExecutable() throws IOException { + @Override public Executable createExecutable() { return new Executable() { @Override public SubTask getParent() {return TestTask.this;} @Override public long getEstimatedDuration() {return -1;} @@ -641,7 +640,7 @@ protected void doRun() {} FreeStyleProject p = r.createFreeStyleProject(); p.getBuildersList().add(new TestBuilder() { @Override - public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { + public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException { ev.block(); return true; } @@ -666,7 +665,7 @@ public boolean perform(AbstractBuild build, Launcher launcher, BuildListen QueueItemAuthenticatorConfiguration.get().getAuthenticators().add(new MockQueueItemAuthenticator(Collections.singletonMap(p.getFullName(), alice))); p.getBuildersList().add(new TestBuilder() { @Override - public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { + public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) { assertEquals(alice2, Jenkins.getAuthentication2()); return true; } @@ -693,7 +692,7 @@ public boolean perform(AbstractBuild build, Launcher launcher, BuildListen QueueItemAuthenticatorConfiguration.get().getAuthenticators().add(new MockQueueItemAuthenticator(Collections.singletonMap(p.getFullName(), alice))); p.getBuildersList().add(new TestBuilder() { @Override - public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { + public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) { assertEquals(alice2, Jenkins.getAuthentication2()); return true; } @@ -732,7 +731,7 @@ public ACL getACL(Node node) { } } - @Test public void pendingsConsistenceAfterErrorDuringMaintain() throws IOException, ExecutionException, InterruptedException{ + @Test public void pendingsConsistenceAfterErrorDuringMaintain() throws IOException, InterruptedException{ FreeStyleProject project1 = r.createFreeStyleProject(); FreeStyleProject project2 = r.createFreeStyleProject(); TopLevelItemDescriptor descriptor = new TopLevelItemDescriptor(FreeStyleProject.class){ diff --git a/test/src/test/java/hudson/model/RunTest.java b/test/src/test/java/hudson/model/RunTest.java index 516fd5a0871b..24159b701fc3 100644 --- a/test/src/test/java/hudson/model/RunTest.java +++ b/test/src/test/java/hudson/model/RunTest.java @@ -220,11 +220,11 @@ public FullNameChangingProject newInstance(ItemGroup parent, String name) { public static final class Mgr extends ArtifactManager { static final AtomicBoolean deleted = new AtomicBoolean(); - @Override public boolean delete() throws IOException, InterruptedException { + @Override public boolean delete() { return !deleted.getAndSet(true); } @Override public void onLoad(Run build) {} - @Override public void archive(FilePath workspace, Launcher launcher, BuildListener listener, Map artifacts) throws IOException, InterruptedException {} + @Override public void archive(FilePath workspace, Launcher launcher, BuildListener listener, Map artifacts) {} @Override public VirtualFile root() { return VirtualFile.forFile(Jenkins.get().getRootDir()); // irrelevant } diff --git a/test/src/test/java/hudson/model/SimpleJobTest.java b/test/src/test/java/hudson/model/SimpleJobTest.java index 04b18637523b..e623b6111047 100644 --- a/test/src/test/java/hudson/model/SimpleJobTest.java +++ b/test/src/test/java/hudson/model/SimpleJobTest.java @@ -68,7 +68,7 @@ public void testGetEstimatedDurationWithFailedRun() throws IOException { } @Test - public void testGetEstimatedDurationWithNoRuns() throws IOException { + public void testGetEstimatedDurationWithNoRuns() { final SortedMap runs = new TreeMap<>(); @@ -162,7 +162,7 @@ private class TestJob extends Job implements TopLevelItem { } @Override - public int assignBuildNumber() throws IOException { + public int assignBuildNumber() { return i++; } diff --git a/test/src/test/java/hudson/model/UpdateCenterCustomTest.java b/test/src/test/java/hudson/model/UpdateCenterCustomTest.java index e246640fa05e..69d95d7f9469 100644 --- a/test/src/test/java/hudson/model/UpdateCenterCustomTest.java +++ b/test/src/test/java/hudson/model/UpdateCenterCustomTest.java @@ -41,7 +41,7 @@ public class UpdateCenterCustomTest { public final JenkinsRule j = new CustomUpdateCenterRule(CustomUpdateCenter.class); @Test - public void shouldStartupWithCustomUpdateCenter() throws Exception { + public void shouldStartupWithCustomUpdateCenter() { UpdateCenter uc = j.jenkins.getUpdateCenter(); assertThat("Update Center must be a custom instance", uc, instanceOf(CustomUpdateCenter.class)); } @@ -65,7 +65,7 @@ protected ServletContext createWebServer() throws Exception { } @Override - public void after() throws Exception { + public void after() { if (_oldValue != null) { System.setProperty(PROPERTY_NAME, _oldValue); } diff --git a/test/src/test/java/hudson/model/UpdateCenterTest.java b/test/src/test/java/hudson/model/UpdateCenterTest.java index 05993b8bedc9..630522f62d5a 100644 --- a/test/src/test/java/hudson/model/UpdateCenterTest.java +++ b/test/src/test/java/hudson/model/UpdateCenterTest.java @@ -46,7 +46,7 @@ * @author Kohsuke Kawaguchi */ public class UpdateCenterTest { - @Test public void data() throws Exception { + @Test public void data() { try { doData("https://updates.jenkins.io/update-center.json?version=build"); doData("https://updates.jenkins.io/stable/update-center.json?version=build"); diff --git a/test/src/test/java/hudson/model/UpdateSiteTest.java b/test/src/test/java/hudson/model/UpdateSiteTest.java index 1c43066fe5a5..2928162f0e57 100644 --- a/test/src/test/java/hudson/model/UpdateSiteTest.java +++ b/test/src/test/java/hudson/model/UpdateSiteTest.java @@ -46,7 +46,6 @@ import java.util.List; import java.util.jar.Attributes; import java.util.jar.Manifest; -import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import jenkins.model.Jenkins; @@ -91,7 +90,7 @@ public void setUpWebServer() throws Exception { server.addConnector(connector); server.setHandler(new AbstractHandler() { @Override - public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { + public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException { if (target.startsWith(RELATIVE_BASE)) { target = target.substring(RELATIVE_BASE.length()); } @@ -158,7 +157,7 @@ public void shutdownWebserver() throws Exception { assertNotNull(us.getPlugin("AdaptivePlugin")); } - @Test public void lackOfDataDoesNotFailWarningsCode() throws Exception { + @Test public void lackOfDataDoesNotFailWarningsCode() { assertNull("plugin data is not present", j.jenkins.getUpdateCenter().getSite("default").getData()); // nothing breaking? @@ -205,7 +204,7 @@ public void isPluginUpdateCompatible() throws Exception { } @Issue("JENKINS-31448") - @Test public void isLegacyDefault() throws Exception { + @Test public void isLegacyDefault() { assertFalse("isLegacyDefault should be false with null id",new UpdateSite(null,"url").isLegacyDefault()); assertFalse("isLegacyDefault should be false when id is not default and url is http://hudson-ci.org/",new UpdateSite("dummy","http://hudson-ci.org/").isLegacyDefault()); assertTrue("isLegacyDefault should be true when id is default and url is http://hudson-ci.org/",new UpdateSite(UpdateCenter.PREDEFINED_UPDATE_SITE_ID,"http://hudson-ci.org/").isLegacyDefault()); diff --git a/test/src/test/java/hudson/model/UserIdMigratorTest.java b/test/src/test/java/hudson/model/UserIdMigratorTest.java index 0163e45a2de2..90fffb7ee04f 100644 --- a/test/src/test/java/hudson/model/UserIdMigratorTest.java +++ b/test/src/test/java/hudson/model/UserIdMigratorTest.java @@ -26,10 +26,8 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -import java.io.IOException; import org.junit.Rule; import org.junit.Test; -import org.jvnet.hudson.reactor.ReactorException; import org.jvnet.hudson.test.JenkinsRule; import org.jvnet.hudson.test.recipes.LocalData; @@ -39,7 +37,7 @@ public class UserIdMigratorTest { @Test @LocalData - public void migrateSimpleUser() throws InterruptedException, ReactorException, IOException { + public void migrateSimpleUser() { String userId = "fred"; User fred = User.getById(userId, false); assertThat(fred.getFullName(), is("Fred Smith")); @@ -47,7 +45,7 @@ public void migrateSimpleUser() throws InterruptedException, ReactorException, I @Test @LocalData - public void migrateMultipleUsers() throws InterruptedException, ReactorException, IOException { + public void migrateMultipleUsers() { assertThat(User.getAll().size(), is(3)); User fred = User.getById("fred", false); assertThat(fred.getFullName(), is("Fred Smith")); diff --git a/test/src/test/java/hudson/model/UserTest.java b/test/src/test/java/hudson/model/UserTest.java index ef61a877a8ca..390165df9e6b 100644 --- a/test/src/test/java/hudson/model/UserTest.java +++ b/test/src/test/java/hudson/model/UserTest.java @@ -156,7 +156,7 @@ public UserProperty newInstance(User user) { j.assertAllImageLoadSuccessfully(page); } - @Test public void getAuthorities() throws Exception { + @Test public void getAuthorities() { JenkinsRule.DummySecurityRealm realm = j.createDummySecurityRealm(); realm.addGroups("administrator", "admins"); realm.addGroups("alice", "users"); @@ -585,7 +585,7 @@ public void resolveByIdThenName() throws Exception{ @Issue("SECURITY-243") @Test - public void resolveByUnloadedIdThenName() throws Exception { + public void resolveByUnloadedIdThenName() { j.jenkins.setSecurityRealm(new ExternalSecurityRealm()); // do *not* call this here: User.get("victim"); User attacker1 = User.get("attacker1"); diff --git a/test/src/test/java/hudson/model/ViewPropertyTest.java b/test/src/test/java/hudson/model/ViewPropertyTest.java index 12b5420a4530..b9d918bd4482 100644 --- a/test/src/test/java/hudson/model/ViewPropertyTest.java +++ b/test/src/test/java/hudson/model/ViewPropertyTest.java @@ -31,7 +31,6 @@ import com.gargoylesoftware.htmlunit.html.DomNodeUtil; import com.gargoylesoftware.htmlunit.html.HtmlForm; import com.gargoylesoftware.htmlunit.html.HtmlLabel; -import hudson.model.Descriptor.FormException; import net.sf.json.JSONObject; import org.junit.Rule; import org.junit.Test; @@ -100,7 +99,7 @@ public static class InvisiblePropertyImpl extends ViewProperty { } @Override - public ViewProperty reconfigure(StaplerRequest req, JSONObject form) throws FormException { + public ViewProperty reconfigure(StaplerRequest req, JSONObject form) { return this; } diff --git a/test/src/test/java/hudson/model/ViewTest.java b/test/src/test/java/hudson/model/ViewTest.java index 9d0facf8bfb7..82bc39c922a3 100644 --- a/test/src/test/java/hudson/model/ViewTest.java +++ b/test/src/test/java/hudson/model/ViewTest.java @@ -84,7 +84,6 @@ import java.util.Map; import java.util.logging.Level; import java.util.logging.LogRecord; -import javax.servlet.ServletException; import jenkins.model.Jenkins; import jenkins.model.ProjectNamingStrategy; import jenkins.security.NotReallyRoleSensitiveCallable; @@ -542,7 +541,7 @@ public String getDisplayName() { grant(Item.CREATE).onFolders(d1).to("dev")); // not on root or d2 ACL.impersonate2(Jenkins.ANONYMOUS2, new NotReallyRoleSensitiveCallable() { @Override - public Void call() throws Exception { + public Void call() { try { assertCheckJobName(j.jenkins, "whatever", FormValidation.Kind.OK); fail("should not have been allowed"); @@ -554,7 +553,7 @@ public Void call() throws Exception { }); ACL.impersonate2(User.get("dev").impersonate2(), new NotReallyRoleSensitiveCallable() { @Override - public Void call() throws Exception { + public Void call() { try { assertCheckJobName(j.jenkins, "whatever", FormValidation.Kind.OK); fail("should not have been allowed"); @@ -573,7 +572,7 @@ public Void call() throws Exception { }); ACL.impersonate2(User.get("admin").impersonate2(), new NotReallyRoleSensitiveCallable() { @Override - public Void call() throws Exception { + public Void call() { assertCheckJobName(j.jenkins, "whatever", FormValidation.Kind.OK); assertCheckJobName(d1, "whatever", FormValidation.Kind.OK); assertCheckJobName(d2, "whatever", FormValidation.Kind.OK); @@ -629,14 +628,14 @@ public List getItems() { @Test @Issue("JENKINS-36908") @LocalData - public void testAllViewCreatedIfNoPrimary() throws Exception { + public void testAllViewCreatedIfNoPrimary() { assertNotNull(j.getInstance().getView("All")); } @Test @Issue("JENKINS-36908") @LocalData - public void testAllViewNotCreatedIfPrimary() throws Exception { + public void testAllViewNotCreatedIfPrimary() { assertNull(j.getInstance().getView("All")); } @@ -1067,11 +1066,11 @@ public boolean contains(TopLevelItem item) { } @Override - protected void submit(StaplerRequest req) throws IOException, ServletException, Descriptor.FormException { + protected void submit(StaplerRequest req) { } @Override - public Item doCreateItem(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { + public Item doCreateItem(StaplerRequest req, StaplerResponse rsp) { return null; } } diff --git a/test/src/test/java/hudson/model/WorkspaceCleanupThreadTest.java b/test/src/test/java/hudson/model/WorkspaceCleanupThreadTest.java index b1c4e9e8811c..8e9a511ab2ac 100644 --- a/test/src/test/java/hudson/model/WorkspaceCleanupThreadTest.java +++ b/test/src/test/java/hudson/model/WorkspaceCleanupThreadTest.java @@ -210,7 +210,7 @@ private static final class VetoSCM extends NullSCM { @Override public boolean processWorkspaceBeforeDeletion( Job project, FilePath workspace, Node node - ) throws IOException, InterruptedException { + ) { return answer; } } @@ -223,7 +223,7 @@ private static final class Touch extends MasterToSlaveFileCallable { this.time = time; } - @Override public Void invoke(File f, VirtualChannel channel) throws IOException, InterruptedException { + @Override public Void invoke(File f, VirtualChannel channel) { Assume.assumeTrue("failed to reset lastModified on " + f, f.setLastModified(time)); return null; } diff --git a/test/src/test/java/hudson/model/labels/LabelAtomSecurity1986Test.java b/test/src/test/java/hudson/model/labels/LabelAtomSecurity1986Test.java index 747d2302faf2..7f8061191015 100644 --- a/test/src/test/java/hudson/model/labels/LabelAtomSecurity1986Test.java +++ b/test/src/test/java/hudson/model/labels/LabelAtomSecurity1986Test.java @@ -45,7 +45,7 @@ public class LabelAtomSecurity1986Test { public JenkinsRule j = new JenkinsRule(); @Test - public void nonexisting() throws Exception { + public void nonexisting() { LabelAtom nonexistent = j.jenkins.getLabelAtom("nonexistent"); XmlFile configFile = nonexistent.getConfigFile(); assertFalse(configFile.getFile().exists()); @@ -62,7 +62,7 @@ public void normal() throws Exception { @Test @Issue("SECURITY-1986") - public void startsWithDoubleDotSlash() throws Exception { + public void startsWithDoubleDotSlash() { FailingHttpStatusCodeException e = assertThrows("Should have rejected label.", FailingHttpStatusCodeException.class, () -> j.submit(j.createWebClient().goTo("labelAtom/..%2ffoo/configure").getFormByName("config"))); assertThat(e.getStatusCode(), is(HttpURLConnection.HTTP_BAD_REQUEST)); LabelAtom foo = j.jenkins.getLabelAtom("../foo"); @@ -91,7 +91,7 @@ public void startsWithDoubleDot() throws Exception { @Test @Issue("SECURITY-1986") - public void endsWithDoubleDotSlash() throws Exception { + public void endsWithDoubleDotSlash() { FailingHttpStatusCodeException e = assertThrows("Should have rejected label.", FailingHttpStatusCodeException.class, () -> j.submit(j.createWebClient().goTo("labelAtom/foo..%2f/configure").getFormByName("config"))); assertThat(e.getStatusCode(), is(HttpURLConnection.HTTP_BAD_REQUEST)); LabelAtom foo = j.jenkins.getLabelAtom("foo../"); @@ -110,7 +110,7 @@ public void endsWithDoubleDot() throws Exception { @Test @Issue("SECURITY-1986") - public void startsWithDoubleDotBackslash() throws Exception { + public void startsWithDoubleDotBackslash() { FailingHttpStatusCodeException e = assertThrows("Should have rejected label.", FailingHttpStatusCodeException.class, () -> j.submit(j.createWebClient().goTo("labelAtom/..\\foo/configure").getFormByName("config"))); assertThat(e.getStatusCode(), is(HttpURLConnection.HTTP_BAD_REQUEST)); LabelAtom foo = j.jenkins.getLabelAtom("..\\foo"); @@ -120,7 +120,7 @@ public void startsWithDoubleDotBackslash() throws Exception { @Test @Issue("SECURITY-1986") - public void endsWithDoubleDotBackslash() throws Exception { + public void endsWithDoubleDotBackslash() { FailingHttpStatusCodeException e = assertThrows("Should have rejected label.", FailingHttpStatusCodeException.class, () -> j.submit(j.createWebClient().goTo("labelAtom/foo..\\/configure").getFormByName("config"))); assertThat(e.getStatusCode(), is(HttpURLConnection.HTTP_BAD_REQUEST)); LabelAtom foo = j.jenkins.getLabelAtom("foo..\\"); @@ -130,7 +130,7 @@ public void endsWithDoubleDotBackslash() throws Exception { @Test @Issue("SECURITY-1986") - public void middleDotsSlashes() throws Exception { + public void middleDotsSlashes() { FailingHttpStatusCodeException e = assertThrows("Should have rejected label.", FailingHttpStatusCodeException.class, () -> j.submit(j.createWebClient().goTo("labelAtom/foo%2f..%2fgoo/configure").getFormByName("config"))); assertThat(e.getStatusCode(), is(HttpURLConnection.HTTP_BAD_REQUEST)); LabelAtom foo = j.jenkins.getLabelAtom("foo/../goo"); @@ -140,7 +140,7 @@ public void middleDotsSlashes() throws Exception { @Test @Issue("SECURITY-1986") - public void middleDotsBackslashes() throws Exception { + public void middleDotsBackslashes() { FailingHttpStatusCodeException e = assertThrows("Should have rejected label.", FailingHttpStatusCodeException.class, () -> j.submit(j.createWebClient().goTo("labelAtom/foo%\\..\\goo/configure").getFormByName("config"))); assertThat(e.getStatusCode(), is(HttpURLConnection.HTTP_BAD_REQUEST)); LabelAtom foo = j.jenkins.getLabelAtom("foo\\..\\"); @@ -167,7 +167,7 @@ public void programmaticCreation() throws IOException { @Test @Issue("SECURITY-1986") - public void startsWithTripleDotBackslash() throws Exception { + public void startsWithTripleDotBackslash() { FailingHttpStatusCodeException e = assertThrows("Should have rejected label.", FailingHttpStatusCodeException.class, () -> j.submit(j.createWebClient().goTo("labelAtom/...%2ffoo/configure").getFormByName("config"))); assertThat(e.getStatusCode(), is(HttpURLConnection.HTTP_BAD_REQUEST)); LabelAtom foo = j.jenkins.getLabelAtom(".../foo"); diff --git a/test/src/test/java/hudson/model/labels/LabelExpressionTest.java b/test/src/test/java/hudson/model/labels/LabelExpressionTest.java index 26ad53c9bd36..812ebdd85551 100644 --- a/test/src/test/java/hudson/model/labels/LabelExpressionTest.java +++ b/test/src/test/java/hudson/model/labels/LabelExpressionTest.java @@ -43,7 +43,6 @@ import hudson.model.Node.Mode; import hudson.slaves.DumbSlave; import hudson.slaves.RetentionStrategy; -import java.io.IOException; import java.lang.reflect.Field; import java.util.Collections; import java.util.Set; @@ -78,7 +77,7 @@ public void queueBehavior1() throws Exception { FreeStyleProject p1 = j.createFreeStyleProject(); p1.getBuildersList().add(new TestBuilder() { @Override - public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { + public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException { seq.phase(0); // first, make sure the w32 agent is occupied seq.phase(2); seq.done(); @@ -184,7 +183,7 @@ private void parseAndVerify(String expected, String expr) throws ANTLRException } @Test - public void parserError() throws Exception { + public void parserError() { parseShouldFail("foo bar"); parseShouldFail("foo (bar)"); parseShouldFail("foo(bar)"); @@ -368,7 +367,7 @@ public Object call() throws Exception { } @Test - public void parseLabel() throws Exception { + public void parseLabel() { Set result = Label.parse("one two three"); String[] expected = {"one", "two", "three"}; diff --git a/test/src/test/java/hudson/model/listeners/ItemListenerTest.java b/test/src/test/java/hudson/model/listeners/ItemListenerTest.java index 3583a11aef59..520bb8783875 100644 --- a/test/src/test/java/hudson/model/listeners/ItemListenerTest.java +++ b/test/src/test/java/hudson/model/listeners/ItemListenerTest.java @@ -47,7 +47,7 @@ public class ItemListenerTest { private StringBuffer events = new StringBuffer(); @Before - public void setUp() throws Exception { + public void setUp() { ItemListener listener = new ItemListener() { @Override public void onCreated(Item item) { events.append('C'); @@ -60,7 +60,7 @@ public void setUp() throws Exception { } @Test - public void onCreatedViaCLI() throws Exception { + public void onCreatedViaCLI() { CLICommandInvoker.Result result = new CLICommandInvoker(j, "create-job"). withStdin(new ByteArrayInputStream("".getBytes())). invokeWithArgs("testJob"); diff --git a/test/src/test/java/hudson/model/queue/BuildKeepsRunningWhenFaultySubTasksTest.java b/test/src/test/java/hudson/model/queue/BuildKeepsRunningWhenFaultySubTasksTest.java index 26f3b0cac4dd..7c81f20bf976 100644 --- a/test/src/test/java/hudson/model/queue/BuildKeepsRunningWhenFaultySubTasksTest.java +++ b/test/src/test/java/hudson/model/queue/BuildKeepsRunningWhenFaultySubTasksTest.java @@ -10,7 +10,6 @@ import hudson.model.Node; import hudson.model.Queue; import hudson.model.ResourceList; -import java.io.IOException; import java.util.Collection; import java.util.Collections; import java.util.concurrent.TimeUnit; @@ -47,7 +46,7 @@ public Collection forProject(final AbstractProject p) { private final SubTask outer = this; @Override - public Queue.Executable createExecutable() throws IOException { + public Queue.Executable createExecutable() { return new Queue.Executable() { @Override public SubTask getParent() { diff --git a/test/src/test/java/hudson/model/queue/LoadPredictorTest.java b/test/src/test/java/hudson/model/queue/LoadPredictorTest.java index 44a668100928..d48574b130a6 100644 --- a/test/src/test/java/hudson/model/queue/LoadPredictorTest.java +++ b/test/src/test/java/hudson/model/queue/LoadPredictorTest.java @@ -93,7 +93,7 @@ private BuildableItem wrap(Queue.Task t) { return new BuildableItem(new WaitingItem(new GregorianCalendar(),t,new ArrayList<>())); } - private JobOffer createMockOffer(Executor e) throws NoSuchFieldException, IllegalAccessException { + private JobOffer createMockOffer(Executor e) { JobOffer o = mock(JobOffer.class); when(o.getExecutor()).thenReturn(e); return o; diff --git a/test/src/test/java/hudson/model/queue/WideExecutionTest.java b/test/src/test/java/hudson/model/queue/WideExecutionTest.java index e9d4cf519e40..2bfd6f396233 100644 --- a/test/src/test/java/hudson/model/queue/WideExecutionTest.java +++ b/test/src/test/java/hudson/model/queue/WideExecutionTest.java @@ -56,7 +56,7 @@ public Collection forProject(final AbstractProject p) { return Collections.singleton(new SubTask() { private final SubTask outer = this; @Override - public Executable createExecutable() throws IOException { + public Executable createExecutable() { return new Executable() { @Override public SubTask getParent() { diff --git a/test/src/test/java/hudson/pages/SystemConfigurationTestCase.java b/test/src/test/java/hudson/pages/SystemConfigurationTestCase.java index 30b702cbd22b..1bc4d88558f2 100644 --- a/test/src/test/java/hudson/pages/SystemConfigurationTestCase.java +++ b/test/src/test/java/hudson/pages/SystemConfigurationTestCase.java @@ -69,7 +69,7 @@ private static class PageDecoratorImpl extends PageDecorator { private String decoratorId; @Override - public boolean configure(StaplerRequest req, JSONObject json) throws FormException { + public boolean configure(StaplerRequest req, JSONObject json) { decoratorId = json.getString("decoratorId"); return true; } diff --git a/test/src/test/java/hudson/scm/AbstractScmTagActionTest.java b/test/src/test/java/hudson/scm/AbstractScmTagActionTest.java index 9876531fb861..065bcbfdfa6f 100644 --- a/test/src/test/java/hudson/scm/AbstractScmTagActionTest.java +++ b/test/src/test/java/hudson/scm/AbstractScmTagActionTest.java @@ -42,7 +42,6 @@ import hudson.model.Run; import hudson.model.TaskListener; import java.io.File; -import java.io.IOException; import org.junit.Rule; import org.junit.Test; import org.jvnet.hudson.test.Issue; @@ -108,7 +107,7 @@ public ChangeLogParser createChangeLogParser() { } @Override - public void checkout(@NonNull Run build, @NonNull Launcher launcher, @NonNull FilePath workspace, @NonNull TaskListener listener, @CheckForNull File changelogFile, @CheckForNull SCMRevisionState baseline) throws IOException, InterruptedException { + public void checkout(@NonNull Run build, @NonNull Launcher launcher, @NonNull FilePath workspace, @NonNull TaskListener listener, @CheckForNull File changelogFile, @CheckForNull SCMRevisionState baseline) { build.addAction(new TooltipTagAction(build, desiredTooltip)); } } diff --git a/test/src/test/java/hudson/scm/ScmTest.java b/test/src/test/java/hudson/scm/ScmTest.java index 1eb5a12e34e1..e95034c6c373 100644 --- a/test/src/test/java/hudson/scm/ScmTest.java +++ b/test/src/test/java/hudson/scm/ScmTest.java @@ -36,7 +36,6 @@ import hudson.model.Node; import hudson.model.Result; import java.io.File; -import java.io.IOException; import org.junit.Rule; import org.junit.Test; import org.jvnet.hudson.test.Issue; @@ -84,7 +83,7 @@ public void abortDuringCheckoutMarksBuildAsAborted() throws Exception { public boolean checkout(AbstractBuild build, Launcher launcher, FilePath remoteDir, BuildListener listener, File changeLogFile) - throws IOException, InterruptedException { + throws InterruptedException { throw new InterruptedException(); } diff --git a/test/src/test/java/hudson/security/AccessDeniedException3Test.java b/test/src/test/java/hudson/security/AccessDeniedException3Test.java index 78ad684eb494..6a766bbb6912 100644 --- a/test/src/test/java/hudson/security/AccessDeniedException3Test.java +++ b/test/src/test/java/hudson/security/AccessDeniedException3Test.java @@ -51,7 +51,7 @@ public class AccessDeniedException3Test { @Issue("JENKINS-39402") @Test - public void youAreInGroupHeaders() throws Exception { + public void youAreInGroupHeaders() { JenkinsRule.DummySecurityRealm realm = r.createDummySecurityRealm(); String[] groups = new String[1000]; for (int i = 0; i < groups.length; i++) { diff --git a/test/src/test/java/hudson/security/ExtendedReadPermissionTest.java b/test/src/test/java/hudson/security/ExtendedReadPermissionTest.java index 996227f328fa..b385e0834d58 100644 --- a/test/src/test/java/hudson/security/ExtendedReadPermissionTest.java +++ b/test/src/test/java/hudson/security/ExtendedReadPermissionTest.java @@ -46,7 +46,7 @@ public class ExtendedReadPermissionTest { grant(Jenkins.READ, Item.READ, Item.EXTENDED_READ).everywhere().to("charlie")); } - private void setPermissionEnabled(boolean enabled) throws Exception { + private void setPermissionEnabled(boolean enabled) { Item.EXTENDED_READ.setEnabled(enabled); } diff --git a/test/src/test/java/hudson/security/HudsonPrivateSecurityRealmTest.java b/test/src/test/java/hudson/security/HudsonPrivateSecurityRealmTest.java index 8ad17517af99..4ba76a0dedb8 100644 --- a/test/src/test/java/hudson/security/HudsonPrivateSecurityRealmTest.java +++ b/test/src/test/java/hudson/security/HudsonPrivateSecurityRealmTest.java @@ -513,7 +513,7 @@ public void createAccountSupportsHashedPasswords() throws Exception { } @Test - public void createAccountWithHashedPasswordRequiresPrefix() throws Exception { + public void createAccountWithHashedPasswordRequiresPrefix() { HudsonPrivateSecurityRealm securityRealm = new HudsonPrivateSecurityRealm(false, false, null); j.jenkins.setSecurityRealm(securityRealm); assertThrows(IllegalArgumentException.class, () -> securityRealm.createAccountWithHashedPassword("user_hashed", BCrypt.hashpw("password", BCrypt.gensalt()))); diff --git a/test/src/test/java/hudson/security/SecurityRealmTest.java b/test/src/test/java/hudson/security/SecurityRealmTest.java index 71add608428c..55448bc3c8a5 100644 --- a/test/src/test/java/hudson/security/SecurityRealmTest.java +++ b/test/src/test/java/hudson/security/SecurityRealmTest.java @@ -34,7 +34,6 @@ import com.gargoylesoftware.htmlunit.util.Cookie; import hudson.model.Descriptor; import hudson.security.captcha.CaptchaSupport; -import java.io.IOException; import java.io.OutputStream; import java.util.Calendar; import java.util.Collections; @@ -85,7 +84,7 @@ public boolean validateCaptcha(String id, String text) { } @Override - public void generateImage(String id, OutputStream ios) throws IOException { + public void generateImage(String id, OutputStream ios) { } } diff --git a/test/src/test/java/hudson/slaves/CloudTest.java b/test/src/test/java/hudson/slaves/CloudTest.java index c51bbd4c3999..548871200492 100644 --- a/test/src/test/java/hudson/slaves/CloudTest.java +++ b/test/src/test/java/hudson/slaves/CloudTest.java @@ -35,7 +35,7 @@ public class CloudTest { @Rule public JenkinsRule j = new JenkinsRule(); @Test @WithoutJenkins @Issue("JENKINS-37616") - public void provisionPermissionShouldBeIndependentFromAdminister() throws Exception { + public void provisionPermissionShouldBeIndependentFromAdminister() { SidACL acl = new SidACL() { @Override protected Boolean hasPermission(Sid p, Permission permission) { return permission == Cloud.PROVISION; @@ -48,7 +48,7 @@ public void provisionPermissionShouldBeIndependentFromAdminister() throws Except } @Test @Issue("JENKINS-37616") - public void ensureProvisionPermissionIsLoadable() throws Exception { + public void ensureProvisionPermissionIsLoadable() { // Name introduced by JENKINS-37616 Permission p = Permission.fromId("hudson.model.Computer.Provision"); assertEquals("Provision", p.name); diff --git a/test/src/test/java/hudson/slaves/JNLPLauncherTest.java b/test/src/test/java/hudson/slaves/JNLPLauncherTest.java index bc51eedb42ed..81ce8c714a77 100644 --- a/test/src/test/java/hudson/slaves/JNLPLauncherTest.java +++ b/test/src/test/java/hudson/slaves/JNLPLauncherTest.java @@ -135,7 +135,7 @@ public void testHeadlessLaunchWithCustomWorkDir() throws Exception { @Test @LocalData @Issue("JENKINS-44112") - public void testNoWorkDirMigration() throws Exception { + public void testNoWorkDirMigration() { Computer computer = j.jenkins.getComputer("Foo"); assertThat(computer, instanceOf(SlaveComputer.class)); @@ -152,7 +152,7 @@ public void testNoWorkDirMigration() throws Exception { @Test @Issue("JENKINS-44112") @SuppressWarnings("deprecation") - public void testDefaults() throws Exception { + public void testDefaults() { assertTrue("Work directory should be disabled for agents created via old API", new JNLPLauncher().getWorkDirSettings().isDisabled()); } diff --git a/test/src/test/java/hudson/slaves/NodePropertyTest.java b/test/src/test/java/hudson/slaves/NodePropertyTest.java index 0810a40bcd31..913757f44fb2 100644 --- a/test/src/test/java/hudson/slaves/NodePropertyTest.java +++ b/test/src/test/java/hudson/slaves/NodePropertyTest.java @@ -10,7 +10,6 @@ import com.gargoylesoftware.htmlunit.html.HtmlForm; import com.gargoylesoftware.htmlunit.html.HtmlLabel; import hudson.model.Descriptor; -import hudson.model.Descriptor.FormException; import hudson.model.Slave; import java.util.logging.Level; import net.sf.json.JSONObject; @@ -53,7 +52,7 @@ public static class InvisibleProperty extends NodeProperty { boolean reconfigured = false; @Override - public NodeProperty reconfigure(StaplerRequest req, JSONObject form) throws FormException { + public NodeProperty reconfigure(StaplerRequest req, JSONObject form) { reconfigured = true; return this; } diff --git a/test/src/test/java/hudson/slaves/NodeProvisionerTest.java b/test/src/test/java/hudson/slaves/NodeProvisionerTest.java index 9e9d618ec108..5e3b900451fa 100644 --- a/test/src/test/java/hudson/slaves/NodeProvisionerTest.java +++ b/test/src/test/java/hudson/slaves/NodeProvisionerTest.java @@ -81,7 +81,7 @@ void block() throws InterruptedException { public Builder createBuilder() { return new Builder() { @Override - public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { + public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException { block(); return true; } diff --git a/test/src/test/java/hudson/slaves/PingThreadTest.java b/test/src/test/java/hudson/slaves/PingThreadTest.java index 36f66fd8954a..d283f15bca38 100644 --- a/test/src/test/java/hudson/slaves/PingThreadTest.java +++ b/test/src/test/java/hudson/slaves/PingThreadTest.java @@ -86,7 +86,7 @@ public void failedPingThreadResetsComputerChannel() throws Exception { } private static final class GetPid extends MasterToSlaveCallable { - @Override public String call() throws IOException { + @Override public String call() { return ManagementFactory.getRuntimeMXBean().getName().replaceAll("@.*", ""); } } diff --git a/test/src/test/java/hudson/slaves/SlaveComputerTest.java b/test/src/test/java/hudson/slaves/SlaveComputerTest.java index 73b9f1aa4eaf..1db74056ce1e 100644 --- a/test/src/test/java/hudson/slaves/SlaveComputerTest.java +++ b/test/src/test/java/hudson/slaves/SlaveComputerTest.java @@ -119,7 +119,7 @@ public static final class IOExceptionOnOnlineListener extends ComputerListener { static int onOnlineCount = 0; @Override - public void onOnline(Computer c, TaskListener listener) throws IOException, InterruptedException { + public void onOnline(Computer c, TaskListener listener) throws IOException { if (c instanceof SlaveComputer) { onOnlineCount++; throw new IOException("Something happened (the listener always throws this exception)"); @@ -133,7 +133,7 @@ public static final class RuntimeExceptionOnOnlineListener extends ComputerListe static int onOnlineCount = 0; @Override - public void onOnline(Computer c, TaskListener listener) throws IOException, InterruptedException { + public void onOnline(Computer c, TaskListener listener) { if (c instanceof SlaveComputer) { onOnlineCount++; throw new RuntimeException("Something happened (the listener always throws this exception)"); @@ -167,7 +167,7 @@ public static final class ErrorOnOnlineListener extends ComputerListener { static volatile int onOnlineCount = 0; @Override - public void onOnline(Computer c, TaskListener listener) throws IOException, InterruptedException { + public void onOnline(Computer c, TaskListener listener) { if (c instanceof SlaveComputer) { onOnlineCount++; throw new IOError(new Exception("Something happened (the listener always throws this exception)")); diff --git a/test/src/test/java/hudson/tasks/ArtifactArchiverTest.java b/test/src/test/java/hudson/tasks/ArtifactArchiverTest.java index 60f1656ee2a4..852f3a31c8ed 100644 --- a/test/src/test/java/hudson/tasks/ArtifactArchiverTest.java +++ b/test/src/test/java/hudson/tasks/ArtifactArchiverTest.java @@ -444,7 +444,7 @@ public void lengthOfArtifactIsCorrect_eventForInvalidSymlink() throws Exception private static class RemoveReadPermission extends MasterToSlaveFileCallable { @Override - public Object invoke(File f, VirtualChannel channel) throws IOException, InterruptedException { + public Object invoke(File f, VirtualChannel channel) throws IOException { assertTrue(f.createNewFile()); assertTrue(f.setReadable(false)); return null; diff --git a/test/src/test/java/hudson/tasks/BatchFileTest.java b/test/src/test/java/hudson/tasks/BatchFileTest.java index e846e7930f27..08d5232c9799 100644 --- a/test/src/test/java/hudson/tasks/BatchFileTest.java +++ b/test/src/test/java/hudson/tasks/BatchFileTest.java @@ -9,7 +9,6 @@ import hudson.Proc; import hudson.model.FreeStyleProject; import hudson.model.Result; -import java.io.IOException; import org.junit.Rule; import org.junit.Test; import org.jvnet.hudson.test.FakeLauncher; @@ -30,13 +29,13 @@ public class BatchFileTest { @Issue("JENKINS-7478") @Test - public void validateBatchFileCommandEOL() throws Exception { + public void validateBatchFileCommandEOL() { BatchFile obj = new BatchFile("echo A\necho B\recho C"); rule.assertStringContains(obj.getCommand(), "echo A\r\necho B\r\necho C"); } @Test - public void validateBatchFileContents() throws Exception { + public void validateBatchFileContents() { BatchFile obj = new BatchFile("echo A\necho B\recho C"); rule.assertStringContains(obj.getContents(), "echo A\r\necho B\r\necho C\r\nexit %ERRORLEVEL%"); } @@ -51,7 +50,7 @@ private class ReturnCodeFakeLauncher implements FakeLauncher { } @Override - public Proc onLaunch(ProcStarter p) throws IOException { + public Proc onLaunch(ProcStarter p) { return new FinishedProc(this.code); } } @@ -141,7 +140,7 @@ public void windowsErrorlevel0ShouldNeverMakeTheBuildUnstable() throws Exception @Issue("JENKINS-23786") @Test - public void windowsUnstableCodeZeroIsSameAsUnset() throws Exception { + public void windowsUnstableCodeZeroIsSameAsUnset() { assumeTrue(Functions.isWindows()); /* Creating unstable=0 produces unstable=null */ @@ -151,7 +150,7 @@ public void windowsUnstableCodeZeroIsSameAsUnset() throws Exception { @Issue("JENKINS-40894") @Test @LocalData - public void canLoadUnstableReturnFromDisk() throws Exception { + public void canLoadUnstableReturnFromDisk() { FreeStyleProject p = (FreeStyleProject) rule.jenkins.getItemByFullName("batch"); BatchFile batchFile = (BatchFile) p.getBuildersList().get(0); assertEquals("unstable return", (Integer) 1, batchFile.getUnstableReturn()); diff --git a/test/src/test/java/hudson/tasks/BuildTriggerTest.java b/test/src/test/java/hudson/tasks/BuildTriggerTest.java index 50424e5a6732..500b6a8eb7b4 100644 --- a/test/src/test/java/hudson/tasks/BuildTriggerTest.java +++ b/test/src/test/java/hudson/tasks/BuildTriggerTest.java @@ -345,7 +345,7 @@ private AssertTriggerBuildCompleted(FreeStyleProject us, WebClient wc) { } @Override - public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { + public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws IOException { FreeStyleBuild success = us.getLastSuccessfulBuild(); FreeStyleBuild last = us.getLastBuild(); try { diff --git a/test/src/test/java/hudson/tasks/FingerprinterTest.java b/test/src/test/java/hudson/tasks/FingerprinterTest.java index 250d28630f33..ea1172a51d60 100644 --- a/test/src/test/java/hudson/tasks/FingerprinterTest.java +++ b/test/src/test/java/hudson/tasks/FingerprinterTest.java @@ -51,7 +51,6 @@ import hudson.util.RunList; import hudson.util.StreamTaskListener; import java.io.File; -import java.io.IOException; import java.util.Arrays; import java.util.Collection; import java.util.Collections; @@ -98,7 +97,7 @@ public class FingerprinterTest { @Rule public JenkinsRule j = new JenkinsRule(); @BeforeClass - public static void setUp() throws Exception { + public static void setUp() { Fingerprinter.enableFingerprintsInDependencyGraph = true; } @@ -122,7 +121,7 @@ public static void setUp() throws Exception { private static class FingerprintAddingBuilder extends Builder { @Override - public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { + public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) { build.addAction(new Fingerprinter.FingerprintAction(build, Collections.singletonMap(singleFiles2[0], "fakefingerprint"))); return true; } diff --git a/test/src/test/java/hudson/tasks/ShellTest.java b/test/src/test/java/hudson/tasks/ShellTest.java index f89ea5127e91..de058c61075f 100644 --- a/test/src/test/java/hudson/tasks/ShellTest.java +++ b/test/src/test/java/hudson/tasks/ShellTest.java @@ -12,7 +12,6 @@ import hudson.model.FreeStyleProject; import hudson.model.Result; import java.io.File; -import java.io.IOException; import java.io.PrintStream; import java.nio.charset.StandardCharsets; import java.util.List; @@ -55,7 +54,7 @@ public void testBasic() throws Exception { // TODO: define a FakeLauncher implementation with easymock so that this kind of assertions can be simplified. PretendSlave s = rule.createPretendSlave(new FakeLauncher() { @Override - public Proc onLaunch(ProcStarter p) throws IOException { + public Proc onLaunch(ProcStarter p) { // test the command line argument. List cmds = p.cmds(); rule.assertStringContains("/bin/sh",cmds.get(0)); diff --git a/test/src/test/java/hudson/tools/BatchCommandInstallerTest.java b/test/src/test/java/hudson/tools/BatchCommandInstallerTest.java index e14a90b40593..430a367ed2f0 100644 --- a/test/src/test/java/hudson/tools/BatchCommandInstallerTest.java +++ b/test/src/test/java/hudson/tools/BatchCommandInstallerTest.java @@ -15,7 +15,7 @@ public class BatchCommandInstallerTest { public JenkinsRule rule = new JenkinsRule(); @Test - public void validateBatchCommandInstallerCommandEOL() throws Exception { + public void validateBatchCommandInstallerCommandEOL() { BatchCommandInstaller obj = new BatchCommandInstaller("", "echo A\necho B\recho C", ""); rule.assertStringContains(obj.getCommand(), "echo A\r\necho B\r\necho C"); } diff --git a/test/src/test/java/hudson/tools/CommandInstallerTest.java b/test/src/test/java/hudson/tools/CommandInstallerTest.java index 7a58c1ec8ca5..c1e96183f334 100644 --- a/test/src/test/java/hudson/tools/CommandInstallerTest.java +++ b/test/src/test/java/hudson/tools/CommandInstallerTest.java @@ -15,7 +15,7 @@ public class CommandInstallerTest { public JenkinsRule rule = new JenkinsRule(); @Test - public void validateCommandInstallerCommandEOL() throws Exception { + public void validateCommandInstallerCommandEOL() { CommandInstaller obj = new CommandInstaller("", "echo A\r\necho B\recho C", ""); rule.assertStringContains(obj.getCommand(), "echo A\necho B\necho C"); } diff --git a/test/src/test/java/hudson/tools/ToolLocationNodePropertyTest.java b/test/src/test/java/hudson/tools/ToolLocationNodePropertyTest.java index 3eb6ab0d3e5a..0d85fd44bccc 100644 --- a/test/src/test/java/hudson/tools/ToolLocationNodePropertyTest.java +++ b/test/src/test/java/hudson/tools/ToolLocationNodePropertyTest.java @@ -40,7 +40,6 @@ import hudson.tasks.BatchFile; import hudson.tasks.Maven.MavenInstallation; import hudson.tasks.Shell; -import java.io.IOException; import jenkins.model.Jenkins; import org.junit.Before; import org.junit.Rule; @@ -107,7 +106,7 @@ public void formRoundTrip() throws Exception { assertEquals("zotfoo", location.getHome()); } - private void configureDumpEnvBuilder() throws IOException { + private void configureDumpEnvBuilder() { if(Functions.isWindows()) project.getBuildersList().add(new BatchFile("set")); else diff --git a/test/src/test/java/hudson/triggers/SafeTimerTaskTest.java b/test/src/test/java/hudson/triggers/SafeTimerTaskTest.java index c6205b7630c9..5ff3e140893a 100644 --- a/test/src/test/java/hudson/triggers/SafeTimerTaskTest.java +++ b/test/src/test/java/hudson/triggers/SafeTimerTaskTest.java @@ -7,7 +7,6 @@ import hudson.model.AsyncPeriodicWork; import hudson.model.TaskListener; import java.io.File; -import java.io.IOException; import org.junit.After; import org.junit.Rule; import org.junit.Test; @@ -29,7 +28,7 @@ public class SafeTimerTaskTest { public LoggerRule loggerRule = new LoggerRule(); @After - public void tearDown() throws Exception { + public void tearDown() { System.clearProperty(SafeTimerTask.LOGS_ROOT_PATH_PROPERTY); } @@ -63,7 +62,7 @@ public LogSpammer() { } @Override - protected void execute(TaskListener listener) throws IOException, InterruptedException { + protected void execute(TaskListener listener) { listener.getLogger().println("blah"); } diff --git a/test/src/test/java/hudson/util/BootFailureTest.java b/test/src/test/java/hudson/util/BootFailureTest.java index c961244c7c13..22b9b39a1955 100644 --- a/test/src/test/java/hudson/util/BootFailureTest.java +++ b/test/src/test/java/hudson/util/BootFailureTest.java @@ -46,7 +46,7 @@ public class BootFailureTest { static class CustomRule extends JenkinsRule { @Override - public void before() throws Throwable { + public void before() { env = new TestEnvironment(testDescription); env.pin(); // don't let Jenkins start automatically diff --git a/test/src/test/java/hudson/util/LineEndingConversionTest.java b/test/src/test/java/hudson/util/LineEndingConversionTest.java index 66773fbbb93b..e6db4388053d 100644 --- a/test/src/test/java/hudson/util/LineEndingConversionTest.java +++ b/test/src/test/java/hudson/util/LineEndingConversionTest.java @@ -17,12 +17,12 @@ public class LineEndingConversionTest { @Issue("JENKINS-7478") @Test - public void validateWindowsEOL() throws Exception { + public void validateWindowsEOL() { rule.assertStringContains(LineEndingConversion.convertEOL("echo A\necho B\recho C", LineEndingConversion.EOLType.Windows), "echo A\r\necho B\r\necho C"); } @Test - public void validateUnixEOL() throws Exception { + public void validateUnixEOL() { rule.assertStringContains(LineEndingConversion.convertEOL("echo A\r\necho B\recho C", LineEndingConversion.EOLType.Unix), "echo A\necho B\necho C"); } } diff --git a/test/src/test/java/hudson/util/RobustReflectionConverterTest.java b/test/src/test/java/hudson/util/RobustReflectionConverterTest.java index fb236b349af7..b3e03bd0ad47 100644 --- a/test/src/test/java/hudson/util/RobustReflectionConverterTest.java +++ b/test/src/test/java/hudson/util/RobustReflectionConverterTest.java @@ -67,7 +67,7 @@ public class RobustReflectionConverterTest { @Issue("JENKINS-21024") @LocalData - @Test public void randomExceptionsReported() throws Exception { + @Test public void randomExceptionsReported() { FreeStyleProject p = r.jenkins.getItemByFullName("j", FreeStyleProject.class); assertNotNull(p); assertTrue("There should be no triggers", p.getTriggers().isEmpty()); From 5b940cd94518add43548337b31fd9f71549e862e Mon Sep 17 00:00:00 2001 From: Anne-Laure Gaillard <86982045+alauregaillard@users.noreply.github.com> Date: Sun, 10 Oct 2021 11:10:23 +0200 Subject: [PATCH 18/66] Hacktoberfest update the French translation [JENKINS-66681] (#5779) Co-authored-by: Gaillard --- .../main/resources/jenkins/model/Jenkins/legend_fr.properties | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/main/resources/jenkins/model/Jenkins/legend_fr.properties b/core/src/main/resources/jenkins/model/Jenkins/legend_fr.properties index 322a7d9d53f4..35b8cc6b21bd 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/legend_fr.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/legend_fr.properties @@ -22,6 +22,10 @@ grey=Le projet n''a jamais \u00e9t\u00e9 construit avant ou est d\u00e9sactiv\u00e9. grey_anime=Le premier build du projet est en cours. +darkgrey=Le dernier build a \u00e9t\u00e9 abandonn\u00e9. +darkgrey_anime=Le dernier build a \u00e9t\u00e9 abandonn\u00e9. Un nouveau build est en cours. +lightgrey=Le projet n''a jamais \u00e9t\u00e9 construit. +lightgrey_anime=Le premier build est en cours. blue=Le dernier build s''est achev\u00e9 avec succ\u00e8s. blue_anime=Le dernier build s''est achev\u00e9 avec succ\u00e8s. Un nouveau build est en cours. yellow=Le dernier build s''est achev\u00e9 avec succ\u00e8s mais est instable. \ From f8b43c12fb6f07c1118d63f1435e6564723a3253 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 10 Oct 2021 10:11:20 +0100 Subject: [PATCH 19/66] Bump mockito-inline from 3.12.4 to 4.0.0 (#5792) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index bde86ef74197..39db6b045af3 100644 --- a/pom.xml +++ b/pom.xml @@ -129,7 +129,7 @@ THE SOFTWARE. org.mockito mockito-inline - 3.12.4 + 4.0.0 org.objenesis From e67b9ff47ec83dece68cb574e700c64a609971e2 Mon Sep 17 00:00:00 2001 From: aman <53443872+aman-raza@users.noreply.github.com> Date: Sun, 10 Oct 2021 20:10:15 +0530 Subject: [PATCH 20/66] Update MAINTAINERS.adoc Fixed minor grammatical errors --- docs/MAINTAINERS.adoc | 70 +++++++++++++++++++++---------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/docs/MAINTAINERS.adoc b/docs/MAINTAINERS.adoc index 31e6a9c18118..2dbfc2001175 100644 --- a/docs/MAINTAINERS.adoc +++ b/docs/MAINTAINERS.adoc @@ -5,8 +5,8 @@ toc::[] -Jenkins core is a central component of the project which serves millions of users, and it is critical to maintain it in a good shape. -We want to ensure quality of the integrated changes and continuity of the project, +Jenkins core is a central component of the project which serves millions of users, and it is critical to maintaining it in a good shape. +We want to ensure the quality of the integrated changes and continuity of the project, and hence the Jenkins core pull request review and merge process is more sophisticated than for the majority of plugins. == Scope of the document @@ -39,7 +39,7 @@ Remoting updates in the core are subject to the process though. * Release Team Member **Contributors** submit pull requests to the Jenkins core and review changes submitted by others. -There is no special preconditions to do so. +There are no special preconditions to do so. Anyone is welcome to contribute. **Issues Triage Team Members** review the incoming issues submitted in Jenkins Jira: @@ -47,7 +47,7 @@ bug reports, requests for enhancement, etc. Special permissions are not required to take this role or to contribute. Anyone is welcome to start contributing (see the <>). -**Core Pull Request Reviewers** is a team for contributors who are willing to regularly review Jenkins pull requests and to eventually become Jenkins core maintainers. +**Core Pull Request Reviewers** is a team for contributors who are willing to regularly review Jenkins pull requests and eventually become Jenkins core maintainers. They get https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization[Triage permissions] so that they can manage pull requests, request reviews and prepare changelog drafts in the pull request description. Their main responsibility is to triage and review the incoming pull requests and to guide newcomer contributors who are not familiar with the project's processes. @@ -55,7 +55,7 @@ GitHub team: link:https://github.com/orgs/jenkinsci/teams/core-pr-reviewers[@jen **Core Maintainers** get `Write` permissions in the repository, and hence they are able to merge pull requests. Their responsibility is to perform pull request reviews on a regular basis and to merge ready pull requests towards the weekly releases (`master` branch). -They are also responsible to monitor the weekly release status and to perform triage of critical issues. +They are also responsible to monitor the weekly release status and performing triage of critical issues. GitHub team: link:https://github.com/orgs/jenkinsci/teams/core[@jenkinsci/core]. **Release Team Members** are responsible for Jenkins weekly and LTS releases. @@ -65,12 +65,12 @@ Team members get `Write` permissions in the Jenkins core repository, and they al === Ladder * **Contributors**. Anyone can participate. - There is no precondition except having a GitHub account, just submit pull requests or comment in existing ones! + There is no precondition except having a GitHub account, just submit pull requests or comment on existing ones! * **Core Pull Request Reviewers** can be nominated by contributors in the link:https://groups.google.com/d/forum/jenkinsci-dev[developer mailing list]. Self-nomination is fine. -Decision is made by a consensus in the mailing list or via voting at the link:https://www.jenkins.io/project/governance-meeting/[governance meeting]. +The Decision is made by a consensus in the mailing list or via voting at the link:https://www.jenkins.io/project/governance-meeting/[governance meeting]. * **Core Maintainers** - same process as for Core PR reviewers. - All nominees must also sign an link:https://github.com/jenkinsci/infra-cla/[Individual Contributor License Agreement] before getting the permission in GitHub repositories. + All nominees must also sign an link:https://github.com/jenkinsci/infra-cla/[Individual Contributor License Agreement] before getting permission in GitHub repositories. * **Release Team Members** are assigned by the Jenkins Release officer == Pull request review process @@ -84,15 +84,15 @@ At the same time, we are interested to make the review process as simple as poss Pull requests review in Jenkins is not just about reviewing code and accepting them if the code is OK. Core maintainers are expected to ensure feasibility and compatibility of changes, -to maintain good quality of the codebase and documentation, +to maintain a good quality of the codebase and documentation, and to ensure there is a consensus between contributors. ==== Verifying Feasibility Reviewers are expected to look at changes critically from a "product management" point of view. -It's not just about the code, but also whether the change makes sense in a global / holistic way, considering existing popular plugins and the way users experience Jenkins overall. +It's not just about the code, but also whether the change makes sense in a global/holistic way, considering existing popular plugins and the way users experience Jenkins overall. Also, not every change needs to be merged into the core. -Many features would be better introduced as plugins which have separate release cycles and allow delivering changes faster. +Many features would be better introduced as plugins that have separate release cycles and allow delivering changes faster. We want to extend the Jenkins core and incorporate widely used functionality and extension points there, but we try to keep the core as minimal as possible in terms of dependencies. @@ -119,16 +119,16 @@ We're aware that there are existing inconsistencies in the code, and we do not enforce a single code style across the codebase at the moment. * New code should follow the (majority) style guide. - In Jenkins core we use the link:https://www.oracle.com/java/technologies/javase/codeconventions-contents.html[these Code Conventions for the Java TM Programming Language] as a default code style + In Jenkins core, we use link:https://www.oracle.com/java/technologies/javase/codeconventions-contents.html[these Code Conventions for the Java TM Programming Language] as a default code style * Updates to existing code should only fix formatting on the lines affected anyway to keep the diff minimal. It helps reviewers focus their attention on the specifics of the change and reduces the risk of a change from one pull request creating a conflict in another pull request. ==== Maintaining documentation * Jenkins documentation is hosted on https://www.jenkins.io/doc/. - When a new user-facing change is added, we should encourage contributors to update documentation in downstream pull requests. -* Same applies to Jenkins changelogs (link:https://www.jenkins.io/changelog[weekly], link:https://www.jenkins.io/changelog-stable/[stable]) and link:https://www.jenkins.io/doc/upgrade-guide/[upgrade guidelines]: - We have a semi-automated process which is based on pull request summaries and labels. + When a new user-facing change is added, we should encourage contributors to update the documentation in downstream pull requests. +* The Same applies to Jenkins changelogs (link:https://www.jenkins.io/changelog[weekly], link:https://www.jenkins.io/changelog-stable/[stable]) and link:https://www.jenkins.io/doc/upgrade-guide/[upgrade guidelines]: + We have a semi-automated process that is based on pull request summaries and labels. Core maintainers are expected to validate the entries as a part of the pull request review/merge process. See the checklist below in the _Merge process_ section. @@ -141,7 +141,7 @@ And we are fine with that, especially for small patches. Pull requests often become a venue to discuss feasibility, underlying technical decisions and design. We are fine with that as well. If there is no consensus about the feasibility and implementation, -code reviewers are expected to suggest proper channels for contributors to discuss their contribution. +code reviewers are expected to suggest proper channels for contributors to discuss their contributions. * A discussion in the link:https://groups.google.com/d/forum/jenkinsci-dev[Jenkins Developer Mailing List] is the default way to go * If no consensus can be reached on the mailing list, @@ -164,7 +164,7 @@ Code reviews do NOT pursue the following goals: ** Not every contributor is a Git expert, do not request changes in the commit history unless it is necessary ** Core maintainers can squash PRs during the merge. If you feel this is important, add the link:https://github.com/jenkinsci/jenkins/pulls?q=is%3Aopen+is%3Apr+label%3Asquash-merge-me[squash-merge-me] label -** We want to keep pull requests focused when possible (one feature / fix per pull request), +** We want to keep pull requests focused when possible (one feature/fix per pull request), but we can live without it if there is no need to backport changes to the stable baseline. == Issue triage @@ -173,7 +173,7 @@ Jenkins core and most of its components use link:https://issues.jenkins.io/[Jenk This issue tracker is open to all Jenkins users. They report defects and requests for enhancements, and then component maintainers triage issues and provide feedback to users. -In the case of the Jenkins core, *Issue Triage Team* and *Core Maintainers* are roles who are expected to process the incoming issues. +In the case of the Jenkins core, the *Issue Triage Team* and *Core Maintainers* are roles that are expected to process the incoming issues. These contributors perform initial triage of incoming issues and periodically scrub the issue tracker. This section provides some tips and tricks about triaging issues submitted to the Jenkins core. @@ -229,17 +229,17 @@ Initial issue triage has the following objectives: If you see such issues, move them to the `SECURITY` project so that the security team takes care of their triage. Note that the required fields are different between projects, so some manual updates might be required when moving them. * **Label regressions and CC stakeholders** if an issue is reported as a regression with a clear root cause, - please set a `regression` label and, if applicable, CC contributors of a change which led to the regression. + please set a `regression` label and, if applicable, CC contributors of a change that led to the regression. * **Resolve invalid issues and support requests**. Sometimes Jenkins Jira is used as a support portal. We do not want to encourage that. Jenkins Jira is an issue tracker, and we expect reporters to investigate issues on their side to an extent that they can be reviewed by maintainers. - For support requests users are expected to use link:https://www.jenkins.io/mailing-lists[mailing lists], + For support requests, users are expected to use link:https://www.jenkins.io/mailing-lists[mailing lists], link:https://www.jenkins.io/chat/[chats] and other resources (e.g. Stackoverflow). It is fine to link users to link:https://github.com/jenkinsci/.github/blob/master/SUPPORT.md[this page]. * **Resolve duplicates**. It is often that the same issue is already reported in the Jenkins database. - Newly reported duplicates can be just resolved with a `Duplicate` resolution, and linked to the original issue. + Newly reported duplicates can be just resolved with a `Duplicate` resolution and linked to the original issue. === HOWTO: Triage by maintainers @@ -251,26 +251,26 @@ Triage objectives: * **Confirm reported defects**. Try to reproduce the issue or analyze the codebase. If the issue is legitimate, it is great to explicitly confirm it in a comment. -* Nice2Have: **Define next steps**. +* Nice2Have: **Define the next steps**. If possible, define a potential resolution for the issue. If you do not plan to work on the issue in foreseeable future, it is great to explicitly highlight that by unassigning the issue and inviting the reporter and other contributors to submit a fix. * Nice2Have: **Highlight newcomer-friendly issues**. Newcomer-friendly issues are instrumental for an onboarding new code contributors to the project. - They are linked from link:https://www.jenkins.io/participate/code/[contributing guidelines]. + They are linked to link:https://www.jenkins.io/participate/code/[contributing guidelines]. If you see a simple issue but do not plan to work on it, put a `newbie-friendly` label on it so that somebody could pick it up. === How to scrub issues? -In addition to the initial triage, it is a good practice to sometimes review previously reported issues so that we could minimize backlog of issues and simplify search by users. +In addition to the initial triage, it is a good practice to sometimes review previously reported issues so that we could minimize the backlog of issues and simplify search by users. * **Triage reopened issues**. Same as for newly reported issues, it is great to process reopened issues if they are not acted on by the issue assignees. Often such issues can be resolved with a request to report a new issue if an issue is reopened due to another issue. * **Resolve stale untriaged issues**. Issue reporters may become unresponsive before their issue can be fully triaged. - If there is a reported issue which does not contain data for reproducing the issue, + If there is a reported issue that does not contain data for reproducing the issue, it is fine to resolve them after a 2-week timeout with the `Incomplete` or `Cannot reproduce` resolution. * **Resolve/update obsolete issues**. Sometimes issues become obsolete due to other changes in the Jenkins core (e.g. feature removal), @@ -284,13 +284,13 @@ Requests for enhancement (RFEs) include the `New Feature` and `Improvement` type The process to triage them might be different from bug reports. because it is not always possible to say whether a request should be implemented in the Jenkins core, an existing or a new plugin. -In the case of doubt, it is fine to just skip an issue or CC subject matter experts who could advice. +In the case of doubt, it is fine to just skip an issue or CC subject matter experts who could advise. For RFEs which are not related to the Jenkins core or plugins, it is possible to set the `plugin-proposals` component. Note that this component is not regularly scrubbed, and it can be considered only as a pool of ideas somebody could implement. -It is a good practice to set expectation in a comment when updating the RFE. +It is a good practice to set expectations in a comment when updating the RFE. === Responding to pings in triaged issues @@ -333,13 +333,13 @@ Merge process can be initiated once a pull request matches the requirements: * Conversations in the pull request are over OR it is explicit that a reviewer does not block the change (often indicated by line comments attached to an approving PR review, or by using the term "nit", from "nit-picking") * Changelog entries in the PR title and/or _Proposed changelog entries_ are correct and reflect the current, final state of the PR * Proper changelog labels are set so that the changelog can be generated automatically. - List of labels we use for changelog generation is available link:https://github.com/jenkinsci/.github/blob/master/.github/release-drafter.yml[here]. + A List of labels we use for changelog generation is available link:https://github.com/jenkinsci/.github/blob/master/.github/release-drafter.yml[here]. * If the change needs administrators to be aware of it when upgrading, the `upgrade-guide-needed` label is present and there is a `Proposed upgrade guidelines` section in the PR title (link:https://github.com/jenkinsci/jenkins/pull/4387[example]). - This is usually the case when a data migration occurs, a feature has been removed, a significant behavior change is introduced (including when there is a way to opt out), + This is usually the case when a data migration occurs, a feature has been removed, a significant behaviour change is introduced (including when there is a way to opt-out), or in general when we expect at least a large minority of admins to benefit from knowing about the change, e.g. to apply a new option. -* If it would make sense to backport the change to LTS, a Jira issue must exist, be a _Bug_ or _Improvement_, and be labeled as `lts-candidate` to be considered (see link:https://issues.jenkins.io/issues/?filter=12146[this Jira query]). +* If it would make sense to backport the change to LTS, a Jira issue must exist, be a _Bug_ or _Improvement_, and be labelled as `lts-candidate` to be considered (see link:https://issues.jenkins.io/issues/?filter=12146[this Jira query]). ==== Step 2: Is it a good time to merge? @@ -350,7 +350,7 @@ For these reasons, the following changes should not be merged during the week be * Changes that could be considered risky (relatively high risk of introducing regressions), as they could make users of Jenkins weekly releases choose between getting security fixes, and having a functioning Jenkins * Very large changes (in terms of lines changed), because the Jenkins security team needs to prepare security fixes for the weekly release line in a very short period of time. -If the change is ready, but it is not a good time, consider labeling the pull request with the `on-hold` label. +If the change is ready, but it is not a good time, consider labelling the pull request with the `on-hold` label. Make sure to add a comment explaining why it was put on hold. ==== Step 3: Marking for merge @@ -364,7 +364,7 @@ Once the checklist is passed, a Core PR Reviewer or a Maintainer can mark the pu ==== Step 4: Merge! A Core Maintainer merges the change after allowing sufficient time for comment (if needed). -After that the change will be landed in the next weekly release. +After that, the change will be landed in the next weekly release. LTS backporting, if needed, will be handled separately by the release team. === Exceptions @@ -377,7 +377,7 @@ LTS backporting, if needed, will be handled separately by the release team. * 24 hours waiting period after adding the `ready-for-merge` label is not required for: //TODO(oleg_nenashev): Define "trivial" better to avoid loopholes ** changes that do not result in changes to the primary functionality, such as typo fixes in documentation or localization files -** changes which do not affect the production code: Jenkinsfile tweaks, tools inside the repo, etc. +** changes that do not affect the production code: Jenkinsfile tweaks, tools inside the repo, etc. ** broken master build === Squashing pull requests OR not? @@ -397,7 +397,7 @@ When do we merge pull requests as is? *** **Commit 1**: `[JENKINS-1234] - Reproduce the issue in tests` *** **Commit 2**: `[JENKINS-1234] - Fix the issue by updating Foo` * There are multiple commit authors who expressed the desire to keep commit history as is. - By default we do not consider multiple authors as a blocker for squash, because GitHub now + By default, we do not consider multiple authors as a blocker for squash, because GitHub now link:https://help.github.com/en/github/committing-changes-to-your-project/creating-a-commit-with-multiple-authors[supports co-authors] When do we squash commits? @@ -425,7 +425,7 @@ Any Jenkins contributors are welcome to participate in backporting and release c * Backporting discussions happen through the developer mailing list. * Backports are submitted as pull requests with the link:https://github.com/jenkinsci/jenkins/labels/into-lts[into-lts] label. -* Release candidate testing is announced in the developer mailing list. +* Release candidate testing is announced on the developer mailing list. Discovered issues should be submitted to Jenkins Jira and then referenced in the release candidate testing thread. == Tools From d7862bd50eed825731b1dbffd7d934ae03db4655 Mon Sep 17 00:00:00 2001 From: aman <53443872+aman-raza@users.noreply.github.com> Date: Mon, 11 Oct 2021 15:42:33 +0530 Subject: [PATCH 21/66] Update docs/MAINTAINERS.adoc Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com> --- docs/MAINTAINERS.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/MAINTAINERS.adoc b/docs/MAINTAINERS.adoc index 2dbfc2001175..adf86a013071 100644 --- a/docs/MAINTAINERS.adoc +++ b/docs/MAINTAINERS.adoc @@ -5,7 +5,7 @@ toc::[] -Jenkins core is a central component of the project which serves millions of users, and it is critical to maintaining it in a good shape. +Jenkins core is a central component of the project which serves millions of users, and it is critical to maintain it in a good shape. We want to ensure the quality of the integrated changes and continuity of the project, and hence the Jenkins core pull request review and merge process is more sophisticated than for the majority of plugins. From 0c3cb5091e87650d8dd5db1a7c295ee6c95ed558 Mon Sep 17 00:00:00 2001 From: aman <53443872+aman-raza@users.noreply.github.com> Date: Mon, 11 Oct 2021 15:42:49 +0530 Subject: [PATCH 22/66] Update docs/MAINTAINERS.adoc Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com> --- docs/MAINTAINERS.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/MAINTAINERS.adoc b/docs/MAINTAINERS.adoc index adf86a013071..74837ac3567a 100644 --- a/docs/MAINTAINERS.adoc +++ b/docs/MAINTAINERS.adoc @@ -6,7 +6,7 @@ toc::[] Jenkins core is a central component of the project which serves millions of users, and it is critical to maintain it in a good shape. -We want to ensure the quality of the integrated changes and continuity of the project, +We want to ensure quality of the integrated changes and continuity of the project, and hence the Jenkins core pull request review and merge process is more sophisticated than for the majority of plugins. == Scope of the document From 5c24da26a41d09bae73fe8924d6e51beb7fc7136 Mon Sep 17 00:00:00 2001 From: aman <53443872+aman-raza@users.noreply.github.com> Date: Mon, 11 Oct 2021 15:43:08 +0530 Subject: [PATCH 23/66] Update docs/MAINTAINERS.adoc Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com> --- docs/MAINTAINERS.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/MAINTAINERS.adoc b/docs/MAINTAINERS.adoc index 74837ac3567a..d3bad84cd9ce 100644 --- a/docs/MAINTAINERS.adoc +++ b/docs/MAINTAINERS.adoc @@ -257,7 +257,7 @@ Triage objectives: it is great to explicitly highlight that by unassigning the issue and inviting the reporter and other contributors to submit a fix. * Nice2Have: **Highlight newcomer-friendly issues**. Newcomer-friendly issues are instrumental for an onboarding new code contributors to the project. - They are linked to link:https://www.jenkins.io/participate/code/[contributing guidelines]. + They are linked from the link:https://www.jenkins.io/participate/code/[contributing guidelines]. If you see a simple issue but do not plan to work on it, put a `newbie-friendly` label on it so that somebody could pick it up. From 0781d473b7f5fb88de55238767353e876ea6d9c8 Mon Sep 17 00:00:00 2001 From: aman <53443872+aman-raza@users.noreply.github.com> Date: Mon, 11 Oct 2021 15:43:59 +0530 Subject: [PATCH 24/66] Update docs/MAINTAINERS.adoc Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com> --- docs/MAINTAINERS.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/MAINTAINERS.adoc b/docs/MAINTAINERS.adoc index d3bad84cd9ce..b05ea4502535 100644 --- a/docs/MAINTAINERS.adoc +++ b/docs/MAINTAINERS.adoc @@ -337,7 +337,7 @@ Merge process can be initiated once a pull request matches the requirements: * If the change needs administrators to be aware of it when upgrading, the `upgrade-guide-needed` label is present and there is a `Proposed upgrade guidelines` section in the PR title (link:https://github.com/jenkinsci/jenkins/pull/4387[example]). - This is usually the case when a data migration occurs, a feature has been removed, a significant behaviour change is introduced (including when there is a way to opt-out), + This is usually the case when a data migration occurs, a feature has been removed, a significant behavior change is introduced (including when there is a way to opt-out), or in general when we expect at least a large minority of admins to benefit from knowing about the change, e.g. to apply a new option. * If it would make sense to backport the change to LTS, a Jira issue must exist, be a _Bug_ or _Improvement_, and be labelled as `lts-candidate` to be considered (see link:https://issues.jenkins.io/issues/?filter=12146[this Jira query]). From f1db0f599c01f5eb3d7a7ddb0fc2fba82051b0f5 Mon Sep 17 00:00:00 2001 From: AlaureGaillard Date: Tue, 12 Oct 2021 12:46:08 +0200 Subject: [PATCH 25/66] fix fr encoding on help --- .../help-concurrentBuild_fr.html | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/core/src/main/resources/hudson/model/AbstractProject/help-concurrentBuild_fr.html b/core/src/main/resources/hudson/model/AbstractProject/help-concurrentBuild_fr.html index 1781e20c170a..d1f618b83640 100644 --- a/core/src/main/resources/hudson/model/AbstractProject/help-concurrentBuild_fr.html +++ b/core/src/main/resources/hudson/model/AbstractProject/help-concurrentBuild_fr.html @@ -1,41 +1,41 @@
- Lorsque cette option est coch\u00e9e, plusieurs constructions de ce projet peuvent - \u00eatre ex\u00e9cut\u00e9es en parall\u00e8le. + Lorsque cette option est cochée, plusieurs constructions de ce projet peuvent + être exécutées en parallèle.

- Par d\u00e9faut, une seule construction du projet est ex\u00e9cut\u00e9e \u00E0 la fois — toutes - les autres demandes pour ex\u00e9cuter la construction de ce projet resteront dans la file d'attente - jusqu'\u00E0 ce que la premi\u00e8re construction soit termin\u00e9e.
- Ce choix par d\u00e9faut est une pr\u00e9caution, car les projets exigent souvent un acc\u00e8s exclusif \u00E0 - certaines ressources, telles qu'une base de donn\u00e9es ou un hardware sp\u00e9cifique. + Par défaut, une seule construction du projet est exécutée à la fois — toutes + les autres demandes pour exécuter la construction de ce projet resteront dans la file d'attente + jusqu'à ce que la première construction soit terminée.
+ Ce choix par défaut est une précaution, car les projets exigent souvent un accès exclusif à + certaines ressources, telles qu'une base de données ou un hardware spécifique.

- Si cette option est activ\u00e9e, et s'il y a suffisamment d'ex\u00e9cuteurs disponibles - sachant g\u00e9rer ce projet, alors les multiples constructions de ce projet tourneront - en parall\u00e8le. S'il n'y a pas assez d'ex\u00e9cuteurs disponibles \u00E0 un moment donn\u00e9, + Si cette option est activée, et s'il y a suffisamment d'exécuteurs disponibles + sachant gérer ce projet, alors les multiples constructions de ce projet tourneront + en parallèle. S'il n'y a pas assez d'exécuteurs disponibles à un moment donné, toute autre demande de construction sera maintenue dans la file d'attente de construction comme normalement.

- Activer les constructions simultan\u00e9es est utile pour les projets qui ex\u00e9cutent de longs tests - car elle permet \u00E0 chaque construction de contenir un plus petit nombre de modifications, tandis que - le temps d'ex\u00e9cution total diminue car les constructions suivantes n'ont pas besoin d'attendre - que les tests pr\u00e9c\u00e9dents soient termin\u00e9s.
- Cette fonctionnalit\u00e9 est \u00e9galement utile pour les projets param\u00e9tr\u00e9s, - dont les diff\u00e9rentes constructions — en fonction des param\u00e8tres utilis\u00e9s — - peuvent \u00eatre totalement ind\u00e9pendantes les unes des autres. + Activer les constructions simultanées est utile pour les projets qui exécutent de longs tests + car elle permet à chaque construction de contenir un plus petit nombre de modifications, tandis que + le temps d'exécution total diminue car les constructions suivantes n'ont pas besoin d'attendre + que les tests précédents soient terminés.
+ Cette fonctionnalité est également utile pour les projets paramétrés, + dont les différentes constructions — en fonction des paramètres utilisés — + peuvent être totalement indépendantes les unes des autres.

- Chaque construction ex\u00e9cut\u00e9e en parall\u00e8le se produit dans son propre espace de travail, - isol\u00e9 des autres constructions. - Par d\u00e9faut, Jenkins ajoute "@<num>" au nom du r\u00e9pertoire de l'espace + Chaque construction exécutée en parallèle se produit dans son propre espace de travail, + isolé des autres constructions. + Par défaut, Jenkins ajoute "@<num>" au nom du répertoire de l'espace de travail, par exemple "@2".
- Le s\u00e9parateur "@" est modifiable en renseignant la valeur de la propri\u00e9t\u00e9 syst\u00e8me Java - hudson.slaves.WorkspaceList au d\u00e9marrage de jenkins. + Le séparateur "@" est modifiable en renseignant la valeur de la propriété système Java + hudson.slaves.WorkspaceList au démarrage de jenkins. Par exemple, "hudson.slaves.WorkspaceList=-" modifierait - le s\u00e9parateur \u00E0 un trait d'union.
- Pour plus d'informations sur le param\u00e9trage des propri\u00e9t\u00e9s syst\u00e8me, voir la + Pour plus d'informations sur le paramétrage des propriétés système, voir la page du wiki.

- En revanche, si vous activez l'option Utiliser un espace de travail personnalis\u00e9, toutes les constructions - seront ex\u00e9cut\u00e9es dans le m\u00eame espace de travail. La prudence est donc de mise, car plusieurs - constructions peuvent finir par modifier le m\u00eame r\u00e9pertoire en m\u00eame temps. + En revanche, si vous activez l'option Utiliser un espace de travail personnalisé, toutes les constructions + seront exécutées dans le même espace de travail. La prudence est donc de mise, car plusieurs + constructions peuvent finir par modifier le même répertoire en même temps.

From 509da378bfe5b2434ae33981986e0be7ecfff13e Mon Sep 17 00:00:00 2001 From: Jenkins Release Bot <66998184+jenkins-release-bot@users.noreply.github.com> Date: Tue, 12 Oct 2021 12:29:09 +0000 Subject: [PATCH 26/66] [maven-release-plugin] prepare release jenkins-2.316 --- bom/pom.xml | 2 +- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bom/pom.xml b/bom/pom.xml index 6f64b8747692..481cb89ec943 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main jenkins-parent - ${revision}${changelist} + 2.316 jenkins-bom diff --git a/cli/pom.xml b/cli/pom.xml index 3838594a564f..724a7992e520 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main jenkins-parent - ${revision}${changelist} + 2.316 cli diff --git a/core/pom.xml b/core/pom.xml index e1650bb3c681..4e0736fba0f2 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main jenkins-parent - ${revision}${changelist} + 2.316 jenkins-core diff --git a/pom.xml b/pom.xml index 39db6b045af3..b91fa14728a9 100644 --- a/pom.xml +++ b/pom.xml @@ -34,7 +34,7 @@ THE SOFTWARE. org.jenkins-ci.main jenkins-parent - ${revision}${changelist} + 2.316 pom Jenkins main module @@ -61,7 +61,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - ${scmTag} + jenkins-2.316 diff --git a/test/pom.xml b/test/pom.xml index 8572d2b1b0a9..77f697f77eb4 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main jenkins-parent - ${revision}${changelist} + 2.316 jenkins-test diff --git a/war/pom.xml b/war/pom.xml index 53ec00960c0c..9e4fb75b0653 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main jenkins-parent - ${revision}${changelist} + 2.316 jenkins-war From f419e8b3e26b4131cfe9aa3cc5a56ca101fffd64 Mon Sep 17 00:00:00 2001 From: Jenkins Release Bot <66998184+jenkins-release-bot@users.noreply.github.com> Date: Tue, 12 Oct 2021 12:29:29 +0000 Subject: [PATCH 27/66] [maven-release-plugin] prepare for next development iteration --- bom/pom.xml | 2 +- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 6 +++--- test/pom.xml | 2 +- war/pom.xml | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bom/pom.xml b/bom/pom.xml index 481cb89ec943..6f64b8747692 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main jenkins-parent - 2.316 + ${revision}${changelist} jenkins-bom diff --git a/cli/pom.xml b/cli/pom.xml index 724a7992e520..3838594a564f 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main jenkins-parent - 2.316 + ${revision}${changelist} cli diff --git a/core/pom.xml b/core/pom.xml index 4e0736fba0f2..e1650bb3c681 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main jenkins-parent - 2.316 + ${revision}${changelist} jenkins-core diff --git a/pom.xml b/pom.xml index b91fa14728a9..601421eb50c3 100644 --- a/pom.xml +++ b/pom.xml @@ -34,7 +34,7 @@ THE SOFTWARE. org.jenkins-ci.main jenkins-parent - 2.316 + ${revision}${changelist} pom Jenkins main module @@ -61,7 +61,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - jenkins-2.316 + ${scmTag} @@ -70,7 +70,7 @@ THE SOFTWARE. - 2.316 + 2.317 -SNAPSHOT + +
- + From 7d898423528dfb571195be8b3bb3783f60bf161d Mon Sep 17 00:00:00 2001 From: Anne-Laure Gaillard <86982045+alauregaillard@users.noreply.github.com> Date: Tue, 12 Oct 2021 15:12:04 +0200 Subject: [PATCH 30/66] Hacktoberfest update the French translation Jenkins administration [JENKINS-66797] (#5785) Co-authored-by: Wadeck Follonier Co-authored-by: Gaillard --- .../diagnostics/RootUrlNotSetMonitor/message_fr.properties | 7 +++++++ .../message_fr.properties | 3 +++ 2 files changed, 10 insertions(+) create mode 100644 core/src/main/resources/jenkins/diagnostics/RootUrlNotSetMonitor/message_fr.properties create mode 100644 core/src/main/resources/jenkins/monitor/JavaVersionRecommendationAdminMonitor/message_fr.properties diff --git a/core/src/main/resources/jenkins/diagnostics/RootUrlNotSetMonitor/message_fr.properties b/core/src/main/resources/jenkins/diagnostics/RootUrlNotSetMonitor/message_fr.properties new file mode 100644 index 000000000000..f6e3d806587d --- /dev/null +++ b/core/src/main/resources/jenkins/diagnostics/RootUrlNotSetMonitor/message_fr.properties @@ -0,0 +1,7 @@ +Dismiss=Ignorer +urlIsNull=L''URL Jenkins est vide cependant elle est n\u00e9cessaire au bon fonctionnement de nombreuses fonctionnalit\u00e9s de Jenkins telles que les notifications par e-mail, \ +la mise \u00e0 jour du statut des PRs et des variables d''environnement telles que BUILD_URL. +urlIsInvalid=L''URL Jenkins semble invalide. Elle est n\u00e9cessaire au bon fonctionnement de nombreuses fonctionnalit\u00e9s de Jenkins telles que les notifications par e-mail, \ +la mise \u00e0 jour du statut des PRs et des variables d''environnement telles que BUILD_URL. +actionToTake=Veuillez renseigner la valeur dans {0}. +actionUrlContent=Configuration de Jenkins diff --git a/core/src/main/resources/jenkins/monitor/JavaVersionRecommendationAdminMonitor/message_fr.properties b/core/src/main/resources/jenkins/monitor/JavaVersionRecommendationAdminMonitor/message_fr.properties new file mode 100644 index 000000000000..460689246ffb --- /dev/null +++ b/core/src/main/resources/jenkins/monitor/JavaVersionRecommendationAdminMonitor/message_fr.properties @@ -0,0 +1,3 @@ +Recommended_Java_Version=La version recommand\u00e9e pour utiliser Jenkins est Java 11 ; merci de faire une mise \u00e0 jour. +More\ Info=Plus d''informations +Dismiss=Ignorer From a709794932d33ce09d7dccf520c10955da2f6cbc Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Tue, 12 Oct 2021 20:49:08 +0200 Subject: [PATCH 31/66] chore: Reverts #3297 to ensure pipeline maximum persistence (#5809) --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 03b504b22bac..f23858e7b5ca 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,7 +11,7 @@ def buildNumber = BUILD_NUMBER as int; if (buildNumber > 1) milestone(buildNumbe def runTests = true def failFast = false -properties([buildDiscarder(logRotator(numToKeepStr: '50', artifactNumToKeepStr: '3')), durabilityHint('PERFORMANCE_OPTIMIZED')]) +properties([buildDiscarder(logRotator(numToKeepStr: '50', artifactNumToKeepStr: '3'))) // TODO: Restore 'Windows' once https://groups.google.com/forum/#!topic/jenkinsci-dev/v9d-XosOp2s is resolved def buildTypes = ['Linux'] From 9ee5c645182468152d3db41de537b09b0a54e1b4 Mon Sep 17 00:00:00 2001 From: Stefan Spieker Date: Tue, 12 Oct 2021 23:11:28 +0200 Subject: [PATCH 32/66] fix pipeline syntax error --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index f23858e7b5ca..e0be6f4237d1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,7 +11,7 @@ def buildNumber = BUILD_NUMBER as int; if (buildNumber > 1) milestone(buildNumbe def runTests = true def failFast = false -properties([buildDiscarder(logRotator(numToKeepStr: '50', artifactNumToKeepStr: '3'))) +properties([buildDiscarder(logRotator(numToKeepStr: '50', artifactNumToKeepStr: '3'))]) // TODO: Restore 'Windows' once https://groups.google.com/forum/#!topic/jenkinsci-dev/v9d-XosOp2s is resolved def buildTypes = ['Linux'] From 3824166269168bd0067be3ace1b2af4ea8462b33 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Wed, 13 Oct 2021 03:08:10 -0400 Subject: [PATCH 33/66] `disableConcurrentBuilds(abortPrevious: true)` (#5812) --- Jenkinsfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index e0be6f4237d1..323da6651231 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,7 +11,10 @@ def buildNumber = BUILD_NUMBER as int; if (buildNumber > 1) milestone(buildNumbe def runTests = true def failFast = false -properties([buildDiscarder(logRotator(numToKeepStr: '50', artifactNumToKeepStr: '3'))]) +properties([ + buildDiscarder(logRotator(numToKeepStr: '50', artifactNumToKeepStr: '3')), + disableConcurrentBuilds(abortPrevious: true) +]) // TODO: Restore 'Windows' once https://groups.google.com/forum/#!topic/jenkinsci-dev/v9d-XosOp2s is resolved def buildTypes = ['Linux'] From 9b1e095f95f44bf9efde386d0df44c5719b105bc Mon Sep 17 00:00:00 2001 From: Daniel Beck <1831569+daniel-beck@users.noreply.github.com> Date: Wed, 13 Oct 2021 11:17:35 +0200 Subject: [PATCH 34/66] Merge back tests for the 2.315 fixes (#5805) Co-authored-by: Daniel Beck --- ...SEC2424Test.java => Security2424Test.java} | 2 +- .../hudson/cli/CopyJobCommandSEC2424Test.java | 89 ------------- .../java/hudson/cli/CopyJobCommandTest.java | 38 ++++++ .../cli/CreateJobCommandSEC2424Test.java | 96 -------------- .../java/hudson/cli/CreateJobCommandTest.java | 50 +++++++ .../cli/CreateNodeCommandSEC2424Test.java | 125 ------------------ .../hudson/cli/CreateNodeCommandTest.java | 71 ++++++++++ .../hudson/model/CauseSECURITY2452Test.java | 48 ------- .../src/test/java/hudson/model/CauseTest.java | 35 +++++ .../DirectoryBrowserSupportSEC2481Test.java | 101 -------------- .../model/DirectoryBrowserSupportTest.java | 58 ++++++++ .../model/FreeStyleProjectSEC2424Test.java | 92 ------------- .../hudson/model/FreeStyleProjectTest.java | 51 +++++++ .../java/jenkins/model/NodesSEC2424Test.java | 101 -------------- .../test/java/jenkins/model/NodesTest.java | 60 +++++++++ 15 files changed, 364 insertions(+), 653 deletions(-) rename core/src/test/java/jenkins/model/{JenkinsSEC2424Test.java => Security2424Test.java} (98%) delete mode 100644 test/src/test/java/hudson/cli/CopyJobCommandSEC2424Test.java delete mode 100644 test/src/test/java/hudson/cli/CreateJobCommandSEC2424Test.java delete mode 100644 test/src/test/java/hudson/cli/CreateNodeCommandSEC2424Test.java delete mode 100644 test/src/test/java/hudson/model/CauseSECURITY2452Test.java delete mode 100644 test/src/test/java/hudson/model/DirectoryBrowserSupportSEC2481Test.java delete mode 100644 test/src/test/java/hudson/model/FreeStyleProjectSEC2424Test.java delete mode 100644 test/src/test/java/jenkins/model/NodesSEC2424Test.java diff --git a/core/src/test/java/jenkins/model/JenkinsSEC2424Test.java b/core/src/test/java/jenkins/model/Security2424Test.java similarity index 98% rename from core/src/test/java/jenkins/model/JenkinsSEC2424Test.java rename to core/src/test/java/jenkins/model/Security2424Test.java index e4fbab81ca34..891f627eed85 100644 --- a/core/src/test/java/jenkins/model/JenkinsSEC2424Test.java +++ b/core/src/test/java/jenkins/model/Security2424Test.java @@ -31,7 +31,7 @@ import org.junit.Test; import org.jvnet.hudson.test.Issue; -public class JenkinsSEC2424Test { +public class Security2424Test { @Test @Issue("SECURITY-2424") public void doesNotAcceptNameWithTrailingDot_regular() { diff --git a/test/src/test/java/hudson/cli/CopyJobCommandSEC2424Test.java b/test/src/test/java/hudson/cli/CopyJobCommandSEC2424Test.java deleted file mode 100644 index b3cf3bfe5e09..000000000000 --- a/test/src/test/java/hudson/cli/CopyJobCommandSEC2424Test.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * The MIT License - * - * Copyright 2012 Jesse Glick. - * - * 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. - */ - -package hudson.cli; - -import static hudson.cli.CLICommandInvoker.Matcher.failedWith; -import static hudson.cli.CLICommandInvoker.Matcher.succeededSilently; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.containsString; - -import hudson.model.Messages; -import jenkins.model.Jenkins; -import org.hamcrest.Matchers; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.jvnet.hudson.test.Issue; -import org.jvnet.hudson.test.JenkinsRule; - -//TODO merge back to CopyJobCommandTest after security release -public class CopyJobCommandSEC2424Test { - - @Rule public JenkinsRule j = new JenkinsRule(); - private CLICommand copyJobCommand; - private CLICommandInvoker command; - - @Before public void setUp() { - copyJobCommand = new CopyJobCommand(); - command = new CLICommandInvoker(j, copyJobCommand); - } - - @Issue("SECURITY-2424") - @Test public void cannotCopyJobWithTrailingDot_regular() throws Exception { - assertThat(j.jenkins.getItems(), Matchers.hasSize(0)); - j.createFreeStyleProject("job1"); - assertThat(j.jenkins.getItems(), Matchers.hasSize(1)); - - CLICommandInvoker.Result result = command.invokeWithArgs("job1", "job1."); - assertThat(result.stderr(), containsString(Messages.Hudson_TrailingDot())); - assertThat(result, failedWith(1)); - - assertThat(j.jenkins.getItems(), Matchers.hasSize(1)); - } - - @Issue("SECURITY-2424") - @Test public void cannotCopyJobWithTrailingDot_exceptIfEscapeHatchIsSet() throws Exception { - String propName = Jenkins.NAME_VALIDATION_REJECTS_TRAILING_DOT_PROP; - String initialValue = System.getProperty(propName); - System.setProperty(propName, "false"); - try { - assertThat(j.jenkins.getItems(), Matchers.hasSize(0)); - j.createFreeStyleProject("job1"); - assertThat(j.jenkins.getItems(), Matchers.hasSize(1)); - - CLICommandInvoker.Result result = command.invokeWithArgs("job1", "job1."); - assertThat(result, succeededSilently()); - - assertThat(j.jenkins.getItems(), Matchers.hasSize(2)); - } - finally { - if (initialValue == null) { - System.clearProperty(propName); - } else { - System.setProperty(propName, initialValue); - } - } - } -} diff --git a/test/src/test/java/hudson/cli/CopyJobCommandTest.java b/test/src/test/java/hudson/cli/CopyJobCommandTest.java index 522f28928a07..3d7266884a59 100644 --- a/test/src/test/java/hudson/cli/CopyJobCommandTest.java +++ b/test/src/test/java/hudson/cli/CopyJobCommandTest.java @@ -27,6 +27,7 @@ import static hudson.cli.CLICommandInvoker.Matcher.failedWith; import static hudson.cli.CLICommandInvoker.Matcher.succeededSilently; import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.containsString; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; @@ -34,6 +35,7 @@ import hudson.model.Item; import hudson.model.User; import jenkins.model.Jenkins; +import org.hamcrest.Matchers; import org.junit.Before; import org.junit.Rule; import org.junit.Test; @@ -105,4 +107,40 @@ public class CopyJobCommandTest { assertTrue(p2.isBuildable()); } + @Issue("SECURITY-2424") + @Test public void cannotCopyJobWithTrailingDot_regular() throws Exception { + assertThat(j.jenkins.getItems(), Matchers.hasSize(0)); + j.createFreeStyleProject("job1"); + assertThat(j.jenkins.getItems(), Matchers.hasSize(1)); + + CLICommandInvoker.Result result = command.invokeWithArgs("job1", "job1."); + assertThat(result.stderr(), containsString(hudson.model.Messages.Hudson_TrailingDot())); + assertThat(result, failedWith(1)); + + assertThat(j.jenkins.getItems(), Matchers.hasSize(1)); + } + + @Issue("SECURITY-2424") + @Test public void cannotCopyJobWithTrailingDot_exceptIfEscapeHatchIsSet() throws Exception { + String propName = Jenkins.NAME_VALIDATION_REJECTS_TRAILING_DOT_PROP; + String initialValue = System.getProperty(propName); + System.setProperty(propName, "false"); + try { + assertThat(j.jenkins.getItems(), Matchers.hasSize(0)); + j.createFreeStyleProject("job1"); + assertThat(j.jenkins.getItems(), Matchers.hasSize(1)); + + CLICommandInvoker.Result result = command.invokeWithArgs("job1", "job1."); + assertThat(result, succeededSilently()); + + assertThat(j.jenkins.getItems(), Matchers.hasSize(2)); + } + finally { + if (initialValue == null) { + System.clearProperty(propName); + } else { + System.setProperty(propName, initialValue); + } + } + } } diff --git a/test/src/test/java/hudson/cli/CreateJobCommandSEC2424Test.java b/test/src/test/java/hudson/cli/CreateJobCommandSEC2424Test.java deleted file mode 100644 index 8d8a0e2f49f3..000000000000 --- a/test/src/test/java/hudson/cli/CreateJobCommandSEC2424Test.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * The MIT License - * - * Copyright 2014 Jesse Glick. - * - * 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. - */ - -package hudson.cli; - -import static hudson.cli.CLICommandInvoker.Matcher.failedWith; -import static hudson.cli.CLICommandInvoker.Matcher.succeededSilently; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.containsString; - -import hudson.model.Messages; -import java.io.ByteArrayInputStream; -import java.nio.charset.StandardCharsets; -import jenkins.model.Jenkins; -import org.hamcrest.Matchers; -import org.junit.Rule; -import org.junit.Test; -import org.jvnet.hudson.test.Issue; -import org.jvnet.hudson.test.JenkinsRule; - - -//TODO merge back to CreateJobCommandTest after security release -public class CreateJobCommandSEC2424Test { - - @Rule public JenkinsRule r = new JenkinsRule(); - - @Issue("SECURITY-2424") - @Test public void cannotCreateJobWithTrailingDot_withoutOtherJob() { - CLICommand cmd = new CreateJobCommand(); - CLICommandInvoker invoker = new CLICommandInvoker(r, cmd); - assertThat(r.jenkins.getItems(), Matchers.hasSize(0)); - - CLICommandInvoker.Result result = invoker.withStdin(new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8))).invokeWithArgs("job1."); - assertThat(result.stderr(), containsString(Messages.Hudson_TrailingDot())); - assertThat(result, failedWith(1)); - - assertThat(r.jenkins.getItems(), Matchers.hasSize(0)); - } - - @Issue("SECURITY-2424") - @Test public void cannotCreateJobWithTrailingDot_withExistingJob() { - CLICommand cmd = new CreateJobCommand(); - CLICommandInvoker invoker = new CLICommandInvoker(r, cmd); - assertThat(r.jenkins.getItems(), Matchers.hasSize(0)); - assertThat(invoker.withStdin(new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8))).invokeWithArgs("job1"), succeededSilently()); - assertThat(r.jenkins.getItems(), Matchers.hasSize(1)); - - CLICommandInvoker.Result result = invoker.withStdin(new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8))).invokeWithArgs("job1."); - assertThat(result.stderr(), containsString(Messages.Hudson_TrailingDot())); - assertThat(result, failedWith(1)); - - assertThat(r.jenkins.getItems(), Matchers.hasSize(1)); - } - - @Issue("SECURITY-2424") - @Test public void cannotCreateJobWithTrailingDot_exceptIfEscapeHatchIsSet() { - String propName = Jenkins.NAME_VALIDATION_REJECTS_TRAILING_DOT_PROP; - String initialValue = System.getProperty(propName); - System.setProperty(propName, "false"); - try { - CLICommand cmd = new CreateJobCommand(); - CLICommandInvoker invoker = new CLICommandInvoker(r, cmd); - assertThat(r.jenkins.getItems(), Matchers.hasSize(0)); - assertThat(invoker.withStdin(new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8))).invokeWithArgs("job1."), succeededSilently()); - assertThat(r.jenkins.getItems(), Matchers.hasSize(1)); - } - finally { - if (initialValue == null) { - System.clearProperty(propName); - } else { - System.setProperty(propName, initialValue); - } - } - } -} diff --git a/test/src/test/java/hudson/cli/CreateJobCommandTest.java b/test/src/test/java/hudson/cli/CreateJobCommandTest.java index fc28e7bcc9f5..b7693a50b351 100644 --- a/test/src/test/java/hudson/cli/CreateJobCommandTest.java +++ b/test/src/test/java/hudson/cli/CreateJobCommandTest.java @@ -27,6 +27,7 @@ import static hudson.cli.CLICommandInvoker.Matcher.failedWith; import static hudson.cli.CLICommandInvoker.Matcher.succeededSilently; import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.containsString; import static org.junit.Assert.assertNotNull; import hudson.model.Item; @@ -34,6 +35,7 @@ import java.io.ByteArrayInputStream; import java.nio.charset.StandardCharsets; import jenkins.model.Jenkins; +import org.hamcrest.Matchers; import org.junit.Rule; import org.junit.Test; import org.jvnet.hudson.test.Issue; @@ -62,4 +64,52 @@ public class CreateJobCommandTest { assertNotNull(d.getItem("p")); } + @Issue("SECURITY-2424") + @Test public void cannotCreateJobWithTrailingDot_withoutOtherJob() { + CLICommand cmd = new CreateJobCommand(); + CLICommandInvoker invoker = new CLICommandInvoker(r, cmd); + assertThat(r.jenkins.getItems(), Matchers.hasSize(0)); + + CLICommandInvoker.Result result = invoker.withStdin(new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8))).invokeWithArgs("job1."); + assertThat(result.stderr(), containsString(hudson.model.Messages.Hudson_TrailingDot())); + assertThat(result, failedWith(1)); + + assertThat(r.jenkins.getItems(), Matchers.hasSize(0)); + } + + @Issue("SECURITY-2424") + @Test public void cannotCreateJobWithTrailingDot_withExistingJob() { + CLICommand cmd = new CreateJobCommand(); + CLICommandInvoker invoker = new CLICommandInvoker(r, cmd); + assertThat(r.jenkins.getItems(), Matchers.hasSize(0)); + assertThat(invoker.withStdin(new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8))).invokeWithArgs("job1"), succeededSilently()); + assertThat(r.jenkins.getItems(), Matchers.hasSize(1)); + + CLICommandInvoker.Result result = invoker.withStdin(new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8))).invokeWithArgs("job1."); + assertThat(result.stderr(), containsString(hudson.model.Messages.Hudson_TrailingDot())); + assertThat(result, failedWith(1)); + + assertThat(r.jenkins.getItems(), Matchers.hasSize(1)); + } + + @Issue("SECURITY-2424") + @Test public void cannotCreateJobWithTrailingDot_exceptIfEscapeHatchIsSet() { + String propName = Jenkins.NAME_VALIDATION_REJECTS_TRAILING_DOT_PROP; + String initialValue = System.getProperty(propName); + System.setProperty(propName, "false"); + try { + CLICommand cmd = new CreateJobCommand(); + CLICommandInvoker invoker = new CLICommandInvoker(r, cmd); + assertThat(r.jenkins.getItems(), Matchers.hasSize(0)); + assertThat(invoker.withStdin(new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8))).invokeWithArgs("job1."), succeededSilently()); + assertThat(r.jenkins.getItems(), Matchers.hasSize(1)); + } + finally { + if (initialValue == null) { + System.clearProperty(propName); + } else { + System.setProperty(propName, initialValue); + } + } + } } diff --git a/test/src/test/java/hudson/cli/CreateNodeCommandSEC2424Test.java b/test/src/test/java/hudson/cli/CreateNodeCommandSEC2424Test.java deleted file mode 100644 index 8d99978f39e2..000000000000 --- a/test/src/test/java/hudson/cli/CreateNodeCommandSEC2424Test.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * The MIT License - * - * Copyright 2013 Red Hat, 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. - */ - -package hudson.cli; - -import static hudson.cli.CLICommandInvoker.Matcher.failedWith; -import static hudson.cli.CLICommandInvoker.Matcher.hasNoStandardOutput; -import static hudson.cli.CLICommandInvoker.Matcher.succeededSilently; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.containsString; -import static org.junit.Assert.assertEquals; - -import hudson.model.Messages; -import java.io.ByteArrayInputStream; -import java.nio.charset.StandardCharsets; -import jenkins.model.Jenkins; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.jvnet.hudson.test.Issue; -import org.jvnet.hudson.test.JenkinsRule; - - -//TODO merge back to CreateNodeCommandTest after security release -public class CreateNodeCommandSEC2424Test { - - private CLICommandInvoker command; - - @Rule public final JenkinsRule j = new JenkinsRule(); - - @Before public void setUp() { - - command = new CLICommandInvoker(j, new CreateNodeCommand()); - } - - @Test - @Issue("SECURITY-2424") - public void cannotCreateNodeWithTrailingDot_withoutOtherNode() { - int nodeListSizeBefore = j.jenkins.getNodes().size(); - - CLICommandInvoker.Result result = command - .withStdin(new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8))) - .invokeWithArgs("nodeA.") - ; - - assertThat(result.stderr(), containsString(Messages.Hudson_TrailingDot())); - assertThat(result, hasNoStandardOutput()); - assertThat(result, failedWith(1)); - - // ensure not side effects - assertEquals(nodeListSizeBefore, j.jenkins.getNodes().size()); - } - - @Test - @Issue("SECURITY-2424") - public void cannotCreateNodeWithTrailingDot_withExistingNode() { - int nodeListSizeBefore = j.jenkins.getNodes().size(); - - assertThat(command.withStdin(new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8))).invokeWithArgs("nodeA"), succeededSilently()); - assertEquals(nodeListSizeBefore + 1, j.jenkins.getNodes().size()); - - CLICommandInvoker.Result result = command - .withStdin(new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8))) - .invokeWithArgs("nodeA.") - ; - - assertThat(result.stderr(), containsString(Messages.Hudson_TrailingDot())); - assertThat(result, hasNoStandardOutput()); - assertThat(result, failedWith(1)); - - // ensure not side effects - assertEquals(nodeListSizeBefore + 1, j.jenkins.getNodes().size()); - } - - @Test - @Issue("SECURITY-2424") - public void cannotCreateNodeWithTrailingDot_exceptIfEscapeHatchIsSet() { - String propName = Jenkins.NAME_VALIDATION_REJECTS_TRAILING_DOT_PROP; - String initialValue = System.getProperty(propName); - System.setProperty(propName, "false"); - try { - int nodeListSizeBefore = j.jenkins.getNodes().size(); - - assertThat(command.withStdin(new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8))).invokeWithArgs("nodeA"), succeededSilently()); - assertEquals(nodeListSizeBefore + 1, j.jenkins.getNodes().size()); - - CLICommandInvoker.Result result = command - .withStdin(new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8))) - .invokeWithArgs("nodeA.") - ; - - assertThat(result, succeededSilently()); - - assertEquals(nodeListSizeBefore + 2, j.jenkins.getNodes().size()); - } - finally { - if (initialValue == null) { - System.clearProperty(propName); - } else { - System.setProperty(propName, initialValue); - } - } - } -} diff --git a/test/src/test/java/hudson/cli/CreateNodeCommandTest.java b/test/src/test/java/hudson/cli/CreateNodeCommandTest.java index a241f1e74402..52970ae27e27 100644 --- a/test/src/test/java/hudson/cli/CreateNodeCommandTest.java +++ b/test/src/test/java/hudson/cli/CreateNodeCommandTest.java @@ -37,6 +37,8 @@ import hudson.model.Messages; import hudson.model.Node; import hudson.model.Slave; +import java.io.ByteArrayInputStream; +import java.nio.charset.StandardCharsets; import jenkins.model.Jenkins; import org.junit.Before; import org.junit.Rule; @@ -167,4 +169,73 @@ public void createNodeShouldFailIfNodeIsNotGood() { // ensure not side effects assertEquals(nodeListSizeBefore, j.jenkins.getNodes().size()); } + + @Test + @Issue("SECURITY-2424") + public void cannotCreateNodeWithTrailingDot_withoutOtherNode() { + int nodeListSizeBefore = j.jenkins.getNodes().size(); + + CLICommandInvoker.Result result = command + .withStdin(new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8))) + .invokeWithArgs("nodeA.") + ; + + assertThat(result.stderr(), containsString(Messages.Hudson_TrailingDot())); + assertThat(result, hasNoStandardOutput()); + assertThat(result, failedWith(1)); + + // ensure not side effects + assertEquals(nodeListSizeBefore, j.jenkins.getNodes().size()); + } + + @Test + @Issue("SECURITY-2424") + public void cannotCreateNodeWithTrailingDot_withExistingNode() { + int nodeListSizeBefore = j.jenkins.getNodes().size(); + + assertThat(command.withStdin(new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8))).invokeWithArgs("nodeA"), succeededSilently()); + assertEquals(nodeListSizeBefore + 1, j.jenkins.getNodes().size()); + + CLICommandInvoker.Result result = command + .withStdin(new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8))) + .invokeWithArgs("nodeA.") + ; + + assertThat(result.stderr(), containsString(Messages.Hudson_TrailingDot())); + assertThat(result, hasNoStandardOutput()); + assertThat(result, failedWith(1)); + + // ensure not side effects + assertEquals(nodeListSizeBefore + 1, j.jenkins.getNodes().size()); + } + + @Test + @Issue("SECURITY-2424") + public void cannotCreateNodeWithTrailingDot_exceptIfEscapeHatchIsSet() { + String propName = Jenkins.NAME_VALIDATION_REJECTS_TRAILING_DOT_PROP; + String initialValue = System.getProperty(propName); + System.setProperty(propName, "false"); + try { + int nodeListSizeBefore = j.jenkins.getNodes().size(); + + assertThat(command.withStdin(new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8))).invokeWithArgs("nodeA"), succeededSilently()); + assertEquals(nodeListSizeBefore + 1, j.jenkins.getNodes().size()); + + CLICommandInvoker.Result result = command + .withStdin(new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8))) + .invokeWithArgs("nodeA.") + ; + + assertThat(result, succeededSilently()); + + assertEquals(nodeListSizeBefore + 2, j.jenkins.getNodes().size()); + } + finally { + if (initialValue == null) { + System.clearProperty(propName); + } else { + System.setProperty(propName, initialValue); + } + } + } } diff --git a/test/src/test/java/hudson/model/CauseSECURITY2452Test.java b/test/src/test/java/hudson/model/CauseSECURITY2452Test.java deleted file mode 100644 index b1abe15ddc42..000000000000 --- a/test/src/test/java/hudson/model/CauseSECURITY2452Test.java +++ /dev/null @@ -1,48 +0,0 @@ -package hudson.model; - -import org.junit.Assert; -import org.junit.Rule; -import org.junit.Test; -import org.jvnet.hudson.test.Issue; -import org.jvnet.hudson.test.JenkinsRule; - -// TODO Merge into CauseTest after release -public class CauseSECURITY2452Test { - - @Rule - public JenkinsRule j = new JenkinsRule(); - - @Test - @Issue("SECURITY-2452") - public void basicCauseIsSafe() throws Exception { - final FreeStyleProject fs = j.createFreeStyleProject(); - { - final FreeStyleBuild build = j.waitForCompletion(fs.scheduleBuild2(0, new SimpleCause("safe")).get()); - - final JenkinsRule.WebClient wc = j.createWebClient(); - final String content = wc.getPage(build).getWebResponse().getContentAsString(); - Assert.assertTrue(content.contains("Simple cause: safe")); - } - { - final FreeStyleBuild build = j.waitForCompletion(fs.scheduleBuild2(0, new SimpleCause("")).get()); - - final JenkinsRule.WebClient wc = j.createWebClient(); - final String content = wc.getPage(build).getWebResponse().getContentAsString(); - Assert.assertFalse(content.contains("Simple cause: > B waitForDownBuild(Project down) throws Ex return result; } + + @Test + @Issue("SECURITY-2452") + public void basicCauseIsSafe() throws Exception { + final FreeStyleProject fs = j.createFreeStyleProject(); + { + final FreeStyleBuild build = j.waitForCompletion(fs.scheduleBuild2(0, new SimpleCause("safe")).get()); + + final JenkinsRule.WebClient wc = j.createWebClient(); + final String content = wc.getPage(build).getWebResponse().getContentAsString(); + Assert.assertTrue(content.contains("Simple cause: safe")); + } + { + final FreeStyleBuild build = j.waitForCompletion(fs.scheduleBuild2(0, new SimpleCause("")).get()); + + final JenkinsRule.WebClient wc = j.createWebClient(); + final String content = wc.getPage(build).getWebResponse().getContentAsString(); + Assert.assertFalse(content.contains("Simple cause: { public CustomBuild(FullNameChangingProject job) throws IOException { super(job); diff --git a/test/src/test/java/hudson/model/DirectoryBrowserSupportSEC2481Test.java b/test/src/test/java/hudson/model/DirectoryBrowserSupportSEC2481Test.java deleted file mode 100644 index 34b20b2ba2db..000000000000 --- a/test/src/test/java/hudson/model/DirectoryBrowserSupportSEC2481Test.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * The MIT License - * - * Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi - * - * 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. - */ -package hudson.model; - -import com.gargoylesoftware.htmlunit.Page; -import hudson.Functions; -import org.apache.commons.io.FileUtils; -import org.hamcrest.CoreMatchers; -import org.hamcrest.MatcherAssert; -import org.junit.Assume; -import org.junit.Rule; -import org.junit.Test; -import org.jvnet.hudson.test.Issue; -import org.jvnet.hudson.test.JenkinsRule; - -import java.io.File; -import java.nio.charset.StandardCharsets; - -//TODO merge back to DirectoryBrowserSupportTest -public class DirectoryBrowserSupportSEC2481Test { - - @Rule - public JenkinsRule j = new JenkinsRule(); - - @Test - @Issue("SECURITY-2481") - public void windows_cannotViewAbsolutePath() throws Exception { - Assume.assumeTrue("can only be tested this on Windows", Functions.isWindows()); - - File targetTmpFile = File.createTempFile("sec2481", "tmp"); - String content = "random data provided as fixed value"; - FileUtils.writeStringToFile(targetTmpFile, content, StandardCharsets.UTF_8); - - JenkinsRule.WebClient wc = j.createWebClient().withThrowExceptionOnFailingStatusCode(false); - Page page = wc.goTo("userContent/" + targetTmpFile.getAbsolutePath() + "/*view*", null); - - MatcherAssert.assertThat(page.getWebResponse().getStatusCode(), CoreMatchers.equalTo(404)); - } - - @Test - @Issue("SECURITY-2481") - public void windows_canViewAbsolutePath_withEscapeHatch() throws Exception { - Assume.assumeTrue("can only be tested this on Windows", Functions.isWindows()); - - String originalValue = System.getProperty(DirectoryBrowserSupport.ALLOW_ABSOLUTE_PATH_PROPERTY_NAME); - System.setProperty(DirectoryBrowserSupport.ALLOW_ABSOLUTE_PATH_PROPERTY_NAME, "true"); - try { - File targetTmpFile = File.createTempFile("sec2481", "tmp"); - String content = "random data provided as fixed value"; - FileUtils.writeStringToFile(targetTmpFile, content, StandardCharsets.UTF_8); - - JenkinsRule.WebClient wc = j.createWebClient().withThrowExceptionOnFailingStatusCode(false); - Page page = wc.goTo("userContent/" + targetTmpFile.getAbsolutePath() + "/*view*", null); - - MatcherAssert.assertThat(page.getWebResponse().getStatusCode(), CoreMatchers.equalTo(200)); - MatcherAssert.assertThat(page.getWebResponse().getContentAsString(), CoreMatchers.containsString(content)); - } finally { - if (originalValue == null) { - System.clearProperty(DirectoryBrowserSupport.ALLOW_ABSOLUTE_PATH_PROPERTY_NAME); - } else { - System.setProperty(DirectoryBrowserSupport.ALLOW_ABSOLUTE_PATH_PROPERTY_NAME, originalValue); - } - } - - } - - @Test - public void canViewRelativePath() throws Exception { - File testFile = new File(j.jenkins.getRootDir(), "userContent/test.txt"); - String content = "random data provided as fixed value"; - - FileUtils.writeStringToFile(testFile, content, StandardCharsets.UTF_8); - - JenkinsRule.WebClient wc = j.createWebClient().withThrowExceptionOnFailingStatusCode(false); - Page page = wc.goTo("userContent/test.txt/*view*", null); - - MatcherAssert.assertThat(page.getWebResponse().getStatusCode(), CoreMatchers.equalTo(200)); - MatcherAssert.assertThat(page.getWebResponse().getContentAsString(), CoreMatchers.containsString(content)); - } -} diff --git a/test/src/test/java/hudson/model/DirectoryBrowserSupportTest.java b/test/src/test/java/hudson/model/DirectoryBrowserSupportTest.java index f271afc5358c..7ecfa13bfb2e 100644 --- a/test/src/test/java/hudson/model/DirectoryBrowserSupportTest.java +++ b/test/src/test/java/hudson/model/DirectoryBrowserSupportTest.java @@ -83,6 +83,8 @@ import jenkins.util.VirtualFile; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; +import org.hamcrest.CoreMatchers; +import org.hamcrest.MatcherAssert; import org.junit.Assume; import org.junit.Rule; import org.junit.Test; @@ -1055,6 +1057,62 @@ private String loadContentFromResource(String fileNameInResources) throws IOExce return FileUtils.readFileToString(resourceFile, StandardCharsets.UTF_8); } + @Test + @Issue("SECURITY-2481") + public void windows_cannotViewAbsolutePath() throws Exception { + Assume.assumeTrue("can only be tested this on Windows", Functions.isWindows()); + + File targetTmpFile = File.createTempFile("sec2481", "tmp"); + String content = "random data provided as fixed value"; + FileUtils.writeStringToFile(targetTmpFile, content, StandardCharsets.UTF_8); + + JenkinsRule.WebClient wc = j.createWebClient().withThrowExceptionOnFailingStatusCode(false); + Page page = wc.goTo("userContent/" + targetTmpFile.getAbsolutePath() + "/*view*", null); + + MatcherAssert.assertThat(page.getWebResponse().getStatusCode(), CoreMatchers.equalTo(404)); + } + + @Test + @Issue("SECURITY-2481") + public void windows_canViewAbsolutePath_withEscapeHatch() throws Exception { + Assume.assumeTrue("can only be tested this on Windows", Functions.isWindows()); + + String originalValue = System.getProperty(DirectoryBrowserSupport.ALLOW_ABSOLUTE_PATH_PROPERTY_NAME); + System.setProperty(DirectoryBrowserSupport.ALLOW_ABSOLUTE_PATH_PROPERTY_NAME, "true"); + try { + File targetTmpFile = File.createTempFile("sec2481", "tmp"); + String content = "random data provided as fixed value"; + FileUtils.writeStringToFile(targetTmpFile, content, StandardCharsets.UTF_8); + + JenkinsRule.WebClient wc = j.createWebClient().withThrowExceptionOnFailingStatusCode(false); + Page page = wc.goTo("userContent/" + targetTmpFile.getAbsolutePath() + "/*view*", null); + + MatcherAssert.assertThat(page.getWebResponse().getStatusCode(), CoreMatchers.equalTo(200)); + MatcherAssert.assertThat(page.getWebResponse().getContentAsString(), CoreMatchers.containsString(content)); + } finally { + if (originalValue == null) { + System.clearProperty(DirectoryBrowserSupport.ALLOW_ABSOLUTE_PATH_PROPERTY_NAME); + } else { + System.setProperty(DirectoryBrowserSupport.ALLOW_ABSOLUTE_PATH_PROPERTY_NAME, originalValue); + } + } + + } + + @Test + public void canViewRelativePath() throws Exception { + File testFile = new File(j.jenkins.getRootDir(), "userContent/test.txt"); + String content = "random data provided as fixed value"; + + FileUtils.writeStringToFile(testFile, content, StandardCharsets.UTF_8); + + JenkinsRule.WebClient wc = j.createWebClient().withThrowExceptionOnFailingStatusCode(false); + Page page = wc.goTo("userContent/test.txt/*view*", null); + + MatcherAssert.assertThat(page.getWebResponse().getStatusCode(), CoreMatchers.equalTo(200)); + MatcherAssert.assertThat(page.getWebResponse().getContentAsString(), CoreMatchers.containsString(content)); + } + public static final class SimulatedExternalArtifactManagerFactory extends ArtifactManagerFactory { @Override public ArtifactManager managerFor(Run build) { diff --git a/test/src/test/java/hudson/model/FreeStyleProjectSEC2424Test.java b/test/src/test/java/hudson/model/FreeStyleProjectSEC2424Test.java deleted file mode 100644 index cf204a196859..000000000000 --- a/test/src/test/java/hudson/model/FreeStyleProjectSEC2424Test.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * The MIT License - * - * Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi - * - * 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. - */ -package hudson.model; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.hasSize; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; - -import java.io.ByteArrayInputStream; -import jenkins.model.Jenkins; -import org.junit.Rule; -import org.junit.Test; -import org.jvnet.hudson.test.Issue; -import org.jvnet.hudson.test.JenkinsRule; - -//TODO merge back to FreeStyleProjectTest after security release -public class FreeStyleProjectSEC2424Test { - - @Rule - public JenkinsRule j = new JenkinsRule(); - - @Test - @Issue("SECURITY-2424") - public void cannotCreateJobWithTrailingDot_withoutOtherJob() throws Exception { - assertThat(j.jenkins.getItems(), hasSize(0)); - try { - j.jenkins.createProjectFromXML("jobA.", new ByteArrayInputStream("".getBytes())); - fail("Adding the job should have thrown an exception during checkGoodName"); - } - catch (Failure e) { - assertEquals(Messages.Hudson_TrailingDot(), e.getMessage()); - } - assertThat(j.jenkins.getItems(), hasSize(0)); - } - - @Test - @Issue("SECURITY-2424") - public void cannotCreateJobWithTrailingDot_withExistingJob() throws Exception { - assertThat(j.jenkins.getItems(), hasSize(0)); - j.createFreeStyleProject("jobA"); - assertThat(j.jenkins.getItems(), hasSize(1)); - try { - j.jenkins.createProjectFromXML("jobA.", new ByteArrayInputStream("".getBytes())); - fail("Adding the job should have thrown an exception during checkGoodName"); - } - catch (Failure e) { - assertEquals(Messages.Hudson_TrailingDot(), e.getMessage()); - } - assertThat(j.jenkins.getItems(), hasSize(1)); - } - - @Issue("SECURITY-2424") - @Test public void cannotCreateJobWithTrailingDot_exceptIfEscapeHatchIsSet() throws Exception { - String propName = Jenkins.NAME_VALIDATION_REJECTS_TRAILING_DOT_PROP; - String initialValue = System.getProperty(propName); - System.setProperty(propName, "false"); - try { - assertThat(j.jenkins.getItems(), hasSize(0)); - j.jenkins.createProjectFromXML("jobA.", new ByteArrayInputStream("".getBytes())); - } - finally { - if (initialValue == null) { - System.clearProperty(propName); - } else { - System.setProperty(propName, initialValue); - } - } - assertThat(j.jenkins.getItems(), hasSize(1)); - } -} diff --git a/test/src/test/java/hudson/model/FreeStyleProjectTest.java b/test/src/test/java/hudson/model/FreeStyleProjectTest.java index 3b69ef6de738..879dedf9d55d 100644 --- a/test/src/test/java/hudson/model/FreeStyleProjectTest.java +++ b/test/src/test/java/hudson/model/FreeStyleProjectTest.java @@ -25,12 +25,14 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotSame; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertThrows; +import static org.junit.Assert.fail; import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException; import com.gargoylesoftware.htmlunit.HttpMethod; @@ -239,4 +241,53 @@ public void submitPossibleWithJellyTrace() throws Exception { JellyFacet.TRACE = currentValue; } } + + @Test + @Issue("SECURITY-2424") + public void cannotCreateJobWithTrailingDot_withoutOtherJob() throws Exception { + assertThat(j.jenkins.getItems(), hasSize(0)); + try { + j.jenkins.createProjectFromXML("jobA.", new ByteArrayInputStream("".getBytes())); + fail("Adding the job should have thrown an exception during checkGoodName"); + } + catch (Failure e) { + assertEquals(Messages.Hudson_TrailingDot(), e.getMessage()); + } + assertThat(j.jenkins.getItems(), hasSize(0)); + } + + @Test + @Issue("SECURITY-2424") + public void cannotCreateJobWithTrailingDot_withExistingJob() throws Exception { + assertThat(j.jenkins.getItems(), hasSize(0)); + j.createFreeStyleProject("jobA"); + assertThat(j.jenkins.getItems(), hasSize(1)); + try { + j.jenkins.createProjectFromXML("jobA.", new ByteArrayInputStream("".getBytes())); + fail("Adding the job should have thrown an exception during checkGoodName"); + } + catch (Failure e) { + assertEquals(Messages.Hudson_TrailingDot(), e.getMessage()); + } + assertThat(j.jenkins.getItems(), hasSize(1)); + } + + @Issue("SECURITY-2424") + @Test public void cannotCreateJobWithTrailingDot_exceptIfEscapeHatchIsSet() throws Exception { + String propName = Jenkins.NAME_VALIDATION_REJECTS_TRAILING_DOT_PROP; + String initialValue = System.getProperty(propName); + System.setProperty(propName, "false"); + try { + assertThat(j.jenkins.getItems(), hasSize(0)); + j.jenkins.createProjectFromXML("jobA.", new ByteArrayInputStream("".getBytes())); + } + finally { + if (initialValue == null) { + System.clearProperty(propName); + } else { + System.setProperty(propName, initialValue); + } + } + assertThat(j.jenkins.getItems(), hasSize(1)); + } } diff --git a/test/src/test/java/jenkins/model/NodesSEC2424Test.java b/test/src/test/java/jenkins/model/NodesSEC2424Test.java deleted file mode 100644 index c1040bb0c469..000000000000 --- a/test/src/test/java/jenkins/model/NodesSEC2424Test.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * The MIT License - * - * Copyright 2018 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. - */ - -package jenkins.model; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.hasSize; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; - -import hudson.model.Failure; -import hudson.model.Messages; -import hudson.slaves.DumbSlave; -import org.junit.Rule; -import org.junit.Test; -import org.jvnet.hudson.test.Issue; -import org.jvnet.hudson.test.JenkinsRule; - -//TODO merge back to NodesTest after security release -public class NodesSEC2424Test { - - @Rule - public JenkinsRule r = new JenkinsRule(); - - @Test - @Issue("SECURITY-2424") - public void cannotCreateNodeWithTrailingDot_withoutOtherNode() throws Exception { - assertThat(r.jenkins.getNodes(), hasSize(0)); - - DumbSlave node = new DumbSlave("nodeA.", "temp", r.createComputerLauncher(null)); - try { - r.jenkins.addNode(node); - fail("Adding the node should have thrown an exception during checkGoodName"); - } catch (Failure e) { - assertEquals(Messages.Hudson_TrailingDot(), e.getMessage()); - } - - assertThat(r.jenkins.getNodes(), hasSize(0)); - } - - @Test - @Issue("SECURITY-2424") - public void cannotCreateNodeWithTrailingDot_withExistingNode() throws Exception { - assertThat(r.jenkins.getNodes(), hasSize(0)); - r.createSlave("nodeA", "", null); - assertThat(r.jenkins.getNodes(), hasSize(1)); - - DumbSlave node = new DumbSlave("nodeA.", "temp", r.createComputerLauncher(null)); - try { - r.jenkins.addNode(node); - fail("Adding the node should have thrown an exception during checkGoodName"); - } catch (Failure e) { - assertEquals(Messages.Hudson_TrailingDot(), e.getMessage()); - } - - assertThat(r.jenkins.getNodes(), hasSize(1)); - } - - @Test - @Issue("SECURITY-2424") - public void cannotCreateNodeWithTrailingDot_exceptIfEscapeHatchIsSet() throws Exception { - String propName = Jenkins.NAME_VALIDATION_REJECTS_TRAILING_DOT_PROP; - String initialValue = System.getProperty(propName); - System.setProperty(propName, "false"); - try { - assertThat(r.jenkins.getNodes(), hasSize(0)); - - DumbSlave node = new DumbSlave("nodeA.", "temp", r.createComputerLauncher(null)); - r.jenkins.addNode(node); - - assertThat(r.jenkins.getNodes(), hasSize(1)); - } finally { - if (initialValue == null) { - System.clearProperty(propName); - } else { - System.setProperty(propName, initialValue); - } - } - } -} diff --git a/test/src/test/java/jenkins/model/NodesTest.java b/test/src/test/java/jenkins/model/NodesTest.java index df0705dc536f..8df019806881 100644 --- a/test/src/test/java/jenkins/model/NodesTest.java +++ b/test/src/test/java/jenkins/model/NodesTest.java @@ -26,6 +26,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.Matchers.sameInstance; import static org.junit.Assert.assertEquals; @@ -33,12 +34,15 @@ import static org.junit.Assert.assertNotSame; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertThrows; +import static org.junit.Assert.fail; import hudson.ExtensionList; import hudson.model.Descriptor; +import hudson.model.Failure; import hudson.model.Node; import hudson.model.Slave; import hudson.slaves.ComputerLauncher; +import hudson.slaves.DumbSlave; import java.io.IOException; import org.junit.Rule; import org.junit.Test; @@ -137,4 +141,60 @@ private static class InvalidNode extends Slave { super(name, remoteFS, launcher); } } + + @Test + @Issue("SECURITY-2424") + public void cannotCreateNodeWithTrailingDot_withoutOtherNode() throws Exception { + assertThat(r.jenkins.getNodes(), hasSize(0)); + + DumbSlave node = new DumbSlave("nodeA.", "temp", r.createComputerLauncher(null)); + try { + r.jenkins.addNode(node); + fail("Adding the node should have thrown an exception during checkGoodName"); + } catch (Failure e) { + assertEquals(hudson.model.Messages.Hudson_TrailingDot(), e.getMessage()); + } + + assertThat(r.jenkins.getNodes(), hasSize(0)); + } + + @Test + @Issue("SECURITY-2424") + public void cannotCreateNodeWithTrailingDot_withExistingNode() throws Exception { + assertThat(r.jenkins.getNodes(), hasSize(0)); + r.createSlave("nodeA", "", null); + assertThat(r.jenkins.getNodes(), hasSize(1)); + + DumbSlave node = new DumbSlave("nodeA.", "temp", r.createComputerLauncher(null)); + try { + r.jenkins.addNode(node); + fail("Adding the node should have thrown an exception during checkGoodName"); + } catch (Failure e) { + assertEquals(hudson.model.Messages.Hudson_TrailingDot(), e.getMessage()); + } + + assertThat(r.jenkins.getNodes(), hasSize(1)); + } + + @Test + @Issue("SECURITY-2424") + public void cannotCreateNodeWithTrailingDot_exceptIfEscapeHatchIsSet() throws Exception { + String propName = Jenkins.NAME_VALIDATION_REJECTS_TRAILING_DOT_PROP; + String initialValue = System.getProperty(propName); + System.setProperty(propName, "false"); + try { + assertThat(r.jenkins.getNodes(), hasSize(0)); + + DumbSlave node = new DumbSlave("nodeA.", "temp", r.createComputerLauncher(null)); + r.jenkins.addNode(node); + + assertThat(r.jenkins.getNodes(), hasSize(1)); + } finally { + if (initialValue == null) { + System.clearProperty(propName); + } else { + System.setProperty(propName, initialValue); + } + } + } } From bf65367f2cc9d0e61807e7d20b646b02fefea46d Mon Sep 17 00:00:00 2001 From: Stefan Spieker Date: Wed, 13 Oct 2021 11:27:20 +0200 Subject: [PATCH 35/66] Replaced magic constants in Calender constructors (#5799) --- .../scheduler/CronTabDayOfWeekLocaleTest.java | 76 +++++++++--------- .../scheduler/CronTabEventualityTest.java | 18 ++--- .../java/hudson/scheduler/CronTabTest.java | 80 +++++++++---------- 3 files changed, 87 insertions(+), 87 deletions(-) diff --git a/core/src/test/java/hudson/scheduler/CronTabDayOfWeekLocaleTest.java b/core/src/test/java/hudson/scheduler/CronTabDayOfWeekLocaleTest.java index ccd1a5e5b092..1588f133685f 100644 --- a/core/src/test/java/hudson/scheduler/CronTabDayOfWeekLocaleTest.java +++ b/core/src/test/java/hudson/scheduler/CronTabDayOfWeekLocaleTest.java @@ -51,7 +51,7 @@ public CronTabDayOfWeekLocaleTest(Locale locale) { @Issue("HUDSON-8656") // This is _not_ JENKINS-8656 public void hudson8656() throws Exception { final Calendar cal = Calendar.getInstance(locale); - cal.set(2011, 0, 16, 0, 0, 0); // Sunday, Jan 16th 2011, 00:00 + cal.set(2011, Calendar.JANUARY, 16, 0, 0, 0); // Sunday, Jan 16th 2011, 00:00 final String cronStr = "0 23 * * 1-5"; // execute on weekdays @23:00 final CronTab cron = new CronTab(cronStr); @@ -59,14 +59,14 @@ public void hudson8656() throws Exception { final Calendar expectedDate = Calendar.getInstance(); // Expected next: Monday, Jan 17th 2011, 23:00 - expectedDate.set(2011, 0, 17, 23, 0, 0); + expectedDate.set(2011, Calendar.JANUARY, 17, 23, 0, 0); compare(expectedDate, next); } @Test public void isSundayAndNextRunIsMonday() throws Exception { final Calendar cal = Calendar.getInstance(locale); - cal.set(2011, 0, 16, 0, 0, 0); // Sunday, Jan 16th 2011, 00:00 + cal.set(2011, Calendar.JANUARY, 16, 0, 0, 0); // Sunday, Jan 16th 2011, 00:00 final String cronStr = "0 0 * * 1"; // Mondays @00:00 final CronTab cron = new CronTab(cronStr); @@ -74,14 +74,14 @@ public void isSundayAndNextRunIsMonday() throws Exception { final Calendar expected = Calendar.getInstance(); // Expected next: Monday, Jan 17th 2011, 00:00 - expected.set(2011, 0, 17, 0, 0, 0); + expected.set(2011, Calendar.JANUARY, 17, 0, 0, 0); compare(expected, actual); } @Test public void isSundayAndPreviousRunIsMonday() throws Exception { final Calendar cal = Calendar.getInstance(locale); - cal.set(2011, 0, 16, 0, 0, 0); // Sunday, Jan 16th 2011, 00:00 + cal.set(2011, Calendar.JANUARY, 16, 0, 0, 0); // Sunday, Jan 16th 2011, 00:00 final String cronStr = "0 0 * * 1"; // Mondays @00:00 final CronTab cron = new CronTab(cronStr); @@ -89,14 +89,14 @@ public void isSundayAndPreviousRunIsMonday() throws Exception { final Calendar expected = Calendar.getInstance(); // Expected next: Monday, Jan 10th 2011, 00:00 - expected.set(2011, 0, 10, 0, 0, 0); + expected.set(2011, Calendar.JANUARY, 10, 0, 0, 0); compare(expected, actual); } @Test public void isSundayAndNextRunIsTuesday() throws Exception { final Calendar cal = Calendar.getInstance(locale); - cal.set(2011, 0, 16, 0, 0, 0); // Sunday, Jan 16th 2011, 00:00 + cal.set(2011, Calendar.JANUARY, 16, 0, 0, 0); // Sunday, Jan 16th 2011, 00:00 final String cronStr = "0 0 * * 2"; // Tuesdays @00:00 final CronTab cron = new CronTab(cronStr); @@ -104,14 +104,14 @@ public void isSundayAndNextRunIsTuesday() throws Exception { final Calendar expected = Calendar.getInstance(); // Expected next: Tuesday, Jan 18th 2011, 00:00 - expected.set(2011, 0, 18, 0, 0, 0); + expected.set(2011, Calendar.JANUARY, 18, 0, 0, 0); compare(expected, actual); } @Test public void isSundayAndPreviousRunIsTuesday() throws Exception { final Calendar cal = Calendar.getInstance(locale); - cal.set(2011, 0, 16, 0, 0, 0); // Sunday, Jan 16th 2011, 00:00 + cal.set(2011, Calendar.JANUARY, 16, 0, 0, 0); // Sunday, Jan 16th 2011, 00:00 final String cronStr = "0 0 * * 2"; // Tuesdays @00:00 final CronTab cron = new CronTab(cronStr); @@ -119,14 +119,14 @@ public void isSundayAndPreviousRunIsTuesday() throws Exception { final Calendar expected = Calendar.getInstance(); // Expected next: Tuesday, Jan 11th 2011, 00:00 - expected.set(2011, 0, 11, 0, 0, 0); + expected.set(2011, Calendar.JANUARY, 11, 0, 0, 0); compare(expected, actual); } @Test public void isSundayAndNextRunIsWednesday() throws Exception { final Calendar cal = Calendar.getInstance(locale); - cal.set(2011, 0, 16, 0, 0, 0); // Sunday, Jan 16th 2011, 00:00 + cal.set(2011, Calendar.JANUARY, 16, 0, 0, 0); // Sunday, Jan 16th 2011, 00:00 final String cronStr = "0 0 * * 3"; // Wednesdays @00:00 final CronTab cron = new CronTab(cronStr); @@ -134,14 +134,14 @@ public void isSundayAndNextRunIsWednesday() throws Exception { final Calendar expected = Calendar.getInstance(); // Expected next: Wednesday, Jan 19th 2011, 00:00 - expected.set(2011, 0, 19, 0, 0, 0); + expected.set(2011, Calendar.JANUARY, 19, 0, 0, 0); compare(expected, actual); } @Test public void isSundayAndPreviousRunIsWednesday() throws Exception { final Calendar cal = Calendar.getInstance(locale); - cal.set(2011, 0, 16, 0, 0, 0); // Sunday, Jan 16th 2011, 00:00 + cal.set(2011, Calendar.JANUARY, 16, 0, 0, 0); // Sunday, Jan 16th 2011, 00:00 final String cronStr = "0 0 * * 3"; // Wednesdays @00:00 final CronTab cron = new CronTab(cronStr); @@ -149,14 +149,14 @@ public void isSundayAndPreviousRunIsWednesday() throws Exception { final Calendar expected = Calendar.getInstance(); // Expected next: Wednesday, Jan 12th 2011, 00:00 - expected.set(2011, 0, 12, 0, 0, 0); + expected.set(2011, Calendar.JANUARY, 12, 0, 0, 0); compare(expected, actual); } @Test public void isSundayAndNextRunIsThursday() throws Exception { final Calendar cal = Calendar.getInstance(locale); - cal.set(2011, 0, 16, 0, 0, 0); // Sunday, Jan 16th 2011, 00:00 + cal.set(2011, Calendar.JANUARY, 16, 0, 0, 0); // Sunday, Jan 16th 2011, 00:00 final String cronStr = "0 0 * * 4"; // Thursdays @00:00 final CronTab cron = new CronTab(cronStr); @@ -164,14 +164,14 @@ public void isSundayAndNextRunIsThursday() throws Exception { final Calendar expected = Calendar.getInstance(); // Expected next: Thursday, Jan 20th 2011, 00:00 - expected.set(2011, 0, 20, 0, 0, 0); + expected.set(2011, Calendar.JANUARY, 20, 0, 0, 0); compare(expected, actual); } @Test public void isSundayAndPreviousRunIsThursday() throws Exception { final Calendar cal = Calendar.getInstance(locale); - cal.set(2011, 0, 16, 0, 0, 0); // Sunday, Jan 16th 2011, 00:00 + cal.set(2011, Calendar.JANUARY, 16, 0, 0, 0); // Sunday, Jan 16th 2011, 00:00 final String cronStr = "0 0 * * 4"; // Thursdays @00:00 final CronTab cron = new CronTab(cronStr); @@ -179,14 +179,14 @@ public void isSundayAndPreviousRunIsThursday() throws Exception { final Calendar expected = Calendar.getInstance(); // Expected next: Thursday, Jan 13th 2011, 00:00 - expected.set(2011, 0, 13, 0, 0, 0); + expected.set(2011, Calendar.JANUARY, 13, 0, 0, 0); compare(expected, actual); } @Test public void isSundayAndNextRunIsFriday() throws Exception { final Calendar cal = Calendar.getInstance(locale); - cal.set(2011, 0, 16, 0, 0, 0); // Sunday, Jan 16th 2011, 00:00 + cal.set(2011, Calendar.JANUARY, 16, 0, 0, 0); // Sunday, Jan 16th 2011, 00:00 final String cronStr = "0 0 * * 5"; // Fridays @00:00 final CronTab cron = new CronTab(cronStr); @@ -194,14 +194,14 @@ public void isSundayAndNextRunIsFriday() throws Exception { final Calendar expected = Calendar.getInstance(); // Expected next: Friday, Jan 21th 2011, 00:00 - expected.set(2011, 0, 21, 0, 0, 0); + expected.set(2011, Calendar.JANUARY, 21, 0, 0, 0); compare(expected, actual); } @Test public void isSundayAndPreviousRunIsFriday() throws Exception { final Calendar cal = Calendar.getInstance(locale); - cal.set(2011, 0, 16, 0, 0, 0); // Sunday, Jan 16th 2011, 00:00 + cal.set(2011, Calendar.JANUARY, 16, 0, 0, 0); // Sunday, Jan 16th 2011, 00:00 final String cronStr = "0 0 * * 5"; // Fridays @00:00 final CronTab cron = new CronTab(cronStr); @@ -209,14 +209,14 @@ public void isSundayAndPreviousRunIsFriday() throws Exception { final Calendar expected = Calendar.getInstance(); // Expected next: Friday, Jan 14th 2011, 00:00 - expected.set(2011, 0, 14, 0, 0, 0); + expected.set(2011, Calendar.JANUARY, 14, 0, 0, 0); compare(expected, actual); } @Test public void isSundayAndNextRunIsSaturday() throws Exception { final Calendar cal = Calendar.getInstance(locale); - cal.set(2011, 0, 16, 0, 0, 0); // Sunday, Jan 16th 2011, 00:00 + cal.set(2011, Calendar.JANUARY, 16, 0, 0, 0); // Sunday, Jan 16th 2011, 00:00 final String cronStr = "0 0 * * 6"; // Saturdays @00:00 final CronTab cron = new CronTab(cronStr); @@ -224,14 +224,14 @@ public void isSundayAndNextRunIsSaturday() throws Exception { final Calendar expected = Calendar.getInstance(); // Expected next: Saturday, Jan 22th 2011, 00:00 - expected.set(2011, 0, 22, 0, 0, 0); + expected.set(2011, Calendar.JANUARY, 22, 0, 0, 0); compare(expected, actual); } @Test public void isSundayAndPreviousRunIsSaturday() throws Exception { final Calendar cal = Calendar.getInstance(locale); - cal.set(2011, 0, 16, 0, 0, 0); // Sunday, Jan 16th 2011, 00:00 + cal.set(2011, Calendar.JANUARY, 16, 0, 0, 0); // Sunday, Jan 16th 2011, 00:00 final String cronStr = "0 0 * * 6"; // Saturdays @00:00 final CronTab cron = new CronTab(cronStr); @@ -239,14 +239,14 @@ public void isSundayAndPreviousRunIsSaturday() throws Exception { final Calendar expected = Calendar.getInstance(); // Expected next: Saturday, Jan 15th 2011, 00:00 - expected.set(2011, 0, 15, 0, 0, 0); + expected.set(2011, Calendar.JANUARY, 15, 0, 0, 0); compare(expected, actual); } @Test public void isSundayAndNextRunIsNextSunday() throws Exception { final Calendar cal = Calendar.getInstance(locale); - cal.set(2011, 0, 16, 1, 0, 0); // Sunday, Jan 16th 2011, 01:00 + cal.set(2011, Calendar.JANUARY, 16, 1, 0, 0); // Sunday, Jan 16th 2011, 01:00 final String cronStr = "0 0 * * 0"; // Sundays @00:00 final CronTab cron = new CronTab(cronStr); @@ -254,14 +254,14 @@ public void isSundayAndNextRunIsNextSunday() throws Exception { final Calendar expected = Calendar.getInstance(); // Expected next: Sunday, Jan 22th 2011, 00:00 - expected.set(2011, 0, 23, 0, 0, 0); + expected.set(2011, Calendar.JANUARY, 23, 0, 0, 0); compare(expected, actual); } @Test public void isSundayAndPreviousRunIsPreviousSunday() throws Exception { final Calendar cal = Calendar.getInstance(locale); - cal.set(2011, 0, 16, 0, 0, 0); // Sunday, Jan 16th 2011, 00:00 + cal.set(2011, Calendar.JANUARY, 16, 0, 0, 0); // Sunday, Jan 16th 2011, 00:00 final String cronStr = "0 1 * * 0"; // Sundays @01:00 final CronTab cron = new CronTab(cronStr); @@ -269,7 +269,7 @@ public void isSundayAndPreviousRunIsPreviousSunday() throws Exception { final Calendar expected = Calendar.getInstance(); // Expected next: Sunday, Jan 9th 2011, 01:00 - expected.set(2011, 0, 9, 1, 0, 0); + expected.set(2011, Calendar.JANUARY, 9, 1, 0, 0); compare(expected, actual); } @@ -277,7 +277,7 @@ public void isSundayAndPreviousRunIsPreviousSunday() throws Exception { @Issue("JENKINS-12357") public void isSundayAndNextRunIsNextSunday7() throws Exception { final Calendar cal = Calendar.getInstance(locale); - cal.set(2011, 0, 16, 1, 0, 0); // Sunday, Jan 16th 2011, 01:00 + cal.set(2011, Calendar.JANUARY, 16, 1, 0, 0); // Sunday, Jan 16th 2011, 01:00 final String cronStr = "0 0 * * 7"; // Sundays(7 not 0) @00:00 final CronTab cron = new CronTab(cronStr); @@ -285,14 +285,14 @@ public void isSundayAndNextRunIsNextSunday7() throws Exception { final Calendar expected = Calendar.getInstance(); // Expected next: Sunday, Jan 22th 2011, 00:00 - expected.set(2011, 0, 23, 0, 0, 0); + expected.set(2011, Calendar.JANUARY, 23, 0, 0, 0); compare(expected, actual); } @Test public void isSundayAndPreviousRunIsPreviousSunday7() throws Exception { final Calendar cal = Calendar.getInstance(locale); - cal.set(2011, 0, 16, 0, 0, 0); // Sunday, Jan 16th 2011, 00:00 + cal.set(2011, Calendar.JANUARY, 16, 0, 0, 0); // Sunday, Jan 16th 2011, 00:00 final String cronStr = "0 1 * * 7"; // Sundays(7 not 0) @01:00 final CronTab cron = new CronTab(cronStr); @@ -300,14 +300,14 @@ public void isSundayAndPreviousRunIsPreviousSunday7() throws Exception { final Calendar expected = Calendar.getInstance(); // Expected next: Sunday, Jan 9th 2011, 01:00 - expected.set(2011, 0, 9, 1, 0, 0); + expected.set(2011, Calendar.JANUARY, 9, 1, 0, 0); compare(expected, actual); } @Test public void isSaturdayAndNextRunIsSundayAsterisk() throws Exception { final Calendar cal = Calendar.getInstance(locale); - cal.set(2011, 0, 15, 1, 0, 0); // Saturday, Jan 15th 2011, 01:00 + cal.set(2011, Calendar.JANUARY, 15, 1, 0, 0); // Saturday, Jan 15th 2011, 01:00 final String cronStr = "0 0 * * *"; // Everyday @00:00 final CronTab cron = new CronTab(cronStr); @@ -315,14 +315,14 @@ public void isSaturdayAndNextRunIsSundayAsterisk() throws Exception { final Calendar expected = Calendar.getInstance(); // Expected next: Sunday, Jan 16th 2011, 00:00 - expected.set(2011, 0, 16, 0, 0, 0); + expected.set(2011, Calendar.JANUARY, 16, 0, 0, 0); compare(expected, actual); } @Test public void isSundayAndPreviousRunIsSaturdayAsterisk() throws Exception { final Calendar cal = Calendar.getInstance(locale); - cal.set(2011, 0, 16, 0, 0, 0); // Sunday, Jan 16th 2011, 00:00 + cal.set(2011, Calendar.JANUARY, 16, 0, 0, 0); // Sunday, Jan 16th 2011, 00:00 final String cronStr = "0 23 * * *"; // Everyday @23:00 final CronTab cron = new CronTab(cronStr); @@ -330,7 +330,7 @@ public void isSundayAndPreviousRunIsSaturdayAsterisk() throws Exception { final Calendar expected = Calendar.getInstance(); // Expected next: Saturday, Jan 15th 2011, 23:00 - expected.set(2011, 0, 15, 23, 0, 0); + expected.set(2011, Calendar.JANUARY, 15, 23, 0, 0); compare(expected, actual); } diff --git a/core/src/test/java/hudson/scheduler/CronTabEventualityTest.java b/core/src/test/java/hudson/scheduler/CronTabEventualityTest.java index c59d679ea308..62cf37d7b624 100644 --- a/core/src/test/java/hudson/scheduler/CronTabEventualityTest.java +++ b/core/src/test/java/hudson/scheduler/CronTabEventualityTest.java @@ -43,7 +43,7 @@ public CronTabEventualityTest(String name, Hash hash) { @Test @Issue("JENKINS-12388") public void testYearlyWillBeEventuallyTriggeredWithinOneYear() throws ANTLRException { - Calendar start = new GregorianCalendar(2012, 0, 11, 22, 33); // Jan 11th 2012 22:33 + Calendar start = new GregorianCalendar(2012, Calendar.JANUARY, 11, 22, 33); // Jan 11th 2012 22:33 Calendar limit = createLimit(start, Calendar.YEAR, 1); checkEventuality(start, "@yearly", limit); } @@ -51,56 +51,56 @@ public void testYearlyWillBeEventuallyTriggeredWithinOneYear() throws ANTLRExcep @Test @Issue("JENKINS-12388") public void testAnnuallyWillBeEventuallyTriggeredWithinOneYear() throws ANTLRException { - Calendar start = new GregorianCalendar(2012, 0, 11, 22, 33); // Jan 11th 2012 22:33 + Calendar start = new GregorianCalendar(2012, Calendar.JANUARY, 11, 22, 33); // Jan 11th 2012 22:33 Calendar limit = createLimit(start, Calendar.YEAR, 1); checkEventuality(start, "@annually", limit); } @Test public void testMonthlyWillBeEventuallyTriggeredWithinOneMonth() throws ANTLRException { - Calendar start = new GregorianCalendar(2012, 0, 11, 22, 33); // Jan 11th 2012 22:33 + Calendar start = new GregorianCalendar(2012, Calendar.JANUARY, 11, 22, 33); // Jan 11th 2012 22:33 Calendar limit = createLimit(start, Calendar.MONTH, 1); checkEventuality(start, "@monthly", limit); } @Test public void testWeeklyWillBeEventuallyTriggeredWithinOneWeek() throws ANTLRException { - Calendar start = new GregorianCalendar(2012, 0, 11, 22, 33); // Jan 11th 2012 22:33 + Calendar start = new GregorianCalendar(2012, Calendar.JANUARY, 11, 22, 33); // Jan 11th 2012 22:33 Calendar limit = createLimit(start, Calendar.WEEK_OF_YEAR, 1); checkEventuality(start, "@weekly", limit); } @Test public void testDailyWillBeEventuallyTriggeredWithinOneDay() throws ANTLRException { - Calendar start = new GregorianCalendar(2012, 0, 11, 22, 33); // Jan 11th 2012 22:33 + Calendar start = new GregorianCalendar(2012, Calendar.JANUARY, 11, 22, 33); // Jan 11th 2012 22:33 Calendar limit = createLimit(start, Calendar.DAY_OF_MONTH, 1); checkEventuality(start, "@daily", limit); } @Test public void testMidnightWillBeEventuallyTriggeredWithinOneDay() throws ANTLRException { - Calendar start = new GregorianCalendar(2012, 0, 11, 22, 33); // Jan 11th 2012 22:33 + Calendar start = new GregorianCalendar(2012, Calendar.JANUARY, 11, 22, 33); // Jan 11th 2012 22:33 Calendar limit = createLimit(start, Calendar.DAY_OF_MONTH, 1); checkEventuality(start, "@midnight", limit); } @Test public void testHourlyWillBeEventuallyTriggeredWithinOneHour() throws ANTLRException { - Calendar start = new GregorianCalendar(2012, 0, 11, 22, 33); // Jan 11th 2012 22:33 + Calendar start = new GregorianCalendar(2012, Calendar.JANUARY, 11, 22, 33); // Jan 11th 2012 22:33 Calendar limit = createLimit(start, Calendar.HOUR, 1); checkEventuality(start, "@hourly", limit); } @Test public void testFirstDayOfMonthWillBeEventuallyTriggeredWithinOneMonth() throws ANTLRException { - Calendar start = new GregorianCalendar(2012, 0, 11, 22, 33); // Jan 11th 2012 22:33 + Calendar start = new GregorianCalendar(2012, Calendar.JANUARY, 11, 22, 33); // Jan 11th 2012 22:33 Calendar limit = createLimit(start, Calendar.MONTH, 1); checkEventuality(start, "H H 1 * *", limit); } @Test public void testFirstSundayOfMonthWillBeEventuallyTriggeredWithinOneMonthAndOneWeek() throws ANTLRException { - Calendar start = new GregorianCalendar(2012, 0, 11, 22, 33); // Jan 11th 2012 22:33 + Calendar start = new GregorianCalendar(2012, Calendar.JANUARY, 11, 22, 33); // Jan 11th 2012 22:33 Calendar limit = createLimit(start, Calendar.DAY_OF_MONTH, 31+7); // If both day of month and day of week are specified: // UNIX: triggered when either matches diff --git a/core/src/test/java/hudson/scheduler/CronTabTest.java b/core/src/test/java/hudson/scheduler/CronTabTest.java index e93c2511585c..94c6225846ea 100644 --- a/core/src/test/java/hudson/scheduler/CronTabTest.java +++ b/core/src/test/java/hudson/scheduler/CronTabTest.java @@ -56,29 +56,29 @@ public void test1() throws ANTLRException { @Test public void testCeil1() throws Exception { CronTab x = new CronTab("0,30 * * * *"); - Calendar c = new GregorianCalendar(2000,2,1,1,10); - compare(new GregorianCalendar(2000,2,1,1,30),x.ceil(c)); + Calendar c = new GregorianCalendar(2000, Calendar.MARCH,1,1,10); + compare(new GregorianCalendar(2000, Calendar.MARCH,1,1,30),x.ceil(c)); // roll up test - c = new GregorianCalendar(2000,2,1,1,40); - compare(new GregorianCalendar(2000,2,1,2, 0),x.ceil(c)); + c = new GregorianCalendar(2000, Calendar.MARCH,1,1,40); + compare(new GregorianCalendar(2000, Calendar.MARCH,1,2, 0),x.ceil(c)); } @Test public void testCeil2() throws Exception { // make sure that lower fields are really reset correctly CronTab x = new CronTab("15,45 3 * * *"); - Calendar c = new GregorianCalendar(2000,2,1,2,30); - compare(new GregorianCalendar(2000,2,1,3,15),x.ceil(c)); + Calendar c = new GregorianCalendar(2000, Calendar.MARCH,1,2,30); + compare(new GregorianCalendar(2000, Calendar.MARCH,1,3,15),x.ceil(c)); } @Test public void testCeil3() throws Exception { // conflict between DoM and DoW. In this we need to find a day that's the first day of a month and Sunday CronTab x = new CronTab("0 0 1 * 0"); - Calendar c = new GregorianCalendar(2010,0,1,15,55); + Calendar c = new GregorianCalendar(2010, Calendar.JANUARY,1,15,55); // the first such day in 2010 is Aug 1st - compare(new GregorianCalendar(2010,7,1,0,0),x.ceil(c)); + compare(new GregorianCalendar(2010, Calendar.AUGUST,1,0,0),x.ceil(c)); } @Test(timeout = 1000) @@ -86,9 +86,9 @@ public void testCeil3() throws Exception { public void testCeil3_DoW7() throws Exception { // similar to testCeil3, but DoW=7 may stuck in an infinite loop CronTab x = new CronTab("0 0 1 * 7"); - Calendar c = new GregorianCalendar(2010,0,1,15,55); + Calendar c = new GregorianCalendar(2010, Calendar.JANUARY,1,15,55); // the first such day in 2010 is Aug 1st - compare(new GregorianCalendar(2010, 7, 1, 0, 0), x.ceil(c)); + compare(new GregorianCalendar(2010, Calendar.AUGUST, 1, 0, 0), x.ceil(c)); } /** @@ -98,14 +98,14 @@ public void testCeil3_DoW7() throws Exception { @Test public void testCeil4() throws ANTLRException { final Calendar cal = Calendar.getInstance(new Locale("de", "de")); - cal.set(2011, 0, 16, 0, 0, 0); // Sunday, Jan 16th 2011, 00:00 + cal.set(2011, Calendar.JANUARY, 16, 0, 0, 0); // Sunday, Jan 16th 2011, 00:00 final String cronStr = "0 23 * * 1-5"; // execute on weekdays @23:00 final CronTab cron = new CronTab(cronStr); final Calendar next = cron.ceil(cal); final Calendar expectedDate = Calendar.getInstance(); - expectedDate.set(2011, 0, 17, 23, 0, 0); // Expected next: Monday, Jan 17th 2011, 23:00 + expectedDate.set(2011, Calendar.JANUARY, 17, 23, 0, 0); // Expected next: Monday, Jan 17th 2011, 23:00 assertEquals(expectedDate.get(Calendar.HOUR), next.get(Calendar.HOUR)); assertEquals(expectedDate.get(Calendar.MINUTE), next.get(Calendar.MINUTE)); assertEquals(expectedDate.get(Calendar.YEAR), next.get(Calendar.YEAR)); @@ -120,14 +120,14 @@ public void testCeil4() throws ANTLRException { @Test public void testCeil5() throws ANTLRException { final Calendar cal = Calendar.getInstance(new Locale("de", "at")); - cal.set(2011, 0, 16, 0, 0, 0); // Sunday, Jan 16th 2011, 00:00 + cal.set(2011, Calendar.JANUARY, 16, 0, 0, 0); // Sunday, Jan 16th 2011, 00:00 final String cronStr = "0 23 * * 1-5"; // execute on weekdays @23:00 final CronTab cron = new CronTab(cronStr); final Calendar next = cron.ceil(cal); final Calendar expectedDate = Calendar.getInstance(); - expectedDate.set(2011, 0, 17, 23, 0, 0); // Expected next: Monday, Jan 17th 2011, 23:00 + expectedDate.set(2011, Calendar.JANUARY, 17, 23, 0, 0); // Expected next: Monday, Jan 17th 2011, 23:00 assertEquals(expectedDate.get(Calendar.HOUR), next.get(Calendar.HOUR)); assertEquals(expectedDate.get(Calendar.MINUTE), next.get(Calendar.MINUTE)); assertEquals(expectedDate.get(Calendar.YEAR), next.get(Calendar.YEAR)); @@ -138,29 +138,29 @@ public void testCeil5() throws ANTLRException { @Test public void testFloor1() throws Exception { CronTab x = new CronTab("30 * * * *"); - Calendar c = new GregorianCalendar(2000,2,1,1,40); - compare(new GregorianCalendar(2000,2,1,1,30),x.floor(c)); + Calendar c = new GregorianCalendar(2000, Calendar.MARCH,1,1,40); + compare(new GregorianCalendar(2000, Calendar.MARCH,1,1,30),x.floor(c)); // roll down test - c = new GregorianCalendar(2000,2,1,1,10); - compare(new GregorianCalendar(2000,2,1,0,30),x.floor(c)); + c = new GregorianCalendar(2000, Calendar.MARCH,1,1,10); + compare(new GregorianCalendar(2000, Calendar.MARCH,1,0,30),x.floor(c)); } @Test public void testFloor2() throws Exception { // make sure that lower fields are really reset correctly CronTab x = new CronTab("15,45 3 * * *"); - Calendar c = new GregorianCalendar(2000,2,1,4,30); - compare(new GregorianCalendar(2000,2,1,3,45),x.floor(c)); + Calendar c = new GregorianCalendar(2000, Calendar.MARCH,1,4,30); + compare(new GregorianCalendar(2000, Calendar.MARCH,1,3,45),x.floor(c)); } @Test public void testFloor3() throws Exception { // conflict between DoM and DoW. In this we need to find a day that's the first day of a month and Sunday in 2010 CronTab x = new CronTab("0 0 1 * 0"); - Calendar c = new GregorianCalendar(2011,0,1,15,55); + Calendar c = new GregorianCalendar(2011, Calendar.JANUARY,1,15,55); // the last such day in 2010 is Aug 1st - compare(new GregorianCalendar(2010,7,1,0,0),x.floor(c)); + compare(new GregorianCalendar(2010, Calendar.AUGUST,1,0,0),x.floor(c)); } @Issue("JENKINS-8401") @@ -168,10 +168,10 @@ public void testFloor3() throws Exception { public void testFloor4() throws Exception { // conflict between DoM and DoW. In this we need to find a day that's the first day of a month and Sunday in 2010 CronTab x = new CronTab("0 0 1 * 0"); - Calendar c = new GregorianCalendar(2011,0,1,15,55); + Calendar c = new GregorianCalendar(2011, Calendar.JANUARY,1,15,55); c.setFirstDayOfWeek(MONDAY); // the last such day in 2010 is Aug 1st - GregorianCalendar answer = new GregorianCalendar(2010, 7, 1, 0, 0); + GregorianCalendar answer = new GregorianCalendar(2010, Calendar.AUGUST, 1, 0, 0); answer.setFirstDayOfWeek(MONDAY); compare(answer,x.floor(c)); } @@ -248,31 +248,31 @@ public int next(int n) { } @Test public void hashedMinute() throws Exception { - long t = new GregorianCalendar(2013, 2, 21, 16, 21).getTimeInMillis(); - compare(new GregorianCalendar(2013, 2, 21, 17, 56), new CronTab("H 17 * * *", Hash.from("stuff")).ceil(t)); - compare(new GregorianCalendar(2013, 2, 21, 16, 56), new CronTab("H * * * *", Hash.from("stuff")).ceil(t)); - compare(new GregorianCalendar(2013, 2, 21, 16, 56), new CronTab("@hourly", Hash.from("stuff")).ceil(t)); - compare(new GregorianCalendar(2013, 2, 21, 17, 20), new CronTab("@hourly", Hash.from("junk")).ceil(t)); - compare(new GregorianCalendar(2013, 2, 22, 13, 56), new CronTab("H H(12-13) * * *", Hash.from("stuff")).ceil(t)); + long t = new GregorianCalendar(2013, Calendar.MARCH, 21, 16, 21).getTimeInMillis(); + compare(new GregorianCalendar(2013, Calendar.MARCH, 21, 17, 56), new CronTab("H 17 * * *", Hash.from("stuff")).ceil(t)); + compare(new GregorianCalendar(2013, Calendar.MARCH, 21, 16, 56), new CronTab("H * * * *", Hash.from("stuff")).ceil(t)); + compare(new GregorianCalendar(2013, Calendar.MARCH, 21, 16, 56), new CronTab("@hourly", Hash.from("stuff")).ceil(t)); + compare(new GregorianCalendar(2013, Calendar.MARCH, 21, 17, 20), new CronTab("@hourly", Hash.from("junk")).ceil(t)); + compare(new GregorianCalendar(2013, Calendar.MARCH, 22, 13, 56), new CronTab("H H(12-13) * * *", Hash.from("stuff")).ceil(t)); } @Test public void hashSkips() throws Exception { - compare(new GregorianCalendar(2013, 2, 21, 16, 26), new CronTab("H/15 * * * *", Hash.from("stuff")).ceil(new GregorianCalendar(2013, 2, 21, 16, 21))); - compare(new GregorianCalendar(2013, 2, 21, 16, 41), new CronTab("H/15 * * * *", Hash.from("stuff")).ceil(new GregorianCalendar(2013, 2, 21, 16, 31))); - compare(new GregorianCalendar(2013, 2, 21, 16, 56), new CronTab("H/15 * * * *", Hash.from("stuff")).ceil(new GregorianCalendar(2013, 2, 21, 16, 42))); - compare(new GregorianCalendar(2013, 2, 21, 17, 11), new CronTab("H/15 * * * *", Hash.from("stuff")).ceil(new GregorianCalendar(2013, 2, 21, 16, 59))); - compare(new GregorianCalendar(2013, 2, 21, 0, 2), new CronTab("H(0-15)/3 * * * *", Hash.from("junk")).ceil(new GregorianCalendar(2013, 2, 21, 0, 0))); - compare(new GregorianCalendar(2013, 2, 21, 0, 2), new CronTab("H(0-3)/4 * * * *", Hash.from("junk")).ceil(new GregorianCalendar(2013, 2, 21, 0, 0))); - compare(new GregorianCalendar(2013, 2, 21, 1, 2), new CronTab("H(0-3)/4 * * * *", Hash.from("junk")).ceil(new GregorianCalendar(2013, 2, 21, 0, 5))); - - assertThrows(ANTLRException.class, () -> compare(new GregorianCalendar(2013, 2, 21, 0, 0), new CronTab("H(0-3)/15 * * * *", Hash.from("junk")).ceil(new GregorianCalendar(2013, 2, 21, 0, 0)))); + compare(new GregorianCalendar(2013, Calendar.MARCH, 21, 16, 26), new CronTab("H/15 * * * *", Hash.from("stuff")).ceil(new GregorianCalendar(2013, Calendar.MARCH, 21, 16, 21))); + compare(new GregorianCalendar(2013, Calendar.MARCH, 21, 16, 41), new CronTab("H/15 * * * *", Hash.from("stuff")).ceil(new GregorianCalendar(2013, Calendar.MARCH, 21, 16, 31))); + compare(new GregorianCalendar(2013, Calendar.MARCH, 21, 16, 56), new CronTab("H/15 * * * *", Hash.from("stuff")).ceil(new GregorianCalendar(2013, Calendar.MARCH, 21, 16, 42))); + compare(new GregorianCalendar(2013, Calendar.MARCH, 21, 17, 11), new CronTab("H/15 * * * *", Hash.from("stuff")).ceil(new GregorianCalendar(2013, Calendar.MARCH, 21, 16, 59))); + compare(new GregorianCalendar(2013, Calendar.MARCH, 21, 0, 2), new CronTab("H(0-15)/3 * * * *", Hash.from("junk")).ceil(new GregorianCalendar(2013, Calendar.MARCH, 21, 0, 0))); + compare(new GregorianCalendar(2013, Calendar.MARCH, 21, 0, 2), new CronTab("H(0-3)/4 * * * *", Hash.from("junk")).ceil(new GregorianCalendar(2013, Calendar.MARCH, 21, 0, 0))); + compare(new GregorianCalendar(2013, Calendar.MARCH, 21, 1, 2), new CronTab("H(0-3)/4 * * * *", Hash.from("junk")).ceil(new GregorianCalendar(2013, Calendar.MARCH, 21, 0, 5))); + + assertThrows(ANTLRException.class, () -> compare(new GregorianCalendar(2013, Calendar.MARCH, 21, 0, 0), new CronTab("H(0-3)/15 * * * *", Hash.from("junk")).ceil(new GregorianCalendar(2013, Calendar.MARCH, 21, 0, 0)))); } @Test public void repeatedHash() throws Exception { CronTabList tabs = CronTabList.create("H * * * *\nH * * * *", Hash.from("seed")); List times = new ArrayList<>(); for (int i = 0; i < 60; i++) { - if (tabs.check(new GregorianCalendar(2013, 3, 3, 11, i, 0))) { + if (tabs.check(new GregorianCalendar(2013, Calendar.APRIL, 3, 11, i, 0))) { times.add(i); } } From 1d24493702a1b66c2a7a9bc93d7097ed277132cf Mon Sep 17 00:00:00 2001 From: aman <53443872+aman-raza@users.noreply.github.com> Date: Thu, 14 Oct 2021 02:11:16 +0530 Subject: [PATCH 36/66] Update MAINTAINERS.adoc --- docs/MAINTAINERS.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/MAINTAINERS.adoc b/docs/MAINTAINERS.adoc index b05ea4502535..3218936cc6b6 100644 --- a/docs/MAINTAINERS.adoc +++ b/docs/MAINTAINERS.adoc @@ -55,7 +55,7 @@ GitHub team: link:https://github.com/orgs/jenkinsci/teams/core-pr-reviewers[@jen **Core Maintainers** get `Write` permissions in the repository, and hence they are able to merge pull requests. Their responsibility is to perform pull request reviews on a regular basis and to merge ready pull requests towards the weekly releases (`master` branch). -They are also responsible to monitor the weekly release status and performing triage of critical issues. +They are also responsible to monitor the weekly release status and to perform triage of critical issues. GitHub team: link:https://github.com/orgs/jenkinsci/teams/core[@jenkinsci/core]. **Release Team Members** are responsible for Jenkins weekly and LTS releases. From f23512f2bc97d18cd4f0183a7db4a62bc6b84196 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Oct 2021 08:21:39 +0100 Subject: [PATCH 37/66] Bump spotless-maven-plugin from 2.17.0 to 2.17.1 (#5815) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 601421eb50c3..eb053ea631eb 100644 --- a/pom.xml +++ b/pom.xml @@ -101,7 +101,7 @@ THE SOFTWARE. 1.25 5.8.1 - 2.17.0 + 2.17.1
From 61928baad7fa926b70d291d1c13ba068ea0ad146 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Oct 2021 11:47:13 +0100 Subject: [PATCH 39/66] Bump spotless-maven-plugin from 2.17.1 to 2.17.2 (#5817) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index eb053ea631eb..b43503deb953 100644 --- a/pom.xml +++ b/pom.xml @@ -101,7 +101,7 @@ THE SOFTWARE. 1.25 5.8.1 - 2.17.1 + 2.17.2 - 4.10 + 4.11 3.14 From 1aeef64dfdb798c7c40029f89774d06bce1d4e99 Mon Sep 17 00:00:00 2001 From: Stefan Spieker Date: Sat, 16 Oct 2021 18:05:36 +0200 Subject: [PATCH 41/66] Replaced deprecated methods with suggested replacements (#5810) --- core/src/main/java/hudson/util/jna/Advapi32.java | 2 +- core/src/main/java/hudson/util/jna/GNUCLibrary.java | 2 +- core/src/main/java/hudson/util/jna/Kernel32Utils.java | 2 +- core/src/main/java/hudson/util/jna/Shell32.java | 2 +- core/src/main/java/jenkins/model/BuildDiscarder.java | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/hudson/util/jna/Advapi32.java b/core/src/main/java/hudson/util/jna/Advapi32.java index 6b4f303b929d..3f5c70acb97c 100644 --- a/core/src/main/java/hudson/util/jna/Advapi32.java +++ b/core/src/main/java/hudson/util/jna/Advapi32.java @@ -33,7 +33,7 @@ */ @SuppressWarnings("UnusedReturnValue") public interface Advapi32 extends StdCallLibrary { - Advapi32 INSTANCE = (Advapi32) Native.loadLibrary("Advapi32", Advapi32.class, Options.UNICODE_OPTIONS); + Advapi32 INSTANCE = (Advapi32) Native.load("Advapi32", Advapi32.class, Options.UNICODE_OPTIONS); /** * Retrieves the name of the user associated with the current thread. diff --git a/core/src/main/java/hudson/util/jna/GNUCLibrary.java b/core/src/main/java/hudson/util/jna/GNUCLibrary.java index e06e3b342276..ef0bc7a13906 100644 --- a/core/src/main/java/hudson/util/jna/GNUCLibrary.java +++ b/core/src/main/java/hudson/util/jna/GNUCLibrary.java @@ -124,5 +124,5 @@ public interface GNUCLibrary extends Library { */ int readlink(String filename, Memory buffer, NativeLong size); - GNUCLibrary LIBC = Native.loadLibrary("c",GNUCLibrary.class); + GNUCLibrary LIBC = Native.load("c",GNUCLibrary.class); } diff --git a/core/src/main/java/hudson/util/jna/Kernel32Utils.java b/core/src/main/java/hudson/util/jna/Kernel32Utils.java index e2a9003efef5..0f91df85ff8a 100644 --- a/core/src/main/java/hudson/util/jna/Kernel32Utils.java +++ b/core/src/main/java/hudson/util/jna/Kernel32Utils.java @@ -122,7 +122,7 @@ public static File getTempDir() { /*package*/ static Kernel32 load() { try { - return (Kernel32) Native.loadLibrary("kernel32", Kernel32.class); + return (Kernel32) Native.load("kernel32", Kernel32.class); } catch (Throwable e) { LOGGER.log(Level.SEVERE, "Failed to load Kernel32", e); return InitializationErrorInvocationHandler.create(Kernel32.class,e); diff --git a/core/src/main/java/hudson/util/jna/Shell32.java b/core/src/main/java/hudson/util/jna/Shell32.java index c330d430fad7..8165a4f099ee 100644 --- a/core/src/main/java/hudson/util/jna/Shell32.java +++ b/core/src/main/java/hudson/util/jna/Shell32.java @@ -30,7 +30,7 @@ * @author Kohsuke Kawaguchi */ public interface Shell32 extends StdCallLibrary { - Shell32 INSTANCE = (Shell32) Native.loadLibrary("shell32", Shell32.class); + Shell32 INSTANCE = (Shell32) Native.load("shell32", Shell32.class); /** * @return true if successful. Otherwise false. diff --git a/core/src/main/java/jenkins/model/BuildDiscarder.java b/core/src/main/java/jenkins/model/BuildDiscarder.java index 1aac4304e6dd..8687aee6f8ba 100644 --- a/core/src/main/java/jenkins/model/BuildDiscarder.java +++ b/core/src/main/java/jenkins/model/BuildDiscarder.java @@ -55,7 +55,7 @@ public static class ConverterImpl implements Converter { private RobustReflectionConverter ref; public ConverterImpl(Mapper m) { - ref = new RobustReflectionConverter(m,new JVM().bestReflectionProvider()) { + ref = new RobustReflectionConverter(m, JVM.newReflectionProvider()) { @Override protected Object instantiateNewInstance(HierarchicalStreamReader reader, UnmarshallingContext context) { return reflectionProvider.newInstance(LogRotator.class); From 98f420baa3011aa34120e114a9abe10f14e8650e Mon Sep 17 00:00:00 2001 From: tatoberres <71732086+tatoberres@users.noreply.github.com> Date: Sat, 16 Oct 2021 18:05:49 +0200 Subject: [PATCH 42/66] Spanish translation for monitor warnings - Hacktoberfest (#5797) Co-authored-by: A. Jard Co-authored-by: Wadeck Follonier Co-authored-by: Antonio Muniz --- .../message_es.properties | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 core/src/main/resources/jenkins/security/UpdateSiteWarningsMonitor/message_es.properties diff --git a/core/src/main/resources/jenkins/security/UpdateSiteWarningsMonitor/message_es.properties b/core/src/main/resources/jenkins/security/UpdateSiteWarningsMonitor/message_es.properties new file mode 100644 index 000000000000..f3f0a2c63c63 --- /dev/null +++ b/core/src/main/resources/jenkins/security/UpdateSiteWarningsMonitor/message_es.properties @@ -0,0 +1,31 @@ +# The MIT License +# +# Copyright (c) 2021, Jenkins project contributors +# +# 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. + +pluginTitle = {0} {1} +coreTitle = Jenkins {0} programa y librerías + +blurb = Advertencias publicadas para los siguientes componentes instalados: +more = Advertencias adicionales ocultas debido a la configuración de seguridad actual + + +pluginManager.link = Ir al gestor de plugins +configureSecurity.link = Configurar las advertencias mostradas From 96c07780902f91b6e274dc41bb9bffffdad4709f Mon Sep 17 00:00:00 2001 From: tatoberres <71732086+tatoberres@users.noreply.github.com> Date: Sat, 16 Oct 2021 18:05:59 +0200 Subject: [PATCH 43/66] French translation for monitor warnings - Hacktoberfest (#5796) Co-authored-by: A. Jard Co-authored-by: Raihaan Shouhell Co-authored-by: Wadeck Follonier Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com> --- .../message_fr.properties | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 core/src/main/resources/jenkins/security/UpdateSiteWarningsMonitor/message_fr.properties diff --git a/core/src/main/resources/jenkins/security/UpdateSiteWarningsMonitor/message_fr.properties b/core/src/main/resources/jenkins/security/UpdateSiteWarningsMonitor/message_fr.properties new file mode 100644 index 000000000000..461674462b7e --- /dev/null +++ b/core/src/main/resources/jenkins/security/UpdateSiteWarningsMonitor/message_fr.properties @@ -0,0 +1,31 @@ +# The MIT License +# +# Copyright (c) 2021, Jenkins project contributors +# +# 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. + +pluginTitle = {0} {1} +coreTitle = Jenkins {0} logiciel et librairies + +blurb = Des avertissements ont été publiés pour ces composants installés : +more = D'autres avertissements sont cachés en raison de la configuration actuelle de sécurité. + + +pluginManager.link = Aller à la gestion des plugins +configureSecurity.link = Configurer les avertissements affichés From 7067bf5d4b1ce4a8a5eb9e08ccdb213afca5bdbb Mon Sep 17 00:00:00 2001 From: Nate Tranel Date: Sat, 16 Oct 2021 10:06:06 -0600 Subject: [PATCH 44/66] Hacktoberfest update messages.properties translation for Spanish (#5782) Co-authored-by: Nate Tranel --- .../resources/hudson/Messages_es.properties | 96 ++++++++++++++++--- 1 file changed, 84 insertions(+), 12 deletions(-) diff --git a/core/src/main/resources/hudson/Messages_es.properties b/core/src/main/resources/hudson/Messages_es.properties index 58ffaf90e11d..6263baa07d1c 100644 --- a/core/src/main/resources/hudson/Messages_es.properties +++ b/core/src/main/resources/hudson/Messages_es.properties @@ -1,17 +1,17 @@ # The MIT License -# +# # Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, id:cactusman -# +# # 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 @@ -20,6 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. +FilePath.did_not_manage_to_validate_may_be_too_sl=No se puede validar {0} (puede ser demasiado lento) FilePath.validateAntFileMask.whitespaceSeprator=\ No se pueden utilizar espacios en blanco como separadores. Utiliza coma '','' FilePath.validateAntFileMask.doesntMatchAndSuggest=\ @@ -27,6 +28,8 @@ FilePath.validateAntFileMask.doesntMatchAndSuggest=\ FilePath.validateAntFileMask.portionMatchAndSuggest=''{0}'' no coincide con nada aunque ''{1}'' s\u00ED existe FilePath.validateAntFileMask.portionMatchButPreviousNotMatchAndSuggest=''{0}'' no coincide con nada: ''{1}'' existe, pero ''{2}'' no existe FilePath.validateAntFileMask.doesntMatchAnything=''{0}'' no coincide con nada +FilePath.validateAntFileMask.matchWithCaseInsensitive=\ + ''{0}'' no coincide porque tiene en cuenta la capitalización. Puede desactivar la distinción entre mayúsculas y minúsculas para obtener coincidencias FilePath.validateAntFileMask.doesntMatchAnythingAndSuggest=''{0}'' no coincide con nada: ''{1}'' no existe FilePath.validateRelativePath.wildcardNotAllowed=No se permiten caracteres comod\u00EDn. @@ -35,6 +38,8 @@ FilePath.validateRelativePath.notDirectory=''{0}'' no es un directorio FilePath.validateRelativePath.noSuchFile=El fichero no existe ''{0}'' FilePath.validateRelativePath.noSuchDirectory=El directorio no existe ''{0}'' +PluginManager.PluginDoesntSupportDynamicLoad.RestartRequired=El plugin {0} no soporta la carga din\u00E1mica, por lo que es necesario reiniciar Jenkins para que los cambios tengan efecto +PluginManager.PluginIsAlreadyInstalled.RestartRequired=El plugin {0} ya ha sido instalado. Es necesario reiniciar Jenkins para que los cambios tengan efecto. Util.millisecond={0} Ms Util.second={0} Seg Util.minute={0} Min @@ -47,18 +52,85 @@ Util.year ={0} A\u00F1o # another implication of this is that where we use this, # we often want to add "ago" there FilePath.TildaDoesntWork=El caracter ''~'' s\u00F3lo est\u00E1 soportado en UNIX. + PluginManager.DisplayName=Gestor de plugins -AboutJenkins.DisplayName=Acerca de Jenkins -PluginManager.PluginIsAlreadyInstalled.RestartRequired=El plugin {0} ya ha sido instalado. Es necesario reiniciar Jenkins para que los cambios tengan efecto. -PluginManager.PluginDoesntSupportDynamicLoad.RestartRequired=El plugin {0} no soporta la carga din\u00E1mica, por lo que es necesario reiniciar Jenkins para que los cambios tengan efecto PluginManager.PortNotANumber=El puerto no es un n\u00FAmero -AboutJenkins.Description=Eche un vistazo a la informaci\u00F3n sobre la versi\u00F3n y la licencia. PluginManager.PortNotInRange=El puerto no est\u00E1 en el rango de {0} hasta {1} -PluginWrapper.Already.Disabled=El plugin {0} ya estaba deshabilitado -PluginWrapper.Plugin.Has.Dependant=El plugin {0} tiene, al menos, un plugin dependiente ({1}) y la estrategia de deshabilitaci\u00F3n es {2}, as\u00ED que no puede ser deshabilitado -PluginWrapper.Plugin.Disabled=Plugin {0} deshabilitado -PluginWrapper.NoSuchPlugin=No se encuentra un plugin con el nombre {0} +PluginManager.UploadPluginsPermission.Description=Obsoleto - Utiliza el permiso Overall/Administer en su lugar +PluginManager.ConfigureUpdateCenterPermission.Description=Obsoleto - Utiliza el permiso Overall/Administer en su lugar +PluginManager.PluginCycleDependenciesMonitor.DisplayName=Detector de dependencias cíclicas +PluginManager.PluginUpdateMonitor.DisplayName=Configuración de los plugins no válida +PluginManager.PluginDeprecationMonitor.DisplayName=Monitor de plugins obsoletos PluginManager.CheckUpdateServerError=Hubo errores comprobando los servidores de actualizaciones: {0} PluginManager.UpdateSiteError=Error comprobando los servidores de actualizaciones en {0} intento(s). La \u00FAltima excepci\u00F3n fue: {1} PluginManager.UpdateSiteChangeLogLevel=Cambie el nivel de log a WARNING o menos para ver el mensaje de error de cada intento PluginManager.UnexpectedException=Excepci\u00F3n no esperada en el proceso de reintentos chequeando los servidores de actualizaciones + +PluginManager.compatWarning=\ + Aviso: La nueva versión de este plugin está marcada como incompatible con la versión instalada. \ + Esto puede ocurrir porque su comportamiento ha cambiado o utiliza un formato de configuración diferente que la versión instalada. \ + Los trabajos que utilizan ese plugin pueden necesitar ser reconfigurados, y es posible que no pueda revertirse sin errores a la versión anterior sin restaurar manualmente la configuración anterior. \ + Consulte las notas de la versión del plugin para más detalles. +PluginManager.parentDepCompatWarning=Los siguientes plugins son incompatibles: +PluginManager.parentCompatWarning=Esto afecta a los siguientes plugins: +PluginManager.coreWarning=\ + Aviso: Este plugin está construido para Jenkins {0} o posterior. \ + Jenkins no cargará este plugin aunque está instalado. +PluginManager.javaWarning=\ + Aviso: Este plugin requiere Java {0} o más reciente. \ + Jenkins no cargará este plugin aunque está instalado. +PluginManager.depCompatWarning=\ + Aviso: Este plugin requiere versiones más recientes de dependencias y al menos uno de esos plugins no es compatible con la versión instalada. \ + Esto puede ocurrir porque su comportamiento ha cambiado o utiliza un formato de configuración diferente que la versión instalada. \ + Los trabajos que utilizan ese plugin pueden necesitar ser reconfigurados, y es posible que no pueda revertirse sin errores a la versión anterior sin restaurar manualmente la configuración anterior. \ + Consulte las notas de la versión del plugin para más detalles. +PluginManager.depCoreWarning=\ + Aviso: Este plugin tiene dependencias de otros plugins que requieren Jenkins {0} o más reciente. \ + Jenkins no se cargará las dependencias que requieren una versión más reciente de Jenkins. \ + Por lo que no poderá cargar este plugin. +PluginManager.depJavaWarning=\ + Aviso: Este plugin tiene dependencias de otros plugins que requieren Java {0} o más reciente. \ + Jenkins no se cargará las dependencias que requieren una versión más reciente de Jenkins. \ + Por lo que no poderá cargar este plugin. +PluginManager.securityWarning=\ + Aviso: Esta versión del plugin puede no ser segura. Por favor, revise los siguientes avisos de seguridad: +PluginManager.ago=Hace {0} +PluginManager.adoptThisPlugin=\ + ¡Este plugin está en adopción! Buscamos nuevos mantenedores. \ + Visita nuestro sitio de la iniciativa Adopte un plugin para obtener más información. +PluginManager.newerVersionExists=\ + Existe una versión más nueva que la que se ofrece para la instalación (versión {0}). \ + Este es el típico caso en el que no se satisfacen los requisitos del plugin, por ejemplo, una versión más reciente de Jenkins es necesaria. +PluginManager.newerVersionEntry=\ + Esta versión del plugin existe pero no se ofrece como actualización. \ + Este es el típico caso en el que no se satisfacen los requisitos del plugin, por ejemplo, una versión más reciente de Jenkins es necesaria. \ + Consulte la documentación del plugin para obtener información sobre sus requisitos. +PluginManager.unavailable=No disponible +PluginManager.deprecationWarning=Este plugin está obsoleto. En general, esto significa que ya no se desarrolla o que puede dejar de funcionar. Más información + +AboutJenkins.DisplayName=Acerca de Jenkins +AboutJenkins.Description=Eche un vistazo a la informaci\u00F3n sobre la versi\u00F3n y la licencia. + +ProxyConfiguration.TestUrlRequired=Se requiere un URL de prueba. +ProxyConfiguration.MalformedTestUrl=La URL de prueba está mal formada. +ProxyConfiguration.FailedToConnectViaProxy=No se puede conectar a {0}. +ProxyConfiguration.FailedToConnect=No se puede conectar a {0} (código {1}). +ProxyConfiguration.Success=Configurado + +Functions.NoExceptionDetails=No hay detalles de la excepción + +PluginWrapper.missing=Falta el plugin: {0} ({1}) +PluginWrapper.failed_to_load_plugin=No se puede cargar: {0} ({1}) +PluginWrapper.failed_to_load_dependency=No se puede cargar: {0} ({1}) +PluginWrapper.disabledAndObsolete=Acutalización requerida: {0} ({1}) a {2} o superior +PluginWrapper.disabled=El plugin requerido está desactivado: {0} +PluginWrapper.obsolete=Acutalización requerida: {0} ({1}) va a actualizar a {2} o superior +PluginWrapper.obsoleteCore=Se requiere Jenkins ({1}) o superior +PluginWrapper.obsoleteJava=Se requiere Java ({1}) o superior +PluginWrapper.PluginWrapperAdministrativeMonitor.DisplayName=No se pueden cargar los plugins +PluginWrapper.Already.Disabled=El plugin {0} ya estaba deshabilitado +PluginWrapper.Plugin.Has.Dependant=El plugin {0} tiene, al menos, un plugin dependiente ({1}) y la estrategia de deshabilitaci\u00F3n es {2}, as\u00ED que no puede ser deshabilitado +PluginWrapper.Plugin.Disabled=Plugin {0} deshabilitado +PluginWrapper.NoSuchPlugin=No se encuentra un plugin con el nombre {0} +PluginWrapper.Error.Disabling=Hubo un error al desactivar el plugin ''{0}''. Error: ''{1}'' +TcpSlaveAgentListener.PingAgentProtocol.displayName=Protocolo ping From b94d9d000a9cbf4975cb3a6561dbf942d31e678b Mon Sep 17 00:00:00 2001 From: Wadeck Follonier Date: Sat, 16 Oct 2021 18:06:13 +0200 Subject: [PATCH 45/66] Copyright was wrong during security release (#5813) --- core/src/test/java/jenkins/model/Security2424Test.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/test/java/jenkins/model/Security2424Test.java b/core/src/test/java/jenkins/model/Security2424Test.java index 891f627eed85..a86c46917848 100644 --- a/core/src/test/java/jenkins/model/Security2424Test.java +++ b/core/src/test/java/jenkins/model/Security2424Test.java @@ -1,7 +1,7 @@ /* * The MIT License * - * Copyright (c) 2014 + * Copyright (c) 2021, 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 From c4b86fd695a28416b0a2957f447a4123ac28ef55 Mon Sep 17 00:00:00 2001 From: Wadeck Follonier Date: Sat, 16 Oct 2021 18:06:20 +0200 Subject: [PATCH 46/66] Adjust the Id to ID change that "broke" i18n (#5814) --- .../hudson/model/View/AsynchPeople/index_bg.properties | 2 +- .../hudson/model/View/AsynchPeople/index_ca.properties | 2 +- .../hudson/model/View/AsynchPeople/index_cs.properties | 2 +- .../hudson/model/View/AsynchPeople/index_da.properties | 2 +- .../hudson/model/View/AsynchPeople/index_de.properties | 2 +- .../hudson/model/View/AsynchPeople/index_el.properties | 2 +- .../hudson/model/View/AsynchPeople/index_es.properties | 2 +- .../hudson/model/View/AsynchPeople/index_es_AR.properties | 2 +- .../hudson/model/View/AsynchPeople/index_fi.properties | 2 +- .../hudson/model/View/AsynchPeople/index_hu.properties | 2 +- .../hudson/model/View/AsynchPeople/index_ja.properties | 2 +- .../hudson/model/View/AsynchPeople/index_ko.properties | 1 - .../hudson/model/View/AsynchPeople/index_lt.properties | 2 +- .../hudson/model/View/AsynchPeople/index_lv.properties | 2 +- .../hudson/model/View/AsynchPeople/index_nb_NO.properties | 2 +- .../hudson/model/View/AsynchPeople/index_nl.properties | 2 +- .../hudson/model/View/AsynchPeople/index_pt_BR.properties | 2 +- .../hudson/model/View/AsynchPeople/index_pt_PT.properties | 2 +- .../hudson/model/View/AsynchPeople/index_ro.properties | 2 +- .../hudson/model/View/AsynchPeople/index_sr.properties | 3 +-- .../hudson/model/View/AsynchPeople/index_sv_SE.properties | 2 +- .../hudson/model/View/AsynchPeople/index_tr.properties | 2 +- .../hudson/model/View/AsynchPeople/index_uk.properties | 2 +- .../hudson/model/View/AsynchPeople/index_zh_TW.properties | 2 +- 24 files changed, 23 insertions(+), 25 deletions(-) diff --git a/core/src/main/resources/hudson/model/View/AsynchPeople/index_bg.properties b/core/src/main/resources/hudson/model/View/AsynchPeople/index_bg.properties index 8f97078287e8..37cf81ebfe97 100644 --- a/core/src/main/resources/hudson/model/View/AsynchPeople/index_bg.properties +++ b/core/src/main/resources/hudson/model/View/AsynchPeople/index_bg.properties @@ -28,7 +28,7 @@ People=\ \u041f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0438 All\ People=\ \u0412\u0441\u0438\u0447\u043a\u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0438 -User\ Id=\ +User\ ID=\ \u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043d\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b blurb=\ \u0412\u043a\u043b\u044e\u0447\u0432\u0430 \u0432\u0441\u0438\u0447\u043a\u0438 \u043f\u043e\u0437\u043d\u0430\u0442\u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0438, \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u043d\u043e \u0442\u0435\u0437\u0438, \u043a\u043e\u0438\u0442\u043e \u0442\u0435\u043a\u0443\u0449\u0430\u0442\u0430 \u043e\u0431\u043b\u0430\u0441\u0442\ diff --git a/core/src/main/resources/hudson/model/View/AsynchPeople/index_ca.properties b/core/src/main/resources/hudson/model/View/AsynchPeople/index_ca.properties index 1aeb0b601784..2c0a54936568 100644 --- a/core/src/main/resources/hudson/model/View/AsynchPeople/index_ca.properties +++ b/core/src/main/resources/hudson/model/View/AsynchPeople/index_ca.properties @@ -4,4 +4,4 @@ Last\ Active=Darrer actiu Name=Nom On=Actiu People=Persones -User\ Id=Identificador d''''usuari +User\ ID=Identificador d''''usuari diff --git a/core/src/main/resources/hudson/model/View/AsynchPeople/index_cs.properties b/core/src/main/resources/hudson/model/View/AsynchPeople/index_cs.properties index e81a79eb0165..1b2211e3d495 100644 --- a/core/src/main/resources/hudson/model/View/AsynchPeople/index_cs.properties +++ b/core/src/main/resources/hudson/model/View/AsynchPeople/index_cs.properties @@ -24,4 +24,4 @@ Last\ Active=Posledn\u00ED aktivita Name=Jm\u00E9no On=Na People=Lid\u00E9 -User\ Id=U\u017Eivatelsk\u00E9 ID +User\ ID=U\u017Eivatelsk\u00E9 ID diff --git a/core/src/main/resources/hudson/model/View/AsynchPeople/index_da.properties b/core/src/main/resources/hudson/model/View/AsynchPeople/index_da.properties index 37e54399303e..f4e1e48d6f89 100644 --- a/core/src/main/resources/hudson/model/View/AsynchPeople/index_da.properties +++ b/core/src/main/resources/hudson/model/View/AsynchPeople/index_da.properties @@ -25,5 +25,5 @@ Last\ Active=Sidst aktiv People=Personer Name=Navn All\ People=Alle Personer -User\ Id=Bruger-ID +User\ ID=Bruger-ID blurb=Inkluderer alle kendte "brugere", inklusiv login-identiteter som kan findes ud fra nuv\u00E6rende sikkerhedsniveau samt personer n\u00E6vnt i commit-beskeder i registrerede changelogs. diff --git a/core/src/main/resources/hudson/model/View/AsynchPeople/index_de.properties b/core/src/main/resources/hudson/model/View/AsynchPeople/index_de.properties index 2dc1e3c71622..7451548bafbf 100644 --- a/core/src/main/resources/hudson/model/View/AsynchPeople/index_de.properties +++ b/core/src/main/resources/hudson/model/View/AsynchPeople/index_de.properties @@ -24,6 +24,6 @@ Name=Name On=Job All\ People=Alle Benutzer People=Benutzer -User\ Id=Jenkins Benutzer Id +User\ ID=Jenkins Benutzer Id blurb=Beinhaltet alle bekannten Benutzer, einschlie\u00DFlich der Login-Benutzer des aktuellen Sicherheitsbereichs, sowie Namen, die in Commit-Kommentaren von Changelogs erw\u00E4hnt werden. Last\ Commit\ Activity=Letzte SCM-Aktivit\u00E4t diff --git a/core/src/main/resources/hudson/model/View/AsynchPeople/index_el.properties b/core/src/main/resources/hudson/model/View/AsynchPeople/index_el.properties index f9e8fd487e16..d5726bd7a422 100644 --- a/core/src/main/resources/hudson/model/View/AsynchPeople/index_el.properties +++ b/core/src/main/resources/hudson/model/View/AsynchPeople/index_el.properties @@ -24,4 +24,4 @@ Last\ Active=\u03A4\u03B5\u03BB\u03B5\u03C5\u03C4\u03B1\u03AF\u03B1 \u03C7\u03C1 Name=\u038C\u03BD\u03BF\u03BC\u03B1 On=\u03A4\u03B5\u03BB\u03B5\u03C5\u03C4\u03B1\u03AF\u03B1 \u03B5\u03BD\u03B5\u03C1\u03B3\u03AE \u03B1\u03BD\u03B1\u03C6\u03BF\u03C1\u03AC \u03C3\u03C4\u03BF project People=\u0386\u03BD\u03B8\u03C1\u03C9\u03C0\u03BF\u03B9 -User\ Id=Id \u03C7\u03C1\u03AE\u03C3\u03C4\u03B7 +User\ ID=Id \u03C7\u03C1\u03AE\u03C3\u03C4\u03B7 diff --git a/core/src/main/resources/hudson/model/View/AsynchPeople/index_es.properties b/core/src/main/resources/hudson/model/View/AsynchPeople/index_es.properties index 71372f35e418..e3169cefb1d4 100644 --- a/core/src/main/resources/hudson/model/View/AsynchPeople/index_es.properties +++ b/core/src/main/resources/hudson/model/View/AsynchPeople/index_es.properties @@ -26,5 +26,5 @@ On=En All\ People=Todos People=Actividad -User\ Id=Nombre de Usario +User\ ID=Nombre de Usario blurb=Incluye todos los "usuarios" conocidos, incluyendo las identidades de acceso que se pueden enumerar en el dominio de seguridad actual, as\u00ED como las personas mencionadas en los mensajes de confirmaci\u00F3n en los registros de cambios registrados. diff --git a/core/src/main/resources/hudson/model/View/AsynchPeople/index_es_AR.properties b/core/src/main/resources/hudson/model/View/AsynchPeople/index_es_AR.properties index 48f85499964a..36c7f14c1076 100644 --- a/core/src/main/resources/hudson/model/View/AsynchPeople/index_es_AR.properties +++ b/core/src/main/resources/hudson/model/View/AsynchPeople/index_es_AR.properties @@ -3,4 +3,4 @@ Last\ Active=\u00FAltimo activo Name=Nombre People=Personas -User\ Id=ID del usuario +User\ ID=ID del usuario diff --git a/core/src/main/resources/hudson/model/View/AsynchPeople/index_fi.properties b/core/src/main/resources/hudson/model/View/AsynchPeople/index_fi.properties index 8eb0aab87cf0..5dba6e4b1d53 100644 --- a/core/src/main/resources/hudson/model/View/AsynchPeople/index_fi.properties +++ b/core/src/main/resources/hudson/model/View/AsynchPeople/index_fi.properties @@ -24,4 +24,4 @@ Last\ Active=Viimeksi Aktiivisena Name=Nimi On=Viimeksi Aktiivinen Ty\u00F6 People=K\u00E4ytt\u00E4j\u00E4t -User\ Id=K\u00E4ytt\u00E4j\u00E4tunnus +User\ ID=K\u00E4ytt\u00E4j\u00E4tunnus diff --git a/core/src/main/resources/hudson/model/View/AsynchPeople/index_hu.properties b/core/src/main/resources/hudson/model/View/AsynchPeople/index_hu.properties index c71fa161a001..1204de4b64e2 100644 --- a/core/src/main/resources/hudson/model/View/AsynchPeople/index_hu.properties +++ b/core/src/main/resources/hudson/model/View/AsynchPeople/index_hu.properties @@ -25,4 +25,4 @@ Last\ Active=Utols\u00F3 aktivit\u00E1s Name=N\u00E9v On=Ebben People=Emberek -User\ Id=Felhaszn\u00E1l\u00F3 azonos\u00EDt\u00F3 +User\ ID=Felhaszn\u00E1l\u00F3 azonos\u00EDt\u00F3 diff --git a/core/src/main/resources/hudson/model/View/AsynchPeople/index_ja.properties b/core/src/main/resources/hudson/model/View/AsynchPeople/index_ja.properties index fa8162178bab..06e6427d2065 100644 --- a/core/src/main/resources/hudson/model/View/AsynchPeople/index_ja.properties +++ b/core/src/main/resources/hudson/model/View/AsynchPeople/index_ja.properties @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -User\ Id=\u30e6\u30fc\u30b6\u30fcID +User\ ID=\u30e6\u30fc\u30b6\u30fcID Name=\u540d\u524d Last\ Active=\u6700\u8fd1\u306e\u6d3b\u52d5 On=\u5834\u6240 diff --git a/core/src/main/resources/hudson/model/View/AsynchPeople/index_ko.properties b/core/src/main/resources/hudson/model/View/AsynchPeople/index_ko.properties index c36e71e58a30..cdc20f664691 100644 --- a/core/src/main/resources/hudson/model/View/AsynchPeople/index_ko.properties +++ b/core/src/main/resources/hudson/model/View/AsynchPeople/index_ko.properties @@ -24,4 +24,3 @@ Last\ Active=\uB9C8\uC9C0\uB9C9 \uD65C\uB3D9\uC0AC\uD56D Name=\uC774\uB984 On=\uC811\uC18D \uC911 People=\uC0AC\uC6A9\uC790 -User\ Id= diff --git a/core/src/main/resources/hudson/model/View/AsynchPeople/index_lt.properties b/core/src/main/resources/hudson/model/View/AsynchPeople/index_lt.properties index 43e2b4e3bc41..e06e63585d95 100644 --- a/core/src/main/resources/hudson/model/View/AsynchPeople/index_lt.properties +++ b/core/src/main/resources/hudson/model/View/AsynchPeople/index_lt.properties @@ -24,4 +24,4 @@ All\ People=Visi vartotojai Last\ Active=Paskutiniai Veiksmai Name=Vardas People=Vartotojai -User\ Id=Slapyvardis +User\ ID=Slapyvardis diff --git a/core/src/main/resources/hudson/model/View/AsynchPeople/index_lv.properties b/core/src/main/resources/hudson/model/View/AsynchPeople/index_lv.properties index 927d020d3c67..eb87dd8e7aec 100644 --- a/core/src/main/resources/hudson/model/View/AsynchPeople/index_lv.properties +++ b/core/src/main/resources/hudson/model/View/AsynchPeople/index_lv.properties @@ -25,4 +25,4 @@ Last\ Active=Ped\u0113j\u0101 aktivit\u0101te Name=V\u0101rds On=Uz People=Cilv\u0113ki -User\ Id=Lietot\u0101ja identifikators +User\ ID=Lietot\u0101ja identifikators diff --git a/core/src/main/resources/hudson/model/View/AsynchPeople/index_nb_NO.properties b/core/src/main/resources/hudson/model/View/AsynchPeople/index_nb_NO.properties index 6aa6c2e8508d..1bf1361e303d 100644 --- a/core/src/main/resources/hudson/model/View/AsynchPeople/index_nb_NO.properties +++ b/core/src/main/resources/hudson/model/View/AsynchPeople/index_nb_NO.properties @@ -24,4 +24,4 @@ Last\ Active=Sist aktiv Name=Navn On=P\u00E5 People=Folk -User\ Id=Bruker Id +User\ ID=Bruker Id diff --git a/core/src/main/resources/hudson/model/View/AsynchPeople/index_nl.properties b/core/src/main/resources/hudson/model/View/AsynchPeople/index_nl.properties index f696b19bbd21..8d3da753d0f5 100644 --- a/core/src/main/resources/hudson/model/View/AsynchPeople/index_nl.properties +++ b/core/src/main/resources/hudson/model/View/AsynchPeople/index_nl.properties @@ -25,5 +25,5 @@ All\ People=Iedereen Last\ Active=Laatst actief On= People=Mensen -User\ Id=Id gebruiker +User\ ID=Id gebruiker blurb=Dit zijn alle bekende \u201Cgebruikers\u201D, inclusief geregistreerde inloggers, plus alle mensen genoemd in wijzingings logboeken die wijzinging hebben gedaan. diff --git a/core/src/main/resources/hudson/model/View/AsynchPeople/index_pt_BR.properties b/core/src/main/resources/hudson/model/View/AsynchPeople/index_pt_BR.properties index 960d16f03e40..b583151396b8 100644 --- a/core/src/main/resources/hudson/model/View/AsynchPeople/index_pt_BR.properties +++ b/core/src/main/resources/hudson/model/View/AsynchPeople/index_pt_BR.properties @@ -25,5 +25,5 @@ Last\ Active=\u00DAltima atividade On=Em People=Pessoas All\ People=Todas as pessoas -User\ Id=ID do usu\u00E1rio +User\ ID=ID do usu\u00E1rio blurb=Inclui todos os "usu\u00E1rios" conhecidos, incluindo identidades de usu\u00e1rios as quais o reino de seguran\u00E7a consegue enumerar, assim como pessoas mencionadas nas mensagens de commits nos registros de mudan\u00E7as gravados. diff --git a/core/src/main/resources/hudson/model/View/AsynchPeople/index_pt_PT.properties b/core/src/main/resources/hudson/model/View/AsynchPeople/index_pt_PT.properties index bae373c40b66..6594baaf85c1 100644 --- a/core/src/main/resources/hudson/model/View/AsynchPeople/index_pt_PT.properties +++ b/core/src/main/resources/hudson/model/View/AsynchPeople/index_pt_PT.properties @@ -4,4 +4,4 @@ Last\ Active=Ultima Actividade Name=Nome On=Ligado People=Pessoas -User\ Id=Id do Utilizado +User\ ID=Id do Utilizado diff --git a/core/src/main/resources/hudson/model/View/AsynchPeople/index_ro.properties b/core/src/main/resources/hudson/model/View/AsynchPeople/index_ro.properties index 36f88fb85302..08df8df5d343 100644 --- a/core/src/main/resources/hudson/model/View/AsynchPeople/index_ro.properties +++ b/core/src/main/resources/hudson/model/View/AsynchPeople/index_ro.properties @@ -24,4 +24,4 @@ Last\ Active=Activ ultima oar\u0103 Name=Nume On=Pe People=Contribuitori -User\ Id=Id utilizator +User\ ID=Id utilizator diff --git a/core/src/main/resources/hudson/model/View/AsynchPeople/index_sr.properties b/core/src/main/resources/hudson/model/View/AsynchPeople/index_sr.properties index a44ab2742a40..def84ef624f4 100644 --- a/core/src/main/resources/hudson/model/View/AsynchPeople/index_sr.properties +++ b/core/src/main/resources/hudson/model/View/AsynchPeople/index_sr.properties @@ -2,9 +2,8 @@ People=\u041A\u043E\u0440\u0438\u0441\u043D\u0438\u0446\u0438 blurb=\u0422\u0430\u0431\u0435\u043B\u0430 \u0441\u0432\u0438\u0445 Jenkins \u043A\u043E\u0440\u0438\u0441\u043D\u0438\u043A\u0430, \u0443\u043A\u0459\u0443\u0447\u0443\u0458\u0443\u045B\u0438 \u0441\u0432\u0435 \u043A\u043E\u0440\u0438\u0441\u043D\u0438\u043A\u0435 \u043A\u043E\u0458e \u0441\u0438\u0441\u0442\u0435\u043C \u0430\u0443\u0442\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0446\u0438\u0458\u0435 \u043C\u043E\u0436\u0435 \u043D\u0430\u0432\u0435\u0441\u0442\u0438, \u0438 \u043A\u043E\u0440\u0438\u0441\u043D\u0438\u0446\u0438 \u043D\u0430\u0432\u0435\u0434\u0435\u043D\u0438 \u0443 \u043A\u043E\u043C\u0438\u0442-\u043F\u043E\u0440\u0443\u043A\u0430\u043C\u0430 \u0435\u0432\u0438\u0434\u0435\u043D\u0442\u0438\u0440\u0430\u043D\u0438 \u0443 \u0434\u043D\u0435\u0432\u043D\u0438\u043A\u0430\u043C\u0430 \u043F\u0440\u043E\u043C\u0435\u043D\u0430. -User\ Id=\u0418\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0446\u0438\u043E\u043D\u0438 \u0431\u0440\u043E\u0458 +User\ ID=\u0418\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0446\u0438\u043E\u043D\u0438 \u0431\u0440\u043E\u0458 Name=\u0418\u043C\u0435 Last\ Commit\ Activity=\u0417\u0430\u0434\u045A\u0435 \u0430\u043A\u0442\u0438\u0432\u0430\u043D On=\u043D\u0430 All\ People=\u0421\u0432\u0438 \u043A\u043E\u0440\u0438\u0441\u043D\u0438\u0446\u0438 -Last\ Active=\u0417\u0430\u0434\u045A\u0430 \u0430\u043A\u0442\u0438\u0432\u043D\u043E\u0441\u0442 diff --git a/core/src/main/resources/hudson/model/View/AsynchPeople/index_sv_SE.properties b/core/src/main/resources/hudson/model/View/AsynchPeople/index_sv_SE.properties index 6d299d167705..812769679f08 100644 --- a/core/src/main/resources/hudson/model/View/AsynchPeople/index_sv_SE.properties +++ b/core/src/main/resources/hudson/model/View/AsynchPeople/index_sv_SE.properties @@ -25,5 +25,5 @@ Last\ Active=Senast aktiv Name=Namn On=P\u00E5 People=Personer -User\ Id=Anv\u00E4ndar-ID +User\ ID=Anv\u00E4ndar-ID blurb=Alla k\u00E4nda "anv\u00E4ndare", inklusive identiteter som det aktuella s\u00E4kerhetsomr\u00E5det kan numrera samt personer n\u00E4mnda i kommit-meddelanden i sparade f\u00F6r\u00E4ndringsloggar. diff --git a/core/src/main/resources/hudson/model/View/AsynchPeople/index_tr.properties b/core/src/main/resources/hudson/model/View/AsynchPeople/index_tr.properties index 452ed949ba48..3f272c0f2603 100644 --- a/core/src/main/resources/hudson/model/View/AsynchPeople/index_tr.properties +++ b/core/src/main/resources/hudson/model/View/AsynchPeople/index_tr.properties @@ -24,4 +24,4 @@ Name=\u0130sim Last\ Active=Son Aktif On=A\u00e7\u0131k People=\u0130nsanlar -User\ Id=Kullan\u0131c\u0131 ad\u0131 +User\ ID=Kullan\u0131c\u0131 ad\u0131 diff --git a/core/src/main/resources/hudson/model/View/AsynchPeople/index_uk.properties b/core/src/main/resources/hudson/model/View/AsynchPeople/index_uk.properties index b8cbbc04e8f8..02444de307d3 100644 --- a/core/src/main/resources/hudson/model/View/AsynchPeople/index_uk.properties +++ b/core/src/main/resources/hudson/model/View/AsynchPeople/index_uk.properties @@ -4,4 +4,4 @@ Last\ Active=\u0427\u0430\u0441 \u043E\u0441\u0442\u0430\u043D\u043D\u044C\u043E Name=\u0406\u043C\u2019\u044F On=\u041F\u0440\u043E\u0435\u043A\u0442 People=\u041B\u044E\u0434\u0438 -User\ Id=\u041B\u043E\u0433\u0456\u043D +User\ ID=\u041B\u043E\u0433\u0456\u043D diff --git a/core/src/main/resources/hudson/model/View/AsynchPeople/index_zh_TW.properties b/core/src/main/resources/hudson/model/View/AsynchPeople/index_zh_TW.properties index c8c158966140..f59d76d932dc 100644 --- a/core/src/main/resources/hudson/model/View/AsynchPeople/index_zh_TW.properties +++ b/core/src/main/resources/hudson/model/View/AsynchPeople/index_zh_TW.properties @@ -22,7 +22,7 @@ # THE SOFTWARE. People=\u4eba\u54e1 -User\ Id=\u4f7f\u7528\u8005 ID +User\ ID=\u4f7f\u7528\u8005 ID Name=\u540d\u7a31 Last\ Active=\u6700\u8fd1\u4e00\u6b21\u6d3b\u52d5 On=\u6a21\u7d44 From 99ecc56a38b33e515032f460fb9f4c22b12c823c Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Sat, 16 Oct 2021 12:06:33 -0400 Subject: [PATCH 47/66] [JENKINS-66854] `AsyncPeriodicWork` should not touch its log file unless it has something to say (#5802) --- .../java/hudson/model/AsyncAperiodicWork.java | 11 ++--- .../java/hudson/model/AsyncPeriodicWork.java | 43 ++++++++++++++++--- 2 files changed, 39 insertions(+), 15 deletions(-) diff --git a/core/src/main/java/hudson/model/AsyncAperiodicWork.java b/core/src/main/java/hudson/model/AsyncAperiodicWork.java index b4c05b943250..b5ad5b07d44f 100644 --- a/core/src/main/java/hudson/model/AsyncAperiodicWork.java +++ b/core/src/main/java/hudson/model/AsyncAperiodicWork.java @@ -113,21 +113,16 @@ public final void doAperiodicRun() { long startTime = System.currentTimeMillis(); long stopTime; - StreamTaskListener l = createListener(); + AsyncPeriodicWork.LazyTaskListener l = new AsyncPeriodicWork.LazyTaskListener(() -> createListener(), String.format("Started at %tc", new Date(startTime))); try (ACLContext ctx = ACL.as2(ACL.SYSTEM2)) { - l.getLogger().printf("Started at %tc%n", new Date(startTime)); - execute(l); + execute(l); } catch (IOException e) { Functions.printStackTrace(e, l.fatalError(e.getMessage())); } catch (InterruptedException e) { Functions.printStackTrace(e, l.fatalError("aborted")); } finally { stopTime = System.currentTimeMillis(); - try { - l.getLogger().printf("Finished at %tc. %dms%n", new Date(stopTime), stopTime - startTime); - } finally { - l.closeQuietly(); - } + l.close(String.format("Finished at %tc. %dms", new Date(stopTime), stopTime - startTime)); } logger.log(getNormalLoggingLevel(), "Finished {0}. {1,number} ms", diff --git a/core/src/main/java/hudson/model/AsyncPeriodicWork.java b/core/src/main/java/hudson/model/AsyncPeriodicWork.java index fdd7a1ba9073..1a6ce7cadaf3 100644 --- a/core/src/main/java/hudson/model/AsyncPeriodicWork.java +++ b/core/src/main/java/hudson/model/AsyncPeriodicWork.java @@ -6,8 +6,10 @@ import hudson.util.StreamTaskListener; import java.io.File; import java.io.IOException; +import java.io.PrintStream; import java.util.Date; import java.util.concurrent.TimeUnit; +import java.util.function.Supplier; import java.util.logging.Level; import java.util.logging.LogRecord; import jenkins.model.Jenkins; @@ -94,9 +96,8 @@ public final void doRun() { long startTime = System.currentTimeMillis(); long stopTime; - StreamTaskListener l = createListener(); + LazyTaskListener l = new LazyTaskListener(() -> createListener(), String.format("Started at %tc", new Date(startTime))); try { - l.getLogger().printf("Started at %tc%n", new Date(startTime)); try (ACLContext ctx = ACL.as2(ACL.SYSTEM2)) { execute(l); } @@ -106,11 +107,7 @@ public final void doRun() { Functions.printStackTrace(e, l.fatalError("aborted")); } finally { stopTime = System.currentTimeMillis(); - try { - l.getLogger().printf("Finished at %tc. %dms%n", new Date(stopTime), stopTime - startTime); - } finally { - l.closeQuietly(); - } + l.close(String.format("Finished at %tc. %dms", new Date(stopTime), stopTime - startTime)); } logger.log(getNormalLoggingLevel(), "Finished {0}. {1,number} ms", @@ -125,6 +122,38 @@ public final void doRun() { } } + static final class LazyTaskListener implements TaskListener { + + private final Supplier supplier; + private final String openingMessage; + private StreamTaskListener delegate; + + LazyTaskListener(Supplier supplier, String openingMessage) { + this.supplier = supplier; + this.openingMessage = openingMessage; + } + + @Override + public synchronized PrintStream getLogger() { + if (delegate == null) { + delegate = supplier.get(); + delegate.getLogger().println(openingMessage); + } + return delegate.getLogger(); + } + + synchronized void close(String closingMessage) { + if (delegate != null) { + try { + delegate.getLogger().println(closingMessage); + } finally { + delegate.closeQuietly(); + } + } + } + + } + protected StreamTaskListener createListener() { File f = getLogFile(); if (!f.getParentFile().isDirectory()) { From dd4b595421fff01254a6ce11ba6aa70c396e244d Mon Sep 17 00:00:00 2001 From: Daniel Beck <1831569+daniel-beck@users.noreply.github.com> Date: Sat, 16 Oct 2021 18:06:58 +0200 Subject: [PATCH 48/66] Finalize version numbers for Cause#getShortDescription change (#5803) Co-authored-by: Daniel Beck --- core/src/main/java/hudson/model/Cause.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/hudson/model/Cause.java b/core/src/main/java/hudson/model/Cause.java index 53c8acbb32e2..256fbb24eb3c 100644 --- a/core/src/main/java/hudson/model/Cause.java +++ b/core/src/main/java/hudson/model/Cause.java @@ -65,10 +65,10 @@ public abstract class Cause { * One-line human-readable text of the cause. * * Historically, this method's return value was used to render HTML on the UI as well. - * Since October 2021, the return value is interpreted as text. + * Since Jenkins 2.315 and 2.303.2, the return value is interpreted as text. * To have rich HTML output on the UI, provide a custom {@code description.jelly} view for your subclass. + * See the documentation. */ - // TODO finalize version numbers @Exported(visibility=3) public abstract String getShortDescription(); From d25bf41cda9ac25d658924308568bc838be9f3c7 Mon Sep 17 00:00:00 2001 From: Stefan Spieker Date: Sat, 16 Oct 2021 18:07:06 +0200 Subject: [PATCH 49/66] Removed superfluous throws in tests (#5798) --- core/src/test/java/hudson/BulkChangeTest.java | 2 +- core/src/test/java/hudson/FilePathTest.java | 4 ++-- core/src/test/java/hudson/FunctionsTest.java | 2 +- core/src/test/java/hudson/UtilTest.java | 2 +- core/src/test/java/hudson/XmlFileTest.java | 2 +- .../test/java/hudson/logging/LogRecorderTest.java | 2 +- .../test/java/hudson/model/AbstractItemTest.java | 2 +- .../test/java/hudson/model/FingerprintTest.java | 2 +- .../java/hudson/model/LoadStatisticsTest.java | 2 +- .../hudson/model/ParameterDefinitionTest.java | 2 +- .../java/hudson/model/RunParameterValueTest.java | 2 +- core/src/test/java/hudson/model/RunTest.java | 13 ++++++------- core/src/test/java/hudson/model/ViewTest.java | 7 ++----- .../java/hudson/slaves/ChannelPingerTest.java | 15 ++++++++------- .../tasks/BuildStepCompatibilityLayerTest.java | 5 ++--- .../java/hudson/util/CyclicGraphDetectorTest.java | 2 +- .../src/test/java/hudson/util/DirScannerTest.java | 3 +-- .../test/java/hudson/util/ProcessTreeTest.java | 4 ++-- core/src/test/java/hudson/util/XStream2Test.java | 2 +- .../model/CoreEnvironmentContributorTest.java | 2 +- .../java/jenkins/model/JenkinsGetRootUrlTest.java | 2 +- .../test/java/jenkins/model/NewViewLinkTest.java | 8 ++++---- .../model/lazy/AbstractLazyLoadRunMapTest.java | 2 +- .../java/jenkins/model/lazy/FakeMapBuilder.java | 2 +- .../jenkins/security/ConfidentialStoreRule.java | 2 +- ...dactSecretJsonInErrorMessageSanitizerTest.java | 8 ++++---- .../security/apitoken/ApiTokenStatsTest.java | 2 +- .../security/stapler/StaplerSignaturesTest.java | 4 ++-- .../test/java/jenkins/util/TimeDurationTest.java | 2 +- .../test/java/jenkins/util/VirtualFileTest.java | 12 ++++++------ .../java/jenkins/util/xstream/XStreamDOMTest.java | 2 +- .../jenkins/widgets/HistoryPageFilterTest.java | 2 +- 32 files changed, 60 insertions(+), 65 deletions(-) diff --git a/core/src/test/java/hudson/BulkChangeTest.java b/core/src/test/java/hudson/BulkChangeTest.java index c2e89dea3825..d5837268d41d 100644 --- a/core/src/test/java/hudson/BulkChangeTest.java +++ b/core/src/test/java/hudson/BulkChangeTest.java @@ -61,7 +61,7 @@ public void set(int x, int y) throws IOException { } @Override - public void save() throws IOException { + public void save() { if(BulkChange.contains(this)) return; saveCount++; } diff --git a/core/src/test/java/hudson/FilePathTest.java b/core/src/test/java/hudson/FilePathTest.java index 8e7f25c93faf..d6043acd92a7 100644 --- a/core/src/test/java/hudson/FilePathTest.java +++ b/core/src/test/java/hudson/FilePathTest.java @@ -191,7 +191,7 @@ public void write(byte[] b, int off, int len) throws IOException { } @Override - public void close() throws IOException { + public void close() { closed = new Exception(); } } @@ -687,7 +687,7 @@ private static void assertValidateAntFileMask(String expected, FilePath d, Strin private URL someUrlToZipFile(final URLConnection con) throws IOException { final URLStreamHandler urlHandler = new URLStreamHandler() { - @Override protected URLConnection openConnection(URL u) throws IOException { + @Override protected URLConnection openConnection(URL u) { return con; } }; diff --git a/core/src/test/java/hudson/FunctionsTest.java b/core/src/test/java/hudson/FunctionsTest.java index d0dd2035fb39..5309f87068aa 100644 --- a/core/src/test/java/hudson/FunctionsTest.java +++ b/core/src/test/java/hudson/FunctionsTest.java @@ -364,7 +364,7 @@ private void assertBrokenAs(String plain, String... chunks) { } @Issue("JDK-6507809") - @Test public void printThrowable() throws Exception { + @Test public void printThrowable() { // Basics: a single exception. No change. assertPrintThrowable(new Stack("java.lang.NullPointerException: oops", "p.C.method1:17", "m.Main.main:1"), "java.lang.NullPointerException: oops\n" + diff --git a/core/src/test/java/hudson/UtilTest.java b/core/src/test/java/hudson/UtilTest.java index 384e7adec623..ffdca7929aa7 100644 --- a/core/src/test/java/hudson/UtilTest.java +++ b/core/src/test/java/hudson/UtilTest.java @@ -530,7 +530,7 @@ public void testModeToPermissions() throws Exception { } @Test - public void testPermissionsToMode() throws Exception { + public void testPermissionsToMode() { assertEquals(0777, Util.permissionsToMode(PosixFilePermissions.fromString("rwxrwxrwx"))); assertEquals(0757, Util.permissionsToMode(PosixFilePermissions.fromString("rwxr-xrwx"))); assertEquals(0750, Util.permissionsToMode(PosixFilePermissions.fromString("rwxr-x---"))); diff --git a/core/src/test/java/hudson/XmlFileTest.java b/core/src/test/java/hudson/XmlFileTest.java index 22a7d75298e3..49a1dbb9f2ca 100644 --- a/core/src/test/java/hudson/XmlFileTest.java +++ b/core/src/test/java/hudson/XmlFileTest.java @@ -34,7 +34,7 @@ public void canReadXml1_0Test() throws IOException { // should be illegal. Ignoring this test until we switch to a more compliant driver @Ignore @Test - public void xml1_0_withSpecialCharsShouldFail() throws IOException { + public void xml1_0_withSpecialCharsShouldFail() { URL configUrl = getClass().getResource("/hudson/config_1_0_with_special_chars.xml"); XStream2 xs = new XStream2(); xs.alias("hudson", Jenkins.class); diff --git a/core/src/test/java/hudson/logging/LogRecorderTest.java b/core/src/test/java/hudson/logging/LogRecorderTest.java index 43b1d9228a4c..5e48e89effa0 100644 --- a/core/src/test/java/hudson/logging/LogRecorderTest.java +++ b/core/src/test/java/hudson/logging/LogRecorderTest.java @@ -143,7 +143,7 @@ private static Boolean matches(String target, String logger, Level loggerLevel) } @Test - public void autocompletionTest() throws Exception { + public void autocompletionTest() { List loggers = Arrays.asList( "com.company.whatever.Foo", "com.foo.Bar", "com.foo.Baz", "org.example.app.Main", "org.example.app.impl.xml.Parser", "org.example.app.impl.xml.Validator"); diff --git a/core/src/test/java/hudson/model/AbstractItemTest.java b/core/src/test/java/hudson/model/AbstractItemTest.java index fe20b1137de7..2be49a527e55 100644 --- a/core/src/test/java/hudson/model/AbstractItemTest.java +++ b/core/src/test/java/hudson/model/AbstractItemTest.java @@ -123,7 +123,7 @@ public void renameMethodShouldThrowExceptionWhenNotIsNameEditable() { @Test @Issue("JENKINS-58571") - public void doConfirmRenameMustThrowFormFailureWhenNotIsNameEditable() throws IOException { + public void doConfirmRenameMustThrowFormFailureWhenNotIsNameEditable() { //GIVEN NameNotEditableItem item = new NameNotEditableItem(null,"NameNotEditableItem"); diff --git a/core/src/test/java/hudson/model/FingerprintTest.java b/core/src/test/java/hudson/model/FingerprintTest.java index c8cf6628511e..d7fd806e4721 100644 --- a/core/src/test/java/hudson/model/FingerprintTest.java +++ b/core/src/test/java/hudson/model/FingerprintTest.java @@ -233,7 +233,7 @@ public void removeAll3() { assertNotNull(fp.getUsages()); } - @Test public void fromString() throws Exception { + @Test public void fromString() { // // Single // diff --git a/core/src/test/java/hudson/model/LoadStatisticsTest.java b/core/src/test/java/hudson/model/LoadStatisticsTest.java index d568dc5345b5..b2e16c02ff63 100644 --- a/core/src/test/java/hudson/model/LoadStatisticsTest.java +++ b/core/src/test/java/hudson/model/LoadStatisticsTest.java @@ -97,7 +97,7 @@ protected boolean matches(Queue.Item item, SubTask subTask) { } @Test - public void isModernWorks() throws Exception { + public void isModernWorks() { assertThat(LoadStatistics.isModern(Modern.class), is(true)); assertThat(LoadStatistics.isModern(LoadStatistics.class), is(false)); } diff --git a/core/src/test/java/hudson/model/ParameterDefinitionTest.java b/core/src/test/java/hudson/model/ParameterDefinitionTest.java index ff86dfcc1ca6..56222a2dab63 100644 --- a/core/src/test/java/hudson/model/ParameterDefinitionTest.java +++ b/core/src/test/java/hudson/model/ParameterDefinitionTest.java @@ -9,7 +9,7 @@ public class ParameterDefinitionTest { @Test - public void compareStringParameterDefinition() throws Exception { + public void compareStringParameterDefinition() { StringParameterDefinition spd = new StringParameterDefinition("spd", "default"); StringParameterDefinition spdSame = new StringParameterDefinition("spd", "default"); StringParameterDefinition spdOther = new StringParameterDefinition("spdOther", "default"); diff --git a/core/src/test/java/hudson/model/RunParameterValueTest.java b/core/src/test/java/hudson/model/RunParameterValueTest.java index 5a4c64addcc2..18c5b088ab1f 100644 --- a/core/src/test/java/hudson/model/RunParameterValueTest.java +++ b/core/src/test/java/hudson/model/RunParameterValueTest.java @@ -33,7 +33,7 @@ public class RunParameterValueTest { @SuppressWarnings("ResultOfObjectAllocationIgnored") - @Test public void robustness() throws Exception { + @Test public void robustness() { RunParameterValue rpv = new RunParameterValue("whatever", "folder/job#57"); assertEquals("whatever", rpv.getName()); assertEquals("folder/job", rpv.getJobName()); diff --git a/core/src/test/java/hudson/model/RunTest.java b/core/src/test/java/hudson/model/RunTest.java index 6c892e5d3769..816be54d65cf 100644 --- a/core/src/test/java/hudson/model/RunTest.java +++ b/core/src/test/java/hudson/model/RunTest.java @@ -32,7 +32,6 @@ import edu.umd.cs.findbugs.annotations.NonNull; import hudson.console.AnnotatedLargeText; import java.io.File; -import java.io.IOException; import java.io.InputStream; import java.io.PrintStream; import java.io.PrintWriter; @@ -73,14 +72,14 @@ public void timezoneOfID() throws Exception { ExecutorService svc = Executors.newSingleThreadExecutor(); try { r = svc.submit(new Callable() { - @Override public Run call() throws Exception { + @Override public Run call() { return new Run(new StubJob(), 1234567890) {}; } }).get(); TimeZone.setDefault(TimeZone.getTimeZone("America/Los_Angeles")); id = r.getId(); assertEquals(id, svc.submit(new Callable() { - @Override public String call() throws Exception { + @Override public String call() { return r.getId(); } }).get()); @@ -93,7 +92,7 @@ public void timezoneOfID() throws Exception { assertEquals(id, r.getId()); assertEquals(id, svc.submit(new Callable() { @Override - public String call() throws Exception { + public String call() { return r.getId(); } }).get()); @@ -106,7 +105,7 @@ public String call() throws Exception { } - private List.Artifact> createArtifactList(String... paths) throws Exception { + private List.Artifact> createArtifactList(String... paths) { Run r = new Run(new StubJob(), 0) {}; Run.ArtifactList list = r.new ArtifactList(); for (String p : paths) { @@ -142,7 +141,7 @@ public void artifactListDisambiguation3() throws Exception { @Issue("JENKINS-26777") @SuppressWarnings({"unchecked", "rawtypes", "deprecation"}) @Test - public void getDurationString() throws IOException { + public void getDurationString() { LocaleProvider providerToRestore = LocaleProvider.getProvider(); try { // This test expects English texts. @@ -313,7 +312,7 @@ public AnnotatedLargeText getLogText() { @NonNull @Override - public InputStream getLogInputStream() throws IOException { + public InputStream getLogInputStream() { return buf.newInputStream(); } }; diff --git a/core/src/test/java/hudson/model/ViewTest.java b/core/src/test/java/hudson/model/ViewTest.java index fea3d8e051ae..dab90dbae3d9 100644 --- a/core/src/test/java/hudson/model/ViewTest.java +++ b/core/src/test/java/hudson/model/ViewTest.java @@ -3,18 +3,15 @@ import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; -import hudson.model.Descriptor.FormException; import hudson.search.SearchIndex; import hudson.search.SearchIndexBuilder; import hudson.search.SearchItem; import hudson.views.ViewsTabBar; -import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.List; -import javax.servlet.ServletException; import org.junit.Test; import org.jvnet.hudson.test.Issue; import org.kohsuke.stapler.StaplerRequest; @@ -157,7 +154,7 @@ public boolean canDelete(View view) { } @Override - public void deleteView(View view) throws IOException { + public void deleteView(View view) { } @Override @@ -190,7 +187,7 @@ public boolean contains(TopLevelItem item) { } @Override - protected void submit(StaplerRequest req) throws IOException, ServletException, FormException { + protected void submit(StaplerRequest req) { } @Override diff --git a/core/src/test/java/hudson/slaves/ChannelPingerTest.java b/core/src/test/java/hudson/slaves/ChannelPingerTest.java index 05fabf7a6bcd..203945eb739d 100644 --- a/core/src/test/java/hudson/slaves/ChannelPingerTest.java +++ b/core/src/test/java/hudson/slaves/ChannelPingerTest.java @@ -6,6 +6,7 @@ import static org.mockito.Mockito.verify; import hudson.remoting.Channel; +import java.io.IOException; import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -29,19 +30,19 @@ public void tearDown() throws Exception { } @Before - public void setUp() throws Exception { + public void setUp() { mocks = MockitoAnnotations.openMocks(this); } @Before - public void preserveSystemProperties() throws Exception { + public void preserveSystemProperties() { preserveSystemProperty("hudson.slaves.ChannelPinger.pingInterval"); preserveSystemProperty("hudson.slaves.ChannelPinger.pingIntervalSeconds"); preserveSystemProperty("hudson.slaves.ChannelPinger.pingTimeoutSeconds"); } @After - public void restoreSystemProperties() throws Exception { + public void restoreSystemProperties() { for (Map.Entry entry : savedSystemProperties.entrySet()) { if (entry.getValue() != null) { System.setProperty(entry.getKey(), entry.getValue()); @@ -57,7 +58,7 @@ private void preserveSystemProperty(String propertyName) { } @Test - public void testDefaults() throws Exception { + public void testDefaults() throws IOException, InterruptedException { ChannelPinger channelPinger = new ChannelPinger(); channelPinger.install(mockChannel, null); @@ -68,7 +69,7 @@ public void testDefaults() throws Exception { } @Test - public void testFromSystemProperties() throws Exception { + public void testFromSystemProperties() throws IOException, InterruptedException { System.setProperty("hudson.slaves.ChannelPinger.pingTimeoutSeconds", "42"); System.setProperty("hudson.slaves.ChannelPinger.pingIntervalSeconds", "73"); @@ -80,7 +81,7 @@ public void testFromSystemProperties() throws Exception { } @Test - public void testFromOldSystemProperty() throws Exception { + public void testFromOldSystemProperty() throws IOException, InterruptedException { System.setProperty("hudson.slaves.ChannelPinger.pingInterval", "7"); ChannelPinger channelPinger = new ChannelPinger(); @@ -91,7 +92,7 @@ public void testFromOldSystemProperty() throws Exception { } @Test - public void testNewSystemPropertyTrumpsOld() throws Exception { + public void testNewSystemPropertyTrumpsOld() throws IOException, InterruptedException { System.setProperty("hudson.slaves.ChannelPinger.pingIntervalSeconds", "73"); System.setProperty("hudson.slaves.ChannelPinger.pingInterval", "7"); diff --git a/core/src/test/java/hudson/tasks/BuildStepCompatibilityLayerTest.java b/core/src/test/java/hudson/tasks/BuildStepCompatibilityLayerTest.java index 7d13fde80e6b..6220f3db9035 100644 --- a/core/src/test/java/hudson/tasks/BuildStepCompatibilityLayerTest.java +++ b/core/src/test/java/hudson/tasks/BuildStepCompatibilityLayerTest.java @@ -17,7 +17,7 @@ public class BuildStepCompatibilityLayerTest { @Issue("JENKINS-18734") @Test @SuppressWarnings("deprecation") /* testing deprecated variant */ - public void testPerformExpectAbstractMethodError() throws InterruptedException, IOException { + public void testPerformExpectAbstractMethodError() { FreeStyleBuild mock = Mockito.mock(FreeStyleBuild.class, Mockito.CALLS_REAL_METHODS); BuildStepCompatibilityLayer bscl = new BuildStepCompatibilityLayer() {}; @@ -34,8 +34,7 @@ public void testPerform() throws InterruptedException, IOException { BuildStepCompatibilityLayer bscl = new BuildStepCompatibilityLayer() { @Override - public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) - throws InterruptedException, IOException { + public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) { return true; } }; diff --git a/core/src/test/java/hudson/util/CyclicGraphDetectorTest.java b/core/src/test/java/hudson/util/CyclicGraphDetectorTest.java index 9baf9c24e74b..9c8213c6ed00 100644 --- a/core/src/test/java/hudson/util/CyclicGraphDetectorTest.java +++ b/core/src/test/java/hudson/util/CyclicGraphDetectorTest.java @@ -77,7 +77,7 @@ public void cycle1() { } @Test - public void cycle2() throws Exception { + public void cycle2() { new Graph().e("A","B").e("B","C").e("C","C").mustContainCycle("C"); } diff --git a/core/src/test/java/hudson/util/DirScannerTest.java b/core/src/test/java/hudson/util/DirScannerTest.java index 24d3e09826ab..4b702f77de58 100644 --- a/core/src/test/java/hudson/util/DirScannerTest.java +++ b/core/src/test/java/hudson/util/DirScannerTest.java @@ -28,7 +28,6 @@ import hudson.FilePath; import java.io.File; -import java.io.IOException; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; @@ -96,7 +95,7 @@ private static class MatchingFileVisitor extends FileVisitor { } @Override - public void visit(File f, String relativePath) throws IOException { + public void visit(File f, String relativePath) { if (relativePath.endsWith(filename)) { found = true; } diff --git a/core/src/test/java/hudson/util/ProcessTreeTest.java b/core/src/test/java/hudson/util/ProcessTreeTest.java index 6d2ea02d8357..ef3f9c5b4555 100644 --- a/core/src/test/java/hudson/util/ProcessTreeTest.java +++ b/core/src/test/java/hudson/util/ProcessTreeTest.java @@ -48,7 +48,7 @@ static class Tag implements Serializable { private static class MyCallable extends MasterToSlaveCallable implements Serializable { @Override - public Tag call() throws IOException { + public Tag call() { Tag t = new Tag(); t.tree = ProcessTree.get(); t.p = t.tree.iterator().next(); @@ -61,7 +61,7 @@ public Tag call() throws IOException { private static class ProcessCallableImpl implements ProcessCallable { @Override - public Void invoke(OSProcess process, VirtualChannel channel) throws IOException { + public Void invoke(OSProcess process, VirtualChannel channel) { assertNotNull(process); assertNotNull(channel); return null; diff --git a/core/src/test/java/hudson/util/XStream2Test.java b/core/src/test/java/hudson/util/XStream2Test.java index 3e459c374204..70d80879c31e 100644 --- a/core/src/test/java/hudson/util/XStream2Test.java +++ b/core/src/test/java/hudson/util/XStream2Test.java @@ -530,7 +530,7 @@ public void crashXstream() { } @Test - public void annotations() throws Exception { + public void annotations() { assertEquals("not registered, so sorry", "", Jenkins.XSTREAM2.toXML(new C1())); assertEquals("manually registered", "", Jenkins.XSTREAM2.toXML(new C2())); assertEquals("manually processed", "", Jenkins.XSTREAM2.toXML(new C3())); diff --git a/core/src/test/java/jenkins/model/CoreEnvironmentContributorTest.java b/core/src/test/java/jenkins/model/CoreEnvironmentContributorTest.java index 8ed573ac0cb0..519a234f8fff 100644 --- a/core/src/test/java/jenkins/model/CoreEnvironmentContributorTest.java +++ b/core/src/test/java/jenkins/model/CoreEnvironmentContributorTest.java @@ -36,7 +36,7 @@ public void tearDown() throws Exception { } @Before - public void setUp() throws Exception { + public void setUp() { mocks = MockitoAnnotations.openMocks(this); instance = new CoreEnvironmentContributor(); } diff --git a/core/src/test/java/jenkins/model/JenkinsGetRootUrlTest.java b/core/src/test/java/jenkins/model/JenkinsGetRootUrlTest.java index a8cfc03bd302..be5c82b82f23 100644 --- a/core/src/test/java/jenkins/model/JenkinsGetRootUrlTest.java +++ b/core/src/test/java/jenkins/model/JenkinsGetRootUrlTest.java @@ -232,7 +232,7 @@ private void accessing(final String realUrl) { when(req.getServerPort()).thenReturn(url.getPort() == -1 ? "https".equals(url.getProtocol()) ? 443 : 80 : url.getPort()); when(req.getContextPath()).thenReturn(url.getPath().replaceAll("/$", "")); when(req.getIntHeader(anyString())).thenAnswer(new Answer() { - @Override public Integer answer(InvocationOnMock invocation) throws Throwable { + @Override public Integer answer(InvocationOnMock invocation) { String name = (String) invocation.getArguments()[0]; String value = ((StaplerRequest) invocation.getMock()).getHeader(name); return value != null ? Integer.parseInt(value) : -1; diff --git a/core/src/test/java/jenkins/model/NewViewLinkTest.java b/core/src/test/java/jenkins/model/NewViewLinkTest.java index bdb648997fd0..8496da7cdbaa 100644 --- a/core/src/test/java/jenkins/model/NewViewLinkTest.java +++ b/core/src/test/java/jenkins/model/NewViewLinkTest.java @@ -25,7 +25,7 @@ public class NewViewLinkTest { private final String viewGroupURL = "abc/"; @Before - public void initTests() throws Exception { + public void initTests() { when(view.getOwner()).thenReturn(group); when(group.getUrl()).thenReturn(viewGroupURL); @@ -33,7 +33,7 @@ public void initTests() throws Exception { } @Test - public void getActionsHasPermission() throws Exception { + public void getActionsHasPermission() { when(group.hasPermission(any())).thenReturn(true); final List actions = newViewLink.createFor(view); @@ -46,7 +46,7 @@ public void getActionsHasPermission() throws Exception { } @Test - public void getActionsNoPermission() throws Exception { + public void getActionsNoPermission() { when(group.hasPermission(any())).thenReturn(false); final List actions = newViewLink.createFor(view); @@ -58,7 +58,7 @@ public void getActionsNoPermission() throws Exception { } @Test - public void getActionsNotModifiableOwner() throws Exception { + public void getActionsNotModifiableOwner() { ViewGroup vg = mock(ViewGroup.class); when(view.getOwner()).thenReturn(vg); when(vg.hasPermission(any())).thenReturn(true); diff --git a/core/src/test/java/jenkins/model/lazy/AbstractLazyLoadRunMapTest.java b/core/src/test/java/jenkins/model/lazy/AbstractLazyLoadRunMapTest.java index 853988826bdf..8f97ad8dbce7 100644 --- a/core/src/test/java/jenkins/model/lazy/AbstractLazyLoadRunMapTest.java +++ b/core/src/test/java/jenkins/model/lazy/AbstractLazyLoadRunMapTest.java @@ -239,7 +239,7 @@ public void eagerLoading() { } @Test - public void fastSubMap() throws Exception { + public void fastSubMap() { SortedMap m = a.subMap(99, 2); assertEquals(2, m.size()); diff --git a/core/src/test/java/jenkins/model/lazy/FakeMapBuilder.java b/core/src/test/java/jenkins/model/lazy/FakeMapBuilder.java index 78f07e52d112..aa2260ba3e22 100644 --- a/core/src/test/java/jenkins/model/lazy/FakeMapBuilder.java +++ b/core/src/test/java/jenkins/model/lazy/FakeMapBuilder.java @@ -57,7 +57,7 @@ public FakeMapBuilder add(int n) throws IOException { * Adds a build record under the given ID but make it unloadable, * which will cause a failure when a load is attempted on this build ID. */ - public FakeMapBuilder addUnloadable(int n) throws IOException { + public FakeMapBuilder addUnloadable(int n) { File build = new File(dir, Integer.toString(n)); build.mkdir(); return this; diff --git a/core/src/test/java/jenkins/security/ConfidentialStoreRule.java b/core/src/test/java/jenkins/security/ConfidentialStoreRule.java index a5075c782983..1fd1cb6c1055 100644 --- a/core/src/test/java/jenkins/security/ConfidentialStoreRule.java +++ b/core/src/test/java/jenkins/security/ConfidentialStoreRule.java @@ -8,7 +8,7 @@ public class ConfidentialStoreRule extends ExternalResource { @Override - protected void before() throws Throwable { + protected void before() { ConfidentialStore.Mock.INSTANCE.clear(); } diff --git a/core/src/test/java/jenkins/security/RedactSecretJsonInErrorMessageSanitizerTest.java b/core/src/test/java/jenkins/security/RedactSecretJsonInErrorMessageSanitizerTest.java index 07abce051eec..cef039cd38c3 100644 --- a/core/src/test/java/jenkins/security/RedactSecretJsonInErrorMessageSanitizerTest.java +++ b/core/src/test/java/jenkins/security/RedactSecretJsonInErrorMessageSanitizerTest.java @@ -33,7 +33,7 @@ @Issue("SECURITY-765") public class RedactSecretJsonInErrorMessageSanitizerTest { @Test - public void noSecrets() throws Exception { + public void noSecrets() { assertRedaction( "{'a': 1, 'b': '2', 'c': {'c1': 1, 'c2': '2', 'c3': ['3a', '3b']}, 'd': ['4a', {'d1': 1, 'd2': '2'}]}", "{'a': 1, 'b': '2', 'c': {'c1': 1, 'c2': '2', 'c3': ['3a', '3b']}, 'd': ['4a', {'d1': 1, 'd2': '2'}]}" @@ -90,7 +90,7 @@ public void redactFullBranch() { } @Test - public void multipleSecretAtSameLevel() throws Exception { + public void multipleSecretAtSameLevel() { assertRedaction( "{'a1': 'secret1', 'a2': 'secret2', 'b': 'other', '$redact': ['a1', 'a2']}", "{'a1': '[value redacted]', 'a2': '[value redacted]', 'b': 'other', '$redact': ['a1', 'a2']}" @@ -106,7 +106,7 @@ public void redactedKeyWithoutCorrespondences() { } @Test - public void secretsAtMultipleLevels() throws Exception { + public void secretsAtMultipleLevels() { assertRedaction( "{'a1': 'secret1', 'a2': 'secret2', 'b': 'other', '$redact': ['a1', 'a2'], 'sub': {'c1': 'secret1', 'c2': 'secret2', 'c3': 'other', '$redact': ['c1', 'c2']}}", "{'a1': '[value redacted]', 'a2': '[value redacted]', 'b': 'other', '$redact': ['a1', 'a2'], 'sub': {'c1': '[value redacted]', 'c2': '[value redacted]', 'c3': 'other', '$redact': ['c1', 'c2']}}" @@ -122,7 +122,7 @@ public void noInteractionBetweenLevels() { } @Test - public void deeplyNestedObject() throws Exception { + public void deeplyNestedObject() { assertRedaction( "{'sub': {'arr': ['d1', 2, {'a1': 'other', 'b1':'other', 'c1': 'secret', '$redact': 'c1'}, 4, {'a2': 'other', 'b2': 'other', 'c2': 'secret', '$redact': 'c2'}]}, '$redact': 'b'}", "{'sub': {'arr': ['d1', 2, {'a1': 'other', 'b1':'other', 'c1': '[value redacted]', '$redact': 'c1'}, 4, {'a2': 'other', 'b2': 'other', 'c2': '[value redacted]', '$redact': 'c2'}]}, '$redact': 'b'}" diff --git a/core/src/test/java/jenkins/security/apitoken/ApiTokenStatsTest.java b/core/src/test/java/jenkins/security/apitoken/ApiTokenStatsTest.java index 7ebbf69111e2..eb2407f1138c 100644 --- a/core/src/test/java/jenkins/security/apitoken/ApiTokenStatsTest.java +++ b/core/src/test/java/jenkins/security/apitoken/ApiTokenStatsTest.java @@ -63,7 +63,7 @@ public class ApiTokenStatsTest { public TemporaryFolder tmp = new TemporaryFolder(); @Before - public void prepareConfig() throws Exception { + public void prepareConfig() { // to separate completely the class under test from its environment ApiTokenPropertyConfiguration mockConfig = Mockito.mock(ApiTokenPropertyConfiguration.class); diff --git a/core/src/test/java/jenkins/security/stapler/StaplerSignaturesTest.java b/core/src/test/java/jenkins/security/stapler/StaplerSignaturesTest.java index 3b304195fe62..3b857fe3481d 100644 --- a/core/src/test/java/jenkins/security/stapler/StaplerSignaturesTest.java +++ b/core/src/test/java/jenkins/security/stapler/StaplerSignaturesTest.java @@ -16,7 +16,7 @@ public class StaplerSignaturesTest { @Test - public void testSignaturesSimple() throws Exception { + public void testSignaturesSimple() { Set methodSignatures = Arrays.stream(SomeClass.class.getMethods()).map(it -> new Function.InstanceFunction(it).getSignature()).collect(Collectors.toSet()); Assert.assertEquals(SomeClass.METHOD_SIGNATURES, methodSignatures); @@ -25,7 +25,7 @@ public void testSignaturesSimple() throws Exception { } @Test - public void testSignaturesInheritance() throws Exception { + public void testSignaturesInheritance() { Set methodSignatures = Arrays.stream(SomeSubclass.class.getMethods()).map(it -> new Function.InstanceFunction(it).getSignature()).collect(Collectors.toSet()); Assert.assertEquals(SomeSubclass.METHOD_SIGNATURES, methodSignatures); diff --git a/core/src/test/java/jenkins/util/TimeDurationTest.java b/core/src/test/java/jenkins/util/TimeDurationTest.java index 047d759fac2e..d8c239fccaca 100644 --- a/core/src/test/java/jenkins/util/TimeDurationTest.java +++ b/core/src/test/java/jenkins/util/TimeDurationTest.java @@ -9,7 +9,7 @@ public class TimeDurationTest { @Test - public void fromString() throws Exception { + public void fromString() { assertEquals(1, TimeDuration.fromString("1").getTimeInMillis()); assertEquals(1000, TimeDuration.fromString("1sec").getTimeInMillis()); diff --git a/core/src/test/java/jenkins/util/VirtualFileTest.java b/core/src/test/java/jenkins/util/VirtualFileTest.java index bc8bfcebdb0a..842ecd0358de 100644 --- a/core/src/test/java/jenkins/util/VirtualFileTest.java +++ b/core/src/test/java/jenkins/util/VirtualFileTest.java @@ -163,11 +163,11 @@ public VirtualFile getParent() { return new Ram(paths, path.replaceFirst("/[^/]+$", "")); } @Override - public boolean isDirectory() throws IOException { + public boolean isDirectory() { return paths.stream().anyMatch(p -> p.startsWith(path + "/")); } @Override - public boolean isFile() throws IOException { + public boolean isFile() { return paths.contains(path); } @Override @@ -175,7 +175,7 @@ public boolean exists() throws IOException { return isFile() || isDirectory(); } @Override - public VirtualFile[] list() throws IOException { + public VirtualFile[] list() { return paths.stream().filter(p -> p.startsWith(path + "/")).map(p -> new Ram(paths, p.replaceFirst("(\\Q" + path + "\\E/[^/]+)/.+", "$1"))).toArray(VirtualFile[]::new); } @Override @@ -183,11 +183,11 @@ public VirtualFile child(String name) { return new Ram(paths, path + "/" + name); } @Override - public long length() throws IOException { + public long length() { return 0; } @Override - public long lastModified() throws IOException { + public long lastModified() { return 0; } @Override @@ -195,7 +195,7 @@ public boolean canRead() throws IOException { return isFile(); } @Override - public InputStream open() throws IOException { + public InputStream open() { return new NullInputStream(0); } } diff --git a/core/src/test/java/jenkins/util/xstream/XStreamDOMTest.java b/core/src/test/java/jenkins/util/xstream/XStreamDOMTest.java index 489fd785f8be..58ecec686ccf 100644 --- a/core/src/test/java/jenkins/util/xstream/XStreamDOMTest.java +++ b/core/src/test/java/jenkins/util/xstream/XStreamDOMTest.java @@ -58,7 +58,7 @@ public static class Foo { } @Before - public void setUp() throws Exception { + public void setUp() { xs = new XStream2(); xs.alias("foo", Foo.class); } diff --git a/core/src/test/java/jenkins/widgets/HistoryPageFilterTest.java b/core/src/test/java/jenkins/widgets/HistoryPageFilterTest.java index b50bd7f93123..d87399f4efcf 100644 --- a/core/src/test/java/jenkins/widgets/HistoryPageFilterTest.java +++ b/core/src/test/java/jenkins/widgets/HistoryPageFilterTest.java @@ -491,7 +491,7 @@ MockBuild withBuildVariables(Map buildVariables) { return this; } - MockBuild withBuildParameters(Map buildParametersAsMap) throws IOException { + MockBuild withBuildParameters(Map buildParametersAsMap) { addAction(new ParametersAction(buildPropertiesMapToParameterValues(buildParametersAsMap), buildParametersAsMap.keySet())); return this; } From 8d39559c773b2cfe332c3e4ab749da3b8f4d5c7c Mon Sep 17 00:00:00 2001 From: Anne-Laure Gaillard <86982045+alauregaillard@users.noreply.github.com> Date: Sat, 16 Oct 2021 18:07:11 +0200 Subject: [PATCH 50/66] Hacktoberfest [JENKINS-66658] fix french translation delete view (#5807) --- core/src/main/resources/hudson/model/View/delete_fr.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/resources/hudson/model/View/delete_fr.properties b/core/src/main/resources/hudson/model/View/delete_fr.properties index ccf5fb6dcb5e..75cacbba26a4 100644 --- a/core/src/main/resources/hudson/model/View/delete_fr.properties +++ b/core/src/main/resources/hudson/model/View/delete_fr.properties @@ -20,5 +20,5 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -Are\ you\ sure\ about\ deleting\ the\ view?=Etes-vous sûr de vouloir supprimer la vue? Yes=Oui +delete.view=Supprimer la vue \u2018{0}\u2019 ? From 3f2d1a2f747d7eeae4f4f6f55432127ffd9e5928 Mon Sep 17 00:00:00 2001 From: Anne-Laure Gaillard <86982045+alauregaillard@users.noreply.github.com> Date: Sat, 16 Oct 2021 18:07:16 +0200 Subject: [PATCH 51/66] Hacktoberfest [JENKINS-66658] Fix translation Number of executors (#5804) --- .../model/Jenkins/MasterComputer/configure_bg.properties | 2 +- .../model/Jenkins/MasterComputer/configure_da.properties | 2 +- .../model/Jenkins/MasterComputer/configure_de.properties | 2 +- .../model/Jenkins/MasterComputer/configure_es.properties | 2 +- .../model/Jenkins/MasterComputer/configure_fi.properties | 2 +- .../model/Jenkins/MasterComputer/configure_fr.properties | 2 +- .../model/Jenkins/MasterComputer/configure_hu.properties | 2 +- .../model/Jenkins/MasterComputer/configure_it.properties | 2 +- .../model/Jenkins/MasterComputer/configure_ja.properties | 2 +- .../model/Jenkins/MasterComputer/configure_lt.properties | 2 +- .../model/Jenkins/MasterComputer/configure_nl.properties | 2 +- .../model/Jenkins/MasterComputer/configure_pt_BR.properties | 2 +- .../model/Jenkins/MasterComputer/configure_ru.properties | 2 +- .../model/Jenkins/MasterComputer/configure_sr.properties | 2 +- .../model/Jenkins/MasterComputer/configure_sv_SE.properties | 2 +- .../model/Jenkins/MasterComputer/configure_tr.properties | 2 +- .../model/Jenkins/MasterComputer/configure_zh_TW.properties | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_bg.properties b/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_bg.properties index 2b04ba83b17e..364c9355aea9 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_bg.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_bg.properties @@ -22,7 +22,7 @@ Node\ Properties=\ \u0421\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043d\u0430 \u043c\u0430\u0448\u0438\u043d\u0430\u0442\u0430 -\#\ of\ executors=\ +Number\ of\ executors=\ \u0411\u0440\u043e\u0439 \u0438\u0437\u043f\u044a\u043b\u043d\u044f\u0432\u0430\u0449\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0438 Description=\ \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 diff --git a/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_da.properties b/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_da.properties index 044345cffa2d..7a96d13c2efc 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_da.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_da.properties @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -\#\ of\ executors=# afviklere +Number\ of\ executors=# afviklere Labels=Etiketter Node\ Properties=Nodeegenskaber Save=Gem diff --git a/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_de.properties b/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_de.properties index 3866fab827af..fdd503186521 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_de.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_de.properties @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -\#\ of\ executors=Anzahl der Build-Prozessoren +Number\ of\ executors=Anzahl der Build-Prozessoren Labels=Labels Node\ Properties=Eigenschaften des Knotens Save=Speichern diff --git a/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_es.properties b/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_es.properties index 2d9d4621161c..43717235d55b 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_es.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_es.properties @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -\#\ of\ executors=N\u00FAmero de ejecutores +Number\ of\ executors=N\u00FAmero de ejecutores Labels=Etiquetas Node\ Properties=Propiedades del nodo Save=Guardar diff --git a/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_fi.properties b/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_fi.properties index 817dbcfb382d..89ddc34e807a 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_fi.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_fi.properties @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -\#\ of\ executors=Suorittaajien lukum\u00E4\u00E4r\u00E4 +Number\ of\ executors=Suorittaajien lukum\u00E4\u00E4r\u00E4 Labels= Node\ Properties= Save=Tallenna diff --git a/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_fr.properties b/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_fr.properties index 818b3e19f580..547830bb37e5 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_fr.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_fr.properties @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -\#\ of\ executors=Nombre d''ex\u00E9cuteurs +Number\ of\ executors=Nombre d''ex\u00E9cuteurs Labels=\u00C9tiquettes Node\ Properties=Propri\u00E9t\u00E9s du N\u0153ud Save=Sauvegarder diff --git a/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_hu.properties b/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_hu.properties index ed3579dc27de..094613a10391 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_hu.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_hu.properties @@ -20,5 +20,5 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -\#\ of\ executors=A v\u00E9grehajt\u00F3k sz\u00E1ma +Number\ of\ executors=A v\u00E9grehajt\u00F3k sz\u00E1ma diff --git a/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_it.properties b/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_it.properties index 2da11de2b309..ba735e37f2a6 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_it.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_it.properties @@ -21,7 +21,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -\#\ of\ executors=Numero di esecutori +Number\ of\ executors=Numero di esecutori Description=Descrizione Labels=Etichette Node\ Properties=Proprietà nodo diff --git a/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_ja.properties b/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_ja.properties index d193c398d7cc..ac93d9a97410 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_ja.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_ja.properties @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -\#\ of\ executors=\u540c\u6642\u5b9f\u884c\u6570 +Number\ of\ executors=\u540c\u6642\u5b9f\u884c\u6570 Labels=\u30E9\u30D9\u30EB Node\ Properties=\u30CE\u30FC\u30C9\u30D7\u30ED\u30D1\u30C6\u30A3 Save=\u4FDD\u5B58 diff --git a/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_lt.properties b/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_lt.properties index 342570a4e1b9..690370c78fb0 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_lt.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_lt.properties @@ -1,4 +1,4 @@ -\#\ of\ executors=# vykdytoj\u0173 +Number\ of\ executors=# vykdytoj\u0173 Labels=Etiket\u0117s Node\ Properties=Mazgo savyb\u0117s Save=\u012era\u0161yti diff --git a/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_nl.properties b/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_nl.properties index d2de775079bc..90cf2220dbe8 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_nl.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_nl.properties @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -\#\ of\ executors=Uitvoerders +Number\ of\ executors=Uitvoerders Labels=Labels Node\ Properties= Save=Bewaar diff --git a/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_pt_BR.properties b/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_pt_BR.properties index 869b1cbec4c0..dbc3b9782bda 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_pt_BR.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_pt_BR.properties @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -\#\ of\ executors=N\u00famero de executores +Number\ of\ executors=N\u00famero de executores Labels=R\u00F3tulos Node\ Properties=Propriedades do n\u00F3 Save=Salvar diff --git a/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_ru.properties b/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_ru.properties index 9b7a6556f57f..42957dd5ac34 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_ru.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_ru.properties @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -\#\ of\ executors=\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432-\u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u0435\u0439 +Number\ of\ executors=\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432-\u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u0435\u0439 Description=\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 Labels=\u041c\u0435\u0442\u043a\u0438 Node\ Properties=\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0443\u0437\u043b\u0430 diff --git a/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_sr.properties b/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_sr.properties index 7329797f439b..7b0da707aee3 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_sr.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_sr.properties @@ -3,5 +3,5 @@ Labels=\u041B\u0430\u0431\u0435\u043B\u0435 Node\ Properties=\u041F\u043E\u0441\u0442\u0430\u0432\u043A\u0435 \u043C\u0430\u0448\u0438\u043D\u0435 Save=\u0421\u0430\u0447\u0443\u0432\u0430\u0458 -\#\ of\ executors=\u0431\u0440\u043E\u0458 \u0438\u0437\u0432\u0440\u0448\u0438\u0442\u0435\u0459\u0430 +Number\ of\ executors=\u0431\u0440\u043E\u0458 \u0438\u0437\u0432\u0440\u0448\u0438\u0442\u0435\u0459\u0430 Description=\u041E\u043F\u0438\u0441 diff --git a/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_sv_SE.properties b/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_sv_SE.properties index eb0ee590c2d6..81237787943b 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_sv_SE.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_sv_SE.properties @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -\#\ of\ executors= +Number\ of\ executors= Labels=Etiketter Node\ Properties=Nodegenskaper Save=Spara diff --git a/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_tr.properties b/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_tr.properties index b9a08b753c9f..e97ee5ba5b08 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_tr.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_tr.properties @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -\#\ of\ executors=Yap\u0131land\u0131rma i\u015flemleri say\u0131s\u0131 +Number\ of\ executors=Yap\u0131land\u0131rma i\u015flemleri say\u0131s\u0131 Labels=Etiketler Node\ Properties= Save=Kaydet diff --git a/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_zh_TW.properties b/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_zh_TW.properties index f69145df6088..b973199719e2 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_zh_TW.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure_zh_TW.properties @@ -21,7 +21,7 @@ # THE SOFTWARE. Description=\u8aaa\u660e -\#\ of\ executors=\u57f7\u884c\u7a0b\u5f0f\u6578 +Number\ of\ executors=\u57f7\u884c\u7a0b\u5f0f\u6578 Labels=\u6a19\u7c64 Node\ Properties=\u7bc0\u9ede\u5c6c\u6027 Save=\u5132\u5b58 From 522b43e4c7807b2853abcb33972a96eb17c2fd40 Mon Sep 17 00:00:00 2001 From: Anne-Laure Gaillard <86982045+alauregaillard@users.noreply.github.com> Date: Sat, 16 Oct 2021 18:07:26 +0200 Subject: [PATCH 52/66] Hacktoberfest [JENKINS-66658] fix french translation People View (#5808) --- .../hudson/model/View/AsynchPeople/index_fr.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/resources/hudson/model/View/AsynchPeople/index_fr.properties b/core/src/main/resources/hudson/model/View/AsynchPeople/index_fr.properties index 3bfc37e8159f..bb620a2dc18e 100644 --- a/core/src/main/resources/hudson/model/View/AsynchPeople/index_fr.properties +++ b/core/src/main/resources/hudson/model/View/AsynchPeople/index_fr.properties @@ -22,8 +22,8 @@ Name=Nom complet All\ People=Tout le monde -Last\ Active=Dernière activité +Last\ Commit\ Activity=Derni\u00e8re activit\u00E9 de commit On=Sur People=Utilisateurs -User\ Id=Identifiant +User\ ID=Identifiant blurb=Inclus tout les utilisateurs connus, ce qui comprend les login que le domaine de s\u00E9curit\u00E9 (security realm) actuel peut \u00E9num\u00E9rer, ainsi que les personnes mentionn\u00E9(e)s dans les message de commit reli\u00E9s au changelogs. From ebd8cb85af904696ff774b5be5714d537091b821 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 16 Oct 2021 20:13:17 +0100 Subject: [PATCH 53/66] Bump checkstyle from 9.0 to 9.0.1 (#5784) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b43503deb953..2bdd6cb2d5f0 100644 --- a/pom.xml +++ b/pom.xml @@ -418,7 +418,7 @@ THE SOFTWARE. com.puppycrawl.tools checkstyle - 9.0 + 9.0.1 From 459ec556b4ffa190d8f42f4f08268db8c0744a04 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 16 Oct 2021 20:18:04 +0100 Subject: [PATCH 54/66] Bump actions/checkout from 2.3.4 to 2.3.5 (#5820) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/changelog.yml | 2 +- .github/workflows/publish-release-artifact.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 92ab774cb032..082238a21eea 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -44,7 +44,7 @@ jobs: private_key: ${{ secrets.JENKINS_CHANGELOG_UPDATER_PRIVATE_KEY }} repository: jenkins-infra/jenkins.io - name: Check out - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v2.3.5 with: fetch-depth: 0 - name: Publish jenkins.io changelog draft diff --git a/.github/workflows/publish-release-artifact.yml b/.github/workflows/publish-release-artifact.yml index ae8d7ffc61f7..dfabf3006b03 100644 --- a/.github/workflows/publish-release-artifact.yml +++ b/.github/workflows/publish-release-artifact.yml @@ -11,7 +11,7 @@ jobs: project-version: ${{ steps.set-version.outputs.project-version }} is-lts: ${{ steps.set-version.outputs.is-lts }} steps: - - uses: actions/checkout@v2.3.4 + - uses: actions/checkout@v2.3.5 - name: Set up JDK 8 uses: actions/setup-java@v2 with: From 5ba0d6970dcfe5ac27faed75fa6147bfc9e566ad Mon Sep 17 00:00:00 2001 From: Ikko Ashimine Date: Mon, 18 Oct 2021 23:33:44 +0900 Subject: [PATCH 55/66] Fix typo in treeview-debug.js alway -> always --- war/src/main/webapp/scripts/yui/treeview/treeview-debug.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/war/src/main/webapp/scripts/yui/treeview/treeview-debug.js b/war/src/main/webapp/scripts/yui/treeview/treeview-debug.js index 9db94aac57d0..6b11785f4dcc 100644 --- a/war/src/main/webapp/scripts/yui/treeview/treeview-debug.js +++ b/war/src/main/webapp/scripts/yui/treeview/treeview-debug.js @@ -1588,7 +1588,7 @@ YAHOO.widget.Node.prototype = { nowrap: false, /** - * If true, the node will alway be rendered as a leaf node. This can be + * If true, the node will always be rendered as a leaf node. This can be * used to override the presentation when dynamically loading the entire * tree. Setting this to true also disables the dynamic load call for the * node. From 77982afc9ad559729a784a097c4fbb0a6a93d441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= <91831478+lemeurherve@users.noreply.github.com> Date: Mon, 18 Oct 2021 17:37:24 +0200 Subject: [PATCH 56/66] fix: use specific 'docker-highmem' instead of the combination of 'docker' and 'highmem' (INFRA-3099) (#5830) So we can ensure only these pipelines with require a docker highmem machine --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 323da6651231..508614244620 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -117,7 +117,7 @@ for(j = 0; j < jdks.size(); j++) { // TODO: Restore ATH once https://groups.google.com/forum/#!topic/jenkinsci-dev/v9d-XosOp2s is resolved // TODO: ATH flow now supports Java 8 only, it needs to be reworked (INFRA-1690) builds.ath = { - node("docker&&highmem") { + node("docker-highmem") { // Just to be safe deleteDir() def fileUri From 9fcfebb0e8e1412d70e5c2f3e5d9b582a0e170f7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Oct 2021 19:50:08 +0000 Subject: [PATCH 57/66] Bump xmlunit.version from 2.8.2 to 2.8.3 (#5833) --- core/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/pom.xml b/core/pom.xml index e1650bb3c681..92fcd2fd8e50 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -41,7 +41,7 @@ THE SOFTWARE. true 2.2 - 2.8.2 + 2.8.3 High From e10233879dd8d294b65309d26c7213b7d6eb55c3 Mon Sep 17 00:00:00 2001 From: Pauline Iogna Date: Tue, 19 Oct 2021 09:05:49 +0200 Subject: [PATCH 58/66] Hacktoberfest add french rename action property file (#5793) Co-authored-by: A. Jard Co-authored-by: Wadeck Follonier Co-authored-by: Pauline Iogna --- .../model/RenameAction/action_fr.properties | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 core/src/main/resources/jenkins/model/RenameAction/action_fr.properties diff --git a/core/src/main/resources/jenkins/model/RenameAction/action_fr.properties b/core/src/main/resources/jenkins/model/RenameAction/action_fr.properties new file mode 100644 index 000000000000..3d5f94d18fa6 --- /dev/null +++ b/core/src/main/resources/jenkins/model/RenameAction/action_fr.properties @@ -0,0 +1,23 @@ +# The MIT License +# +# Copyright © 2021 Pauline Iogna +# +# 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. + +Rename=Renommer From 3301e9254739fba7319c4c3b274d2af13f26906f Mon Sep 17 00:00:00 2001 From: EBIBO Date: Tue, 19 Oct 2021 15:05:58 +0800 Subject: [PATCH 59/66] [JENKINS-66714] Use reworked job logo in build queue (#5832) --- .../jenkins/widgets/HistoryPageFilter/queue-items.jelly | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/resources/jenkins/widgets/HistoryPageFilter/queue-items.jelly b/core/src/main/resources/jenkins/widgets/HistoryPageFilter/queue-items.jelly index be46285a1329..e12d49057457 100644 --- a/core/src/main/resources/jenkins/widgets/HistoryPageFilter/queue-items.jelly +++ b/core/src/main/resources/jenkins/widgets/HistoryPageFilter/queue-items.jelly @@ -38,7 +38,7 @@ THE SOFTWARE.
- +
From 94cf5e213f83668e52fb331e38ad04ae0f1bef0e Mon Sep 17 00:00:00 2001 From: Jenkins Release Bot <66998184+jenkins-release-bot@users.noreply.github.com> Date: Tue, 19 Oct 2021 12:41:02 +0000 Subject: [PATCH 60/66] [maven-release-plugin] prepare release jenkins-2.317 --- bom/pom.xml | 2 +- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bom/pom.xml b/bom/pom.xml index 6f64b8747692..4b1884797d7d 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main jenkins-parent - ${revision}${changelist} + 2.317 jenkins-bom diff --git a/cli/pom.xml b/cli/pom.xml index 3838594a564f..2f5eab108589 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main jenkins-parent - ${revision}${changelist} + 2.317 cli diff --git a/core/pom.xml b/core/pom.xml index 92fcd2fd8e50..f0bbecd41d4c 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main jenkins-parent - ${revision}${changelist} + 2.317 jenkins-core diff --git a/pom.xml b/pom.xml index ecc5f2e30508..71068c180d7f 100644 --- a/pom.xml +++ b/pom.xml @@ -34,7 +34,7 @@ THE SOFTWARE. org.jenkins-ci.main jenkins-parent - ${revision}${changelist} + 2.317 pom Jenkins main module @@ -61,7 +61,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - ${scmTag} + jenkins-2.317 diff --git a/test/pom.xml b/test/pom.xml index 36b24a47cc41..b13bb9754bbe 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main jenkins-parent - ${revision}${changelist} + 2.317 jenkins-test diff --git a/war/pom.xml b/war/pom.xml index 53ec00960c0c..f02dfdb78a31 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main jenkins-parent - ${revision}${changelist} + 2.317 jenkins-war From 71b05927206b78009555698866ac4bdd9d742efe Mon Sep 17 00:00:00 2001 From: Jenkins Release Bot <66998184+jenkins-release-bot@users.noreply.github.com> Date: Tue, 19 Oct 2021 12:41:23 +0000 Subject: [PATCH 61/66] [maven-release-plugin] prepare for next development iteration --- bom/pom.xml | 2 +- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 6 +++--- test/pom.xml | 2 +- war/pom.xml | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bom/pom.xml b/bom/pom.xml index 4b1884797d7d..6f64b8747692 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main jenkins-parent - 2.317 + ${revision}${changelist} jenkins-bom diff --git a/cli/pom.xml b/cli/pom.xml index 2f5eab108589..3838594a564f 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main jenkins-parent - 2.317 + ${revision}${changelist} cli diff --git a/core/pom.xml b/core/pom.xml index f0bbecd41d4c..92fcd2fd8e50 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main jenkins-parent - 2.317 + ${revision}${changelist} jenkins-core diff --git a/pom.xml b/pom.xml index 71068c180d7f..4336e05f5b60 100644 --- a/pom.xml +++ b/pom.xml @@ -34,7 +34,7 @@ THE SOFTWARE. org.jenkins-ci.main jenkins-parent - 2.317 + ${revision}${changelist} pom Jenkins main module @@ -61,7 +61,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - jenkins-2.317 + ${scmTag} @@ -70,7 +70,7 @@ THE SOFTWARE. - 2.317 + 2.318 -SNAPSHOT - - - - + + + +
+ +
-
From 417177d42cee58cd2e360fca35cc010924ecbba2 Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Thu, 21 Oct 2021 19:40:00 +0100 Subject: [PATCH 63/66] Apply suggestions from code review Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com> --- core/src/main/resources/lib/hudson/newFromList/form.jelly | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/resources/lib/hudson/newFromList/form.jelly b/core/src/main/resources/lib/hudson/newFromList/form.jelly index 0709d563ebab..2cd3797eb369 100644 --- a/core/src/main/resources/lib/hudson/newFromList/form.jelly +++ b/core/src/main/resources/lib/hudson/newFromList/form.jelly @@ -92,7 +92,7 @@ THE SOFTWARE.
From 3eb5b6312506f7ed6945f7d9bca90f4fdc8d38b4 Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Thu, 21 Oct 2021 19:40:13 +0100 Subject: [PATCH 64/66] Add page title for New Node page --- core/src/main/resources/hudson/model/ComputerSet/new.jelly | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/resources/hudson/model/ComputerSet/new.jelly b/core/src/main/resources/hudson/model/ComputerSet/new.jelly index f8c7aaa6bea8..9eed3d1eb2c5 100644 --- a/core/src/main/resources/hudson/model/ComputerSet/new.jelly +++ b/core/src/main/resources/hudson/model/ComputerSet/new.jelly @@ -32,7 +32,7 @@ THE SOFTWARE. - + From 33dc0047757e378d2396d8777fc4d09f9b18a689 Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Thu, 21 Oct 2021 19:45:37 +0100 Subject: [PATCH 65/66] Style number inputs too --- core/src/main/resources/lib/form/number.jelly | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/resources/lib/form/number.jelly b/core/src/main/resources/lib/form/number.jelly index ffd5cb092abb..5489fb8ef2b5 100644 --- a/core/src/main/resources/lib/form/number.jelly +++ b/core/src/main/resources/lib/form/number.jelly @@ -96,7 +96,7 @@ THE SOFTWARE. Date: Thu, 21 Oct 2021 19:47:49 +0100 Subject: [PATCH 66/66] Update form.less --- war/src/main/less/modules/form.less | 1 - 1 file changed, 1 deletion(-) diff --git a/war/src/main/less/modules/form.less b/war/src/main/less/modules/form.less index ca0a8a2ad247..0a464d061f03 100644 --- a/war/src/main/less/modules/form.less +++ b/war/src/main/less/modules/form.less @@ -27,7 +27,6 @@ .jenkins-form-description { display: block; - opacity: 0.5; margin-top: 0; margin-bottom: 0.75rem; color: var(--text-color-secondary);