Can someone tell me how I'd find last green build for jenkins 2.277?
After upgrading I found a behavior change where getLastSuccessfulBuild()
returns the same value as getLastUnstableBuild()
Which means, when I promote, I can't trust these functions and need to write something to walk back through builds checking status.
In the scenario below:
last Experiments/exp.Stability #6
last successful Experiments/exp.Stability #6
last unstable Experiments/exp.Stability #6
last failed Experiments/exp.Stability #4
An unstable
build in Jenkins is still considered functional and typically occurs when:
Tests fail, but the build completes successfully.
Static analysis tools like JaCoCo or FindBugs report issues.
If you want to fetch the last stable build, you can use the following API endpoint:
https://JENKINS_DOMAIN/job/JOB_NAME/lastStableBuild/api/json