If stageOrBranchName is present, we skip processing errors. This is on the assumption that if stageOrBranchName is present it is a stage or branch. However, normal steps like sh can have labels too and was returned as the stageOrBranchName. This causes labeled steps to not have their errors processed.
We fix this by returning empty in getStageOrBranchName if the node is not a BlockStartNode.
I've tested this on a private Jenkins instance. As far as I can tell, it works as expected. This has no pre-existing tests and I'm honestly not sure how to write them.
Submitter checklist
[X] Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
[X] Ensure that the pull request title represents the desired changelog entry
[X] Please describe what you did
[X] Link to relevant issues in GitHub or Jira
[ ] Link to relevant pull requests, esp. upstream and downstream changes
[ ] Ensure you have provided tests - that demonstrates feature works or fixes the issue
If
stageOrBranchName
is present, we skip processing errors. This is on the assumption that ifstageOrBranchName
is present it is a stage or branch. However, normal steps likesh
can have labels too and was returned as thestageOrBranchName
. This causes labeled steps to not have their errors processed.We fix this by returning empty in
getStageOrBranchName
if the node is not aBlockStartNode
.This fixes https://github.com/jenkinsci/checks-api-plugin/issues/252
Testing done
I've tested this on a private Jenkins instance. As far as I can tell, it works as expected. This has no pre-existing tests and I'm honestly not sure how to write them.
Submitter checklist