ros-infrastructure / ros_buildfarm

ROS buildfarm based on Docker
Apache License 2.0
81 stars 96 forks source link

Update the groovy-extract-warnings script. #887

Closed clalancette closed 3 years ago

clalancette commented 3 years ago

It may be the case that no previous step set a build status. If that is the case, calling getResult().isBetterThan() will throw an exception since 'null' has no method isBetterThan().

The fix as implemented here is to check if a status has already been set. If it hasn't, set the status to 'SUCCESS', so that the following line can check against this state.

Signed-off-by: Chris Lalancette clalancette@openrobotics.org

An alternative solution here would be to change the conditional line to:

if (build.getResult().equals(null) or build.getResult().isBetterThan(Result.UNSTABLE)) {