-
Bug
-
Resolution: Not A Defect
-
Minor
-
None
-
Jenkins 2.492.2
My jenkins instance has a shared library relying on Run.getPreviousBuildInProgress()
I discovered a strange thing: it seems that Run.getPreviousBuildInProgress() is lost.
Example of a groovy script revealing the issue:
import hudson.model.*
def rootItem = jenkins.model.Jenkins.instance.getItem("my_job")run = rootItem.getLastBuild()
while (run != null) {
if (run.isBuilding()) println("${run.getNumber()}, ${run.isBuilding()}, ${run.previousBuildInProgress}")
run = run.getPreviousBuild()
}
println("====================================================")
run = rootItem.getLastBuild()
while (run != null) {
println("${run.getNumber()}, ${run.isBuilding()}, ${run.previousBuildInProgress}")
run = run.getPreviousBuildInProgress()
}
The output of the 2 loops of this script should be normally identical.
It's not:
28175, true, my_job #28174
28174, true, my_job #28173
28173, true, my_job #28135
28135, true, my_job #28127
28127, true, my_job #28126
28126, true, my_job #28125
28125, true, my_job #28124
28124, true, null
28105, true, my_job #28096
28096, true, my_job #28088
28088, true, my_job #28076
28076, true, my_job #28044
28044, true, my_job #28002
28002, true, my_job #27980
27980, true, my_job #27979
27979, true, my_job #27962
27962, true, my_job #27877
27877, true, null
27799, true, my_job #27796
27796, true, my_job #27795
27795, true, my_job #27794
27794, true, my_job #27793
27793, true, null
27677, true, my_job #27676
27676, true, my_job #27641
27641, true, null
27301, true, null
====================================================
28177, false, my_job #28175
28175, true, my_job #28174
28174, true, my_job #28173
28173, true, my_job #28135
28135, true, my_job #28127
28127, true, my_job #28126
28126, true, my_job #28125
28125, true, my_job #28124
28124, true, null
Has anybody already seen something like that ?
Is it possible that a plugin, like simple-queue-plugin, can have an impact on this method ?