From 620e7751dcdf0b494153632860507bfd94c044df Mon Sep 17 00:00:00 2001 From: Devin Nusbaum Date: Thu, 24 Aug 2023 06:48:37 -0400 Subject: [PATCH 1/5] [JENKINS-71479] Do not use SCSS lighten function directly to avoid invalid CSS (#8425) --- war/src/main/scss/abstracts/_theme.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/war/src/main/scss/abstracts/_theme.scss b/war/src/main/scss/abstracts/_theme.scss index abc5fd3cb928..2ea8f434481d 100644 --- a/war/src/main/scss/abstracts/_theme.scss +++ b/war/src/main/scss/abstracts/_theme.scss @@ -116,8 +116,8 @@ $semantics: ( // Deprecated - Button primary --button-color--primary: var(--background); --btn-primary-bg: #063f61; - --btn-primary-bg-hover: lighten(#063f61, 7.5%); - --btn-primary-bg-active: lighten(#063f61, 12%); + --btn-primary-bg-hover: #{lighten(#063f61, 7.5%)}; + --btn-primary-bg-active: #{lighten(#063f61, 12%)}; // Deprecated - Button primary --btn-secondary-color: var(--secondary); --btn-secondary-bg: var(--btn-text-color); From 45edec6335bffaee071e723ead9e8b14c41c512d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 24 Aug 2023 08:19:55 -0700 Subject: [PATCH 2/5] Bump org.jenkins-ci.plugins:script-security from 1271.vdede89739a_81 to 1273.v66c1964f0dfd (#8424) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- test/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/pom.xml b/test/pom.xml index 5faa39fff2b0..75035b367d83 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -101,7 +101,7 @@ THE SOFTWARE. org.jenkins-ci.plugins script-security - 1271.vdede89739a_81 + 1273.v66c1964f0dfd From 0bd2e4a528adecdf894e8977cc578bb8e1307c0f Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Fri, 25 Aug 2023 03:27:02 -0700 Subject: [PATCH 3/5] `CauseTest#deeplyNestedCauses` is also flaky (#8430) --- .../src/test/java/hudson/model/CauseTest.java | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/test/src/test/java/hudson/model/CauseTest.java b/test/src/test/java/hudson/model/CauseTest.java index 4f4fba4e8121..0d4caf54f61b 100644 --- a/test/src/test/java/hudson/model/CauseTest.java +++ b/test/src/test/java/hudson/model/CauseTest.java @@ -61,10 +61,11 @@ public class CauseTest { @Test public void deeplyNestedCauses() throws Exception { FreeStyleProject a = j.createFreeStyleProject("a"); FreeStyleProject b = j.createFreeStyleProject("b"); - Run early = null; - Run last = null; + FreeStyleBuild early = null; + FreeStyleBuild last = null; + List> futures = new ArrayList<>(); for (int i = 1; i <= 15; i++) { - last = b.scheduleBuild2(0, new Cause.UpstreamCause((Run) a.scheduleBuild2(0, last == null ? null : new Cause.UpstreamCause(last)).get())).get(); + last = recordFuture(b.scheduleBuild2(0, new Cause.UpstreamCause(recordFuture(a.scheduleBuild2(0, last == null ? null : new Cause.UpstreamCause(last)), futures).get())), futures).get(); if (i == 5) { early = last; } @@ -73,6 +74,9 @@ public class CauseTest { assertTrue("keeps full history:\n" + buildXml, buildXml.contains("1")); buildXml = new XmlFile(Run.XSTREAM, new File(last.getRootDir(), "build.xml")).asString(); assertFalse("too big:\n" + buildXml, buildXml.contains("1")); + for (QueueTaskFuture future : futures) { + j.assertBuildStatusSuccess(j.waitForCompletion(future.waitForStart())); + } } @Issue("JENKINS-15747") @@ -84,17 +88,14 @@ public class CauseTest { Run last = null; for (int i = 1; i <= 10; i++) { Cause cause = last == null ? null : new Cause.UpstreamCause(last); - QueueTaskFuture next1 = a.scheduleBuild2(0, cause); - futures.add(next1); - futures.add(a.scheduleBuild2(0, cause)); + QueueTaskFuture next1 = recordFuture(a.scheduleBuild2(0, cause), futures); + recordFuture(a.scheduleBuild2(0, cause), futures); cause = new Cause.UpstreamCause(next1.get()); - QueueTaskFuture next2 = b.scheduleBuild2(0, cause); - futures.add(next2); - futures.add(b.scheduleBuild2(0, cause)); + QueueTaskFuture next2 = recordFuture(b.scheduleBuild2(0, cause), futures); + recordFuture(b.scheduleBuild2(0, cause), futures); cause = new Cause.UpstreamCause(next2.get()); - QueueTaskFuture next3 = c.scheduleBuild2(0, cause); - futures.add(next3); - futures.add(c.scheduleBuild2(0, cause)); + QueueTaskFuture next3 = recordFuture(c.scheduleBuild2(0, cause), futures); + recordFuture(c.scheduleBuild2(0, cause), futures); last = next3.get(); } int count = new XmlFile(Run.XSTREAM, new File(last.getRootDir(), "build.xml")).asString().split(Pattern.quote(" recordFuture(QueueTaskFuture future, List> futures) { + futures.add(future); + return future; + } @Issue("JENKINS-48467") @Test public void userIdCausePrintTest() throws Exception { From d6c8daaa9a645ab44e9d79f32e5d4e6a08fc67a4 Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Fri, 25 Aug 2023 03:27:38 -0700 Subject: [PATCH 4/5] `MaintainCanTakeStrengtheningTest` is flaky (#8429) --- .../MaintainCanTakeStrengtheningTest.java | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/test/src/test/java/hudson/model/queue/MaintainCanTakeStrengtheningTest.java b/test/src/test/java/hudson/model/queue/MaintainCanTakeStrengtheningTest.java index a9c64db9756e..c9deee7aac73 100644 --- a/test/src/test/java/hudson/model/queue/MaintainCanTakeStrengtheningTest.java +++ b/test/src/test/java/hudson/model/queue/MaintainCanTakeStrengtheningTest.java @@ -4,13 +4,13 @@ import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasItem; +import hudson.model.FreeStyleBuild; import hudson.model.FreeStyleProject; import hudson.model.Label; import hudson.model.Node; import hudson.model.Queue; import hudson.slaves.DumbSlave; import hudson.slaves.NodeProperty; -import java.util.concurrent.TimeUnit; import java.util.logging.Level; import org.junit.Rule; import org.junit.Test; @@ -26,7 +26,7 @@ public class MaintainCanTakeStrengtheningTest { @Rule public LoggerRule logging = new LoggerRule().record(Node.class.getName(), Level.ALL).capture(100); - private QueueTaskFuture scheduleBuild(String name, String label) throws Exception { + private QueueTaskFuture scheduleBuild(String name, String label) throws Exception { FreeStyleProject project = r.createFreeStyleProject(name); project.setAssignedLabel(Label.get(label)); @@ -44,15 +44,9 @@ public void testExceptionOnNodeProperty() throws Exception { r.createOnlineSlave(Label.get("good")); // Only the good ones will be run and the latest doesn't get hung because of the second - QueueTaskFuture[] taskFuture = new QueueTaskFuture[3]; - taskFuture[0] = scheduleBuild("good1", "good"); - taskFuture[1] = scheduleBuild("theFaultyOne", "faulty"); - taskFuture[2] = scheduleBuild("good2", "good"); - - // Wait for a while until the good ones start, no need to wait for their completion to guarantee - // the fix works - taskFuture[0].getStartCondition().get(15, TimeUnit.SECONDS); - taskFuture[2].getStartCondition().get(15, TimeUnit.SECONDS); + FreeStyleBuild good1 = scheduleBuild("good1", "good").waitForStart(); + scheduleBuild("theFaultyOne", "faulty"); + FreeStyleBuild good2 = scheduleBuild("good2", "good").waitForStart(); // The faulty one is the only one in the queue assertThat(r.getInstance().getQueue().getBuildableItems().size(), equalTo(1)); @@ -60,6 +54,10 @@ public void testExceptionOnNodeProperty() throws Exception { // The new error is shown in the logs assertThat(logging.getMessages(), hasItem(String.format("Exception evaluating if the node '%s' can take the task '%s'", faultyAgent.getDisplayName(), "theFaultyOne"))); + + // Tear down + r.assertBuildStatusSuccess(r.waitForCompletion(good1)); + r.assertBuildStatusSuccess(r.waitForCompletion(good2)); } /** From 262e65cdff08f96ad214b840ba7b7b5e585c17d9 Mon Sep 17 00:00:00 2001 From: Daniel Beck <1831569+daniel-beck@users.noreply.github.com> Date: Fri, 25 Aug 2023 15:19:48 +0200 Subject: [PATCH 5/5] Fix PCT problem of #8250 (#8426) Co-authored-by: Daniel Beck --- core/src/main/java/jenkins/ErrorAttributeFilter.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/src/main/java/jenkins/ErrorAttributeFilter.java b/core/src/main/java/jenkins/ErrorAttributeFilter.java index 9163e409f61d..be67bdab7588 100644 --- a/core/src/main/java/jenkins/ErrorAttributeFilter.java +++ b/core/src/main/java/jenkins/ErrorAttributeFilter.java @@ -3,6 +3,7 @@ import java.io.IOException; import javax.servlet.Filter; import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; @@ -27,4 +28,14 @@ public void doFilter(ServletRequest servletRequest, ServletResponse servletRespo servletRequest.setAttribute(USER_ATTRIBUTE, authentication); filterChain.doFilter(servletRequest, servletResponse); } + + @Override + public void destroy() { + // Otherwise the PCT fails + } + + @Override + public void init(FilterConfig filterConfig) throws ServletException { + // Otherwise the PCT fails + } }