jenkinsci / jenkinsci/workflow-basic-steps-plugin

[JENKINS-28119] Link to log of failed step

Open
#391 32 comments 0 reactions 0 assignees View on GitHub
component:workflow-basic-steps-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
73
Forks
129
PR merge metrics
No merged PRs in 30d

Description

When a flow involves many steps, long logs, and/or many branches, it can be hard for a developer receiving a failure email (for example) to quickly see what part of the build actually failed and why. I think it would be useful for the catchError step to do a DFS search on the Throwable and its cause chain through the FlowNode graph starting at the end of the catch step, looking for ErrorAction, and setting/appending an environment variable with the URL of the LogAction. Or provide a new step to do the same. Thus you could write

def runStuff(param) {

...
}
try {
parallel a: {runStuff 'a'}, b: {runStuff 'b'}
} catch (e) {
mail to: '...', subject: 'Failure!', body: "Build failed: ${errorUrl(e)}"
}

and get a link to http://jenkins/job/myflow/123/flowGraph/77/console or the like, according to the actual step in one of the branches that threw the error.

---
Originally reported by jglick, imported from: Link to log of failed step


  • assignee: jglick
  • status: In Progress
  • priority: Major
  • component(s): workflow-basic-steps-plugin
  • label(s): stalled-pr
  • resolution: Unresolved
  • votes: 52
  • watchers: 68
  • imported: 20251215-220547

Raw content of original issue

When a flow involves many steps, long logs, and/or many branches, it can be hard for a developer receiving a failure email (for example) to quickly see what part of the build actually failed and why. I think it would be useful for the catchError step to do a DFS search on the Throwable and its cause chain through the FlowNode graph starting at the end of the catch step, looking for ErrorAction, and setting/appending an environment variable with the URL of the LogAction. Or provide a new step to do the same. Thus you could write


def runStuff(param) {

...
}
try {
parallel a: {runStuff 'a'}, b: {runStuff 'b'}
} catch (e) {
mail to: '...', subject: 'Failure!', body: "Build failed: ${errorUrl(e)}"
}

and get a link to http://jenkins/job/myflow/123/flowGraph/77/console or the like, according to the actual step in one of the branches that threw the error.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.