mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[jenkins/prs] report docs changes url in PR comments (#89454)
Co-authored-by: spalger <spalger@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
4380c49d38
commit
3f96892430
1 changed files with 18 additions and 0 deletions
|
@ -182,12 +182,14 @@ def getNextCommentMessage(previousCommentInfo = [:], isFinal = false) {
|
|||
## :green_heart: Build Succeeded
|
||||
* [continuous-integration/kibana-ci/pull-request](${env.BUILD_URL})
|
||||
* Commit: ${getCommitHash()}
|
||||
${getDocsChangesLink()}
|
||||
"""
|
||||
} else if(status == 'UNSTABLE') {
|
||||
def message = """
|
||||
## :yellow_heart: Build succeeded, but was flaky
|
||||
* [continuous-integration/kibana-ci/pull-request](${env.BUILD_URL})
|
||||
* Commit: ${getCommitHash()}
|
||||
${getDocsChangesLink()}
|
||||
""".stripIndent()
|
||||
|
||||
def failures = retryable.getFlakyFailures()
|
||||
|
@ -204,6 +206,7 @@ def getNextCommentMessage(previousCommentInfo = [:], isFinal = false) {
|
|||
* Commit: ${getCommitHash()}
|
||||
* [Pipeline Steps](${env.BUILD_URL}flowGraphTable) (look for red circles / failed steps)
|
||||
* [Interpreting CI Failures](https://www.elastic.co/guide/en/kibana/current/interpreting-ci-failures.html)
|
||||
${getDocsChangesLink()}
|
||||
"""
|
||||
}
|
||||
|
||||
|
@ -292,6 +295,21 @@ def getCommitHash() {
|
|||
return env.ghprbActualCommit
|
||||
}
|
||||
|
||||
def getDocsChangesLink() {
|
||||
def url = "https://kibana_${env.ghprbPullId}.docs-preview.app.elstc.co/diff"
|
||||
|
||||
try {
|
||||
// httpRequest throws on status codes >400 and failures
|
||||
httpRequest([ method: "GET", url: url ])
|
||||
return "* [Documentation Changes](${url})"
|
||||
} catch (ex) {
|
||||
print "Failed to reach ${url}"
|
||||
buildUtils.printStacktrace(ex)
|
||||
}
|
||||
|
||||
return ""
|
||||
}
|
||||
|
||||
def getFailedSteps() {
|
||||
return jenkinsApi.getFailedSteps()?.findAll { step ->
|
||||
step.displayName != 'Check out from version control'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue