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 add13f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 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

0 comments on commit add13f6

Please sign in to comment.