From 6d1aae7e8bb0bacde9c54d759c68d277a21305e0 Mon Sep 17 00:00:00 2001 From: David Brougham Date: Fri, 4 Jun 2021 08:31:25 +1200 Subject: [PATCH] fix(notification): Add application to githubStatus notification context --- .../echo/notification/GithubNotificationAgent.java | 6 ++++-- .../echo/notification/GithubNotificationAgentSpec.groovy | 4 ++-- gradle.properties | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/echo-notifications/src/main/groovy/com/netflix/spinnaker/echo/notification/GithubNotificationAgent.java b/echo-notifications/src/main/groovy/com/netflix/spinnaker/echo/notification/GithubNotificationAgent.java index 7f0ebfd9d..52b7071f8 100644 --- a/echo-notifications/src/main/groovy/com/netflix/spinnaker/echo/notification/GithubNotificationAgent.java +++ b/echo-notifications/src/main/groovy/com/netflix/spinnaker/echo/notification/GithubNotificationAgent.java @@ -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", @@ -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", diff --git a/echo-notifications/src/test/groovy/com/netflix/spinnaker/echo/notification/GithubNotificationAgentSpec.groovy b/echo-notifications/src/test/groovy/com/netflix/spinnaker/echo/notification/GithubNotificationAgentSpec.groovy index 5ddf199b0..ae5e6e61b 100644 --- a/echo-notifications/src/test/groovy/com/netflix/spinnaker/echo/notification/GithubNotificationAgentSpec.groovy +++ b/echo-notifications/src/test/groovy/com/netflix/spinnaker/echo/notification/GithubNotificationAgentSpec.groovy @@ -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 @@ -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 diff --git a/gradle.properties b/gradle.properties index 6defa9af2..357a3c860 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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