-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CI] Add error steps and help links to PR comments #60772
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
1e7088b
Add failed steps to PR comment for failed builds
brianseeders 144262f
Add some test errors
brianseeders 9c21f71
Forgot to fail the build
brianseeders 8096d08
Different test errors
brianseeders 14c21b0
Filter out scm checkout errors since they fail all the time
brianseeders 20cd78e
Don't fail the build if grabbing failed steps fails
brianseeders dcf6649
Remove test code
brianseeders f51f811
Merge branch 'master' into pr-add-ci-help
elasticmachine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Creating URLs with proper tools looks like this:
and actually produces incorrectly-formatted URLs, e.g.
https://kibana-ci.elastic.co/job/elastic+kibana+pipeline-pull-request/34782//api/json?tree=actions%5Bnodes%5BiconColor%2Crunning%2CdisplayName%2Cid%2Cparents%5D%5D
(notice the double
//
)