Skip to content

Commit

Permalink
Do not warn when triggered job is a success (#375)
Browse files Browse the repository at this point in the history
I keep having log messages such as:

  WARNING: [hudson.plugins.parameterizedtrigger.TriggerBuilder perform]
  Attempting to use the result of unfinished build <name of job> #1234

The message was introduced in #161 by 06d8f19 but in #148 / 02ee6ea,
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 <mark.earl.waite@gmail.com>
Co-authored-by: Bruno Verachten <gounthar@gmail.com>
  • Loading branch information
3 people authored May 7, 2024
1 parent e05b39a commit f6fff3e
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Check warning on line 190 in src/main/java/hudson/plugins/parameterizedtrigger/TriggerBuilder.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 190 is only partially covered, one branch is missing
build.setResult(r);
} else {
LOGGER.warning("Attempting to use the result of unfinished build "
+ completedRun.toString());
}
} else {
buildStepResult = false;
Expand Down

0 comments on commit f6fff3e

Please # to comment.