[JENKINS-62815] Traversal doesn't work on parallel pipelines
See original GitHub issueSteps to reproduce
Have a pipeline with at least one parallel section. Try to gather stage duration data.
Expected behavior
Stage duration data should be recorded
Actual behavior
No stage duration data is recorded. (traverseTree(flownodes)
returns []
)
Server configuration
Operating system:
Jenkins Version:
Plugin Version: 2.0.7
Suggested fix:
In this file. Switch from a return False
to a continue
. The same node can be run into twice if a parallel pipeline is uses. If it is encountered, it should be skipped instead of exiting early, but I have not tested this.
https://github.com/jenkinsci/prometheus-plugin/blob/9a473b0b14ebe5167ef58d8316eb3a2712d5289e/src/main/java/org/jenkinsci/plugins/prometheus/util/FlowNodes.java#L102-L107
for (final FlowNode next : parents) {
if (visited.contains(getNodeId(next))) {
continue;
}
queue.add(next);
}
Notify
~P.S. I’m unable to open a jira at the moment because of the issues with accounts on jenkins.io~ Jira issue is JENKINS-62815
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top GitHub Comments
@nigelarmstrong-bc @markyjackson-taulia, could we contribute with a PR to fix the
node
vscurrent
bug? It seems a straightforward fix for the bug.Actually, there is another bug, should be
current
instead ofnode
https://github.com/jenkinsci/prometheus-plugin/blob/9a473b0b14ebe5167ef58d8316eb3a2712d5289e/src/main/java/org/jenkinsci/plugins/prometheus/util/FlowNodes.java#L98