Skip to content
This repository was archived by the owner on Oct 28, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions resources/slack-markdown.template
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<% changes = changeSet?.find { true }%>
<% steps = stepsErrors?.findAll{it?.result == "FAILURE" && !it?.displayName?.contains('Notifies GitHub') && !it?.displayName?.contains('Archive JUnit')}%>
<% artifactsUrl = String.format("<%sartifacts|here>", jobUrl)%>
<% commitUrl = String.format("<%s|%s>", changes?.url, changes?.msg)%>
<% commitUrl = String.format("<%s|%s>", changes?.issues?.first()?.url, changes?.msg)%>
<% pipelineUrl = String.format("<%spipeline|#%s>", jobUrl, build?.id ?: 'build')%>
<% testsUrl = String.format("<%stests|here>", jobUrl)%>
<% changesMessage = (changes?.url && changes?.msg) ? "${commitUrl} (by `${changes?.author?.id}`)" : "No push event to branch ${build?.pipeline}" %>
<% changesMessage = (changes?.msg) ? "${commitUrl} (by `${changes?.author?.id}`)" : "No push event to branch ${build?.pipeline}" %>
<% stepsMessage = (steps?.size()!= 0) ? "*Steps failures*: `${steps?.size()}` (click ${artifactsUrl} and open `build.md` for further details)" : ""%>
<% if (header?.trim()) {%>${header}<%}%>
*Build*: `${jenkinsText}` ${pipelineUrl} for branch `${build?.pipeline}` got the status `${buildStatus}`
Expand Down
2 changes: 2 additions & 0 deletions src/test/groovy/NotificationManagerStepTests.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,8 @@ class NotificationManagerStepTests extends ApmBasePipelineTest {
printCallStack()
assertTrue(assertMethodCallContainsPattern('slackSend', 'ABORTED'))
assertTrue(assertMethodCallContainsPattern('slackSend', 'Steps failures'))
assertTrue(assertMethodCallContainsPattern('slackSend', 'https://github.com/org/acme/issues/1234|indicator type url is in upper case (#1234)'))
assertTrue(assertMethodCallContainsPattern('slackSend', 'by `Lola.Flores`'))
assertJobStatusSuccess()
}

Expand Down
97 changes: 23 additions & 74 deletions src/test/resources/changeSet-info.json
Original file line number Diff line number Diff line change
@@ -1,76 +1,25 @@
[{
"_class": "io.jenkins.blueocean.service.embedded.rest.ChangeSetResource",
"_links": {
"self": {
"_class": "io.jenkins.blueocean.rest.hal.Link",
"href": "/blue/rest/organizations/jenkins/pipelines/apm-server/pipelines/apm-server-mbp/branches/master/runs/198/changeSet/8a2fd55f40dbcb279911e3f2237312baf1508019/"
}
},
"affectedPaths": ["changelogs/7.0.asciidoc"],
"author": {
"_class": "io.jenkins.blueocean.service.embedded.rest.UserImpl",
"_links": {
"favorites": {
"_class": "io.jenkins.blueocean.rest.hal.Link",
"href": "/blue/rest/users/someone/favorites/"
},
"self": {
"_class": "io.jenkins.blueocean.rest.hal.Link",
"href": "/blue/rest/users/someone/"
}
[
{
"affectedPaths": [
"pipeline.yml"
],
"author": {
"avatar": null,
"email": null,
"fullName": "Lola Flores",
"id": "Lola.Flores",
"permission": null
},
"avatar": null,
"email": "someone@example.com",
"fullName": "Jhon Doe",
"id": "someone",
"permission": null
},
"checkoutCount": 0,
"commitId": "8a2fd55f40dbcb279911e3f2237312baf1508019",
"issues": [{
"_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubIssue",
"id": "#2207",
"url": "https://github.com/elastic/apm-server/issues/2207"
}],
"msg": "fix 7.x changelog links (#2207)",
"timestamp": "2019-05-23T16:37:37.000+0000",
"url": "https://github.com/elastic/apm-server/commit/8a2fd55f40dbcb279911e3f2237312baf1508019"
},
{
"_class": "io.jenkins.blueocean.service.embedded.rest.ChangeSetResource",
"_links": {
"self": {
"_class": "io.jenkins.blueocean.rest.hal.Link",
"href": "/blue/rest/organizations/jenkins/pipelines/apm-server/pipelines/apm-server-mbp/branches/master/runs/198/changeSet/8a2fd55f40dbcb279911e3f2237312baf1508019/"
}
},
"affectedPaths": ["changelogs/7.0.asciidoc"],
"author": {
"_class": "io.jenkins.blueocean.service.embedded.rest.UserImpl",
"_links": {
"favorites": {
"_class": "io.jenkins.blueocean.rest.hal.Link",
"href": "/blue/rest/users/someone/favorites/"
},
"self": {
"_class": "io.jenkins.blueocean.rest.hal.Link",
"href": "/blue/rest/users/someone/"
"checkoutCount": 0,
"commitId": "abcdefg",
"issues": [
{
"_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubIssue",
"id": "#1234",
"url": "https://github.com/org/acme/issues/1234"
}
},
"avatar": null,
"email": "someone@example.com",
"fullName": "Jhon Doe",
"id": "someone",
"permission": null
},
"checkoutCount": 0,
"commitId": "8a2fd55f40dbcb279911e3f2237312baf1508019",
"issues": [{
"_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubIssue",
"id": "#2207",
"url": "https://github.com/elastic/apm-server/issues/2207"
}],
"msg": "fix 7.x changelog links (#2207)",
"timestamp": "2019-05-23T16:37:37.000+0000",
"url": "https://github.com/elastic/apm-server/commit/8a2fd55f40dbcb279911e3f2237312baf1508019"
}]
],
"msg": "indicator type url is in upper case (#1234)",
"timestamp": "2021-02-22T10:23:51.000+0000"
}
]