From 0d00fef49fb65b822dd1683980b7652745a82af7 Mon Sep 17 00:00:00 2001 From: Morgan Taylor Date: Mon, 9 Dec 2024 14:42:24 -0500 Subject: [PATCH] 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 ); } }