Skip to content

Commit

Permalink
fix(notification): Add application to githubStatus notification context
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrougham committed Jun 10, 2021
1 parent a448d68 commit 6d1aae7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ public void sendNotifications(
String.format(
"Stage '%s' in pipeline '%s' is %s",
content.getStageName(), content.getPipeline(), status);
context = String.format("stage/%s", content.getStageName());
context =
String.format(
"%s/%s/stage/%s", application, content.getPipeline(), content.getStageName());
targetUrl =
String.format(
"%s/#/applications/%s/executions/details/%s?pipeline=%s&stage=%d",
Expand All @@ -91,7 +93,7 @@ public void sendNotifications(
content.getStageIndex());
} else if (config.get("type").equals("pipeline")) {
description = String.format("Pipeline '%s' is %s", content.getPipeline(), status);
context = String.format("pipeline/%s", content.getPipeline());
context = String.format("%s/pipeline/%s", application, content.getPipeline());
targetUrl =
String.format(
"%s/#/applications/%s/executions/details/%s?pipeline=%s",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class GithubNotificationAgentSpec extends Specification {
then:
actualMessage.get().getDescription() ==~ expectedDescription
actualMessage.get().getTarget_url() == "http://spinnaker.io/#/applications/whatever/executions/details/1?pipeline=foo-pipeline"
actualMessage.get().getContext() ==~ "pipeline/foo-pipeline"
actualMessage.get().getContext() ==~ "whatever/pipeline/foo-pipeline"

where:
status || expectedDescription
Expand Down Expand Up @@ -109,7 +109,7 @@ class GithubNotificationAgentSpec extends Specification {
then:
actualMessage.get().getDescription() == expectedDescription
actualMessage.get().getTarget_url() == "http://spinnaker.io/#/applications/whatever/executions/details/1?pipeline=foo-pipeline&stage=1"
actualMessage.get().getContext() == "stage/second stage"
actualMessage.get().getContext() == "whatever/foo-pipeline/stage/second stage"

where:
status || expectedDescription
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
fiatVersion=1.27.0
korkVersion=7.109.0
korkVersion=7.110.0
kotlinVersion=1.4.0
org.gradle.parallel=true
spinnakerGradleVersion=8.11.0
Expand Down

0 comments on commit 6d1aae7

Please sign in to comment.