Steps to reproduce
- Create a new multi-branch pipeline using https://github.com/i386/hellonode
- Go to the branches screen
- Trigger a new build for master
- Open the run and click stop
- Then click replay again
The goal here is to try starting, stopping then replaying really quickly. You will get a 500 error back from the replay action PUT http://localhost:8080/jenkins/blue/rest/organizations/jenkins/pipelines/hellonode/branches/master/runs/23/replay/ 500 (Server Error)
Unknown macro: { "message" }
I attached a debugger when reproducing and got org.jenkinsci.plugins.workflow.cps.replay.ReplayAction#run2 returning null. Digging deeper it appears we can't get the flow owner
private @CheckForNull CpsFlowExecution getExecution() {
FlowExecutionOwner owner = ((FlowExecutionOwner.Executable) run).asFlowExecutionOwner();
if (owner == null) {
return null;
}
FlowExecution exec = owner.getOrNull();
return exec instanceof CpsFlowExecution ? (CpsFlowExecution) exec : null;
}
I suspect this is a bug in workflow? |