From 0d00fef49fb65b822dd1683980b7652745a82af7 Mon Sep 17 00:00:00 2001 From: Morgan Taylor Date: Mon, 9 Dec 2024 14:42:24 -0500 Subject: [PATCH 1/3] TSPS-140 Add Teaspoons notification types --- build.sbt | 6 +-- .../notification/NotificationMonitor.scala | 54 +++++++++++++++++++ 2 files changed, 57 insertions(+), 3 deletions(-) diff --git a/build.sbt b/build.sbt index 444fc586..c24bfbc2 100644 --- a/build.sbt +++ b/build.sbt @@ -14,9 +14,9 @@ val slickV = "3.5.2" val scalaTestV = "3.2.19" -val workbenchLibsHash = "9254729" -val workbenchGoogleV = s"0.32-$workbenchLibsHash" -val workbenchNotificationsV = s"0.7-$workbenchLibsHash" +val workbenchLibsHash = "80b39af" +val workbenchGoogleV = s"0.33-$workbenchLibsHash" +val workbenchNotificationsV = s"0.8-$workbenchLibsHash" resolvers ++= Seq( "Broad Artifactory Releases" at "https://broadinstitute.jfrog.io/broadinstitute/libs-release/", diff --git a/src/main/scala/thurloe/notification/NotificationMonitor.scala b/src/main/scala/thurloe/notification/NotificationMonitor.scala index 2609a88c..9c8d1354 100644 --- a/src/main/scala/thurloe/notification/NotificationMonitor.scala +++ b/src/main/scala/thurloe/notification/NotificationMonitor.scala @@ -449,6 +449,60 @@ class NotificationMonitorActor(val pollInterval: FiniteDuration, ), Map.empty, Map.empty + ) + + case TeaspoonsJobSucceededNotification(recipientUserId, + pipelineDisplayName, + jobId, + timeSubmitted, + timeCompleted, + quotaConsumedByJob, + quotaRemaining, + userDescription) => + thurloe.service.Notification( + Option(recipientUserId), + None, + None, + templateId, + Map( + "pipelineDisplayName" -> pipelineDisplayName, + "jobId" -> jobId, + "timeSubmitted" -> timeSubmitted, + "timeCompleted" -> timeCompleted, + "quotaConsumedByJob" -> quotaConsumedByJob, + "quotaRemaining" -> quotaRemaining, + "userDescription" -> userDescription + ), + Map.empty, + Map.empty + ) + + case TeaspoonsJobFailedNotification(recipientUserId, + pipelineDisplayName, + jobId, + errorMessage, + timeSubmitted, + timeCompleted, + quotaConsumedByJob, + quotaRemaining, + userDescription) => + thurloe.service.Notification( + Option(recipientUserId), + None, + None, + templateId, + Map( + "pipelineDisplayName" -> pipelineDisplayName, + "jobId" -> jobId, + "errorMessage" -> errorMessage, + "timeSubmitted" -> timeSubmitted, + "timeCompleted" -> timeCompleted, + "quotaConsumedByJob" -> quotaConsumedByJob, + "quotaRemaining" -> quotaRemaining, + "userDescription" -> userDescription + ), + Map.empty, + Map.empty ); } } From e774e4b20a566ba688291f11d537b1282de0650e Mon Sep 17 00:00:00 2001 From: Morgan Taylor Date: Mon, 9 Dec 2024 14:51:55 -0500 Subject: [PATCH 2/3] scalafmt --- .../scala/thurloe/notification/NotificationMonitor.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/scala/thurloe/notification/NotificationMonitor.scala b/src/main/scala/thurloe/notification/NotificationMonitor.scala index 9c8d1354..f4cb1d4c 100644 --- a/src/main/scala/thurloe/notification/NotificationMonitor.scala +++ b/src/main/scala/thurloe/notification/NotificationMonitor.scala @@ -458,7 +458,8 @@ class NotificationMonitorActor(val pollInterval: FiniteDuration, timeCompleted, quotaConsumedByJob, quotaRemaining, - userDescription) => + userDescription + ) => thurloe.service.Notification( Option(recipientUserId), None, @@ -485,7 +486,8 @@ class NotificationMonitorActor(val pollInterval: FiniteDuration, timeCompleted, quotaConsumedByJob, quotaRemaining, - userDescription) => + userDescription + ) => thurloe.service.Notification( Option(recipientUserId), None, From bc0dd89426e02ac0ec953ff3512093ce9cdde0bb Mon Sep 17 00:00:00 2001 From: Morgan Taylor Date: Tue, 10 Dec 2024 15:06:53 -0500 Subject: [PATCH 3/3] update workbench-libs version --- build.sbt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index c24bfbc2..c7623b57 100644 --- a/build.sbt +++ b/build.sbt @@ -14,9 +14,9 @@ val slickV = "3.5.2" val scalaTestV = "3.2.19" -val workbenchLibsHash = "80b39af" +val workbenchLibsHash = "5d9c477" val workbenchGoogleV = s"0.33-$workbenchLibsHash" -val workbenchNotificationsV = s"0.8-$workbenchLibsHash" +val workbenchNotificationsV = s"0.9-$workbenchLibsHash" resolvers ++= Seq( "Broad Artifactory Releases" at "https://broadinstitute.jfrog.io/broadinstitute/libs-release/",