-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CI] Add error steps and help links to PR comments (#60772)
- Loading branch information
1 parent
c7b0ade
commit c22dbb1
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
def getSteps() { | ||
def url = "${env.BUILD_URL}api/json?tree=actions[nodes[iconColor,running,displayName,id,parents]]" | ||
def responseRaw = httpRequest([ method: "GET", url: url ]) | ||
def response = toJSON(responseRaw) | ||
|
||
def graphAction = response?.actions?.find { it._class == "org.jenkinsci.plugins.workflow.job.views.FlowGraphAction" } | ||
|
||
return graphAction?.nodes | ||
} | ||
|
||
def getFailedSteps() { | ||
def steps = getSteps() | ||
def failedSteps = steps?.findAll { it.iconColor == "red" && it._class == "org.jenkinsci.plugins.workflow.cps.nodes.StepAtomNode" } | ||
failedSteps.each { step -> | ||
step.logs = "${env.BUILD_URL}execution/node/${step.id}/log".toString() | ||
} | ||
|
||
return failedSteps | ||
} | ||
|
||
return this |