From f6fff3e28c3e110ceddad3120f5f0073d44e68b4 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Tue, 7 May 2024 16:31:54 +0200 Subject: [PATCH] Do not warn when triggered job is a success (#375) I keep having log messages such as: WARNING: [hudson.plugins.parameterizedtrigger.TriggerBuilder perform] Attempting to use the result of unfinished build #1234 The message was introduced in #161 by 06d8f19218 but in #148 / 02ee6ea5, mapBuildResult() was made to return `null` by default (eg on SUCCESS). The resut is the warning is always triggered when the triggered build succeeds. Fixes https://phabricator.wikimedia.org/T336782 Co-authored-by: Mark Waite Co-authored-by: Bruno Verachten --- .../hudson/plugins/parameterizedtrigger/TriggerBuilder.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/java/hudson/plugins/parameterizedtrigger/TriggerBuilder.java b/src/main/java/hudson/plugins/parameterizedtrigger/TriggerBuilder.java index 528ccce9..83b4dfc8 100644 --- a/src/main/java/hudson/plugins/parameterizedtrigger/TriggerBuilder.java +++ b/src/main/java/hudson/plugins/parameterizedtrigger/TriggerBuilder.java @@ -187,11 +187,8 @@ public boolean perform(AbstractBuild build, Launcher launcher, BuildListen if (buildStepResult && config.getBlock().mapBuildStepResult(completedRun.getResult())) { Result r = config.getBlock().mapBuildResult(completedRun.getResult()); - if (r != null) { + if (r != null) { // The blocking job is not a success build.setResult(r); - } else { - LOGGER.warning("Attempting to use the result of unfinished build " - + completedRun.toString()); } } else { buildStepResult = false;