diff --git a/automation/project/Dependencies.scala b/automation/project/Dependencies.scala index 4d57fd58a..616192e1d 100644 --- a/automation/project/Dependencies.scala +++ b/automation/project/Dependencies.scala @@ -34,7 +34,7 @@ object Dependencies { val rootDependencies: Seq[ModuleID] = Seq( "com.fasterxml.jackson.module" %% "jackson-module-scala" % jacksonV, "net.virtual-void" %% "json-lenses" % "0.6.2" % "test", - "ch.qos.logback" % "logback-classic" % "1.4.9", + "ch.qos.logback" % "logback-classic" % "1.4.11", "com.typesafe.akka" %% "akka-http-core" % akkaHttpV, "com.typesafe.akka" %% "akka-stream-testkit" % akkaV, "com.typesafe.akka" %% "akka-http" % akkaHttpV, diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 1e07a7e2a..9cb741783 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -39,7 +39,7 @@ object Dependencies { // elasticsearch requires log4j, but we redirect log4j to logback "org.apache.logging.log4j" % "log4j-to-slf4j" % "2.20.0", - "ch.qos.logback" % "logback-classic" % "1.4.9", + "ch.qos.logback" % "logback-classic" % "1.4.11", "com.getsentry.raven" % "raven-logback" % "8.0.3", // TODO: this should be io.sentry / sentry-logback instead "com.typesafe.scala-logging" %% "scala-logging" % "3.9.5", @@ -79,8 +79,8 @@ object Dependencies { exclude("org.apache.logging.log4j", "log4j-core"), - excludeGuava("com.google.apis" % "google-api-services-pubsub" % "v1-rev20230529-2.0.0"), - excludeGuava("com.google.apis" % "google-api-services-admin-directory" % "directory_v1-rev20230516-2.0.0"), + excludeGuava("com.google.apis" % "google-api-services-pubsub" % "v1-rev20230801-2.0.0"), + excludeGuava("com.google.apis" % "google-api-services-admin-directory" % "directory_v1-rev20230802-2.0.0"), "com.github.jwt-scala" %% "jwt-core" % "9.4.3", diff --git a/src/main/scala/org/broadinstitute/dsde/firecloud/service/TSVFileSupport.scala b/src/main/scala/org/broadinstitute/dsde/firecloud/service/TSVFileSupport.scala index 3ea881d88..09cbc2c01 100644 --- a/src/main/scala/org/broadinstitute/dsde/firecloud/service/TSVFileSupport.scala +++ b/src/main/scala/org/broadinstitute/dsde/firecloud/service/TSVFileSupport.scala @@ -126,7 +126,7 @@ trait TSVFileSupport { if (value.equals("__DELETE__")) RemoveAttribute(AttributeName.fromDelimitedName(name)) else { - AddUpdateAttribute(AttributeName.fromDelimitedName(name), AttributeString(StringContext.processEscapes(value))) + AddUpdateAttribute(AttributeName.fromDelimitedName(name), checkForJson(StringContext.processEscapes(value))) } } } @@ -165,12 +165,18 @@ trait TSVFileSupport { case Success(ref) => ref case Failure(_) => AttributeString(value) } - } } } } + def checkForJson(value: String): Attribute = { + Try(value.parseJson) match { + case Success(_: JsObject) => AttributeValueRawJson(value) + case _ => AttributeString(value) + } + } + def matchesLiteral(value: String): Boolean = { value.toLowerCase().endsWith("d") || value.toLowerCase().endsWith("f") } diff --git a/src/test/scala/org/broadinstitute/dsde/firecloud/mock/MockTSV.scala b/src/test/scala/org/broadinstitute/dsde/firecloud/mock/MockTSV.scala index 33f0908a4..7a213e01a 100644 --- a/src/test/scala/org/broadinstitute/dsde/firecloud/mock/MockTSV.scala +++ b/src/test/scala/org/broadinstitute/dsde/firecloud/mock/MockTSV.scala @@ -3,7 +3,6 @@ package org.broadinstitute.dsde.firecloud.mock import akka.http.scaladsl.model.Multipart import akka.http.scaladsl.model.Multipart.FormData.BodyPart import org.broadinstitute.dsde.firecloud.utils.TSVLoadFile - object MockTSVStrings { /* @@ -309,7 +308,7 @@ object MockTSVLoadFiles { Seq("foo", "bar", "baz"), Seq(Seq("woop", "", "doo"))) - val validWorkspaceAttributes = TSVLoadFile("workspace", Seq("a1", "a2", "a3"), Seq(Seq("v1", "2", "[1,2,3]"))) + val validWorkspaceAttributes = TSVLoadFile("workspace", Seq("a1", "a2", "a3", "a4"), Seq(Seq("v1", "2", "[1,2,3]","""{"tables":{"sample":{"save":["participant",false,"sample",true]}}}"""))) val validOneWorkspaceAttribute = TSVLoadFile("workspace", Seq("a1"), Seq(Seq("v1"))) val validEmptyStrWSAttribute = TSVLoadFile("workspace", Seq("a1"), Seq(Seq(""))) val validRemoveWSAttribute = TSVLoadFile("workspace", Seq("a1"), Seq(Seq("__DELETE__"))) diff --git a/src/test/scala/org/broadinstitute/dsde/firecloud/service/TSVFileSupportSpec.scala b/src/test/scala/org/broadinstitute/dsde/firecloud/service/TSVFileSupportSpec.scala index 880776f89..b7d5bde10 100644 --- a/src/test/scala/org/broadinstitute/dsde/firecloud/service/TSVFileSupportSpec.scala +++ b/src/test/scala/org/broadinstitute/dsde/firecloud/service/TSVFileSupportSpec.scala @@ -24,7 +24,9 @@ class TSVFileSupportSpec extends AnyFreeSpec with TSVFileSupport { assertResult(attributes) { List(AddUpdateAttribute(AttributeName("default", "a1"), AttributeString("v1")), AddUpdateAttribute(AttributeName("default", "a2"), AttributeString("2")), - AddUpdateAttribute(AttributeName("default", "a3"), AttributeString("[1,2,3]"))) + AddUpdateAttribute(AttributeName("default", "a3"), AttributeString("[1,2,3]")), + AddUpdateAttribute(AttributeName("default", "a4"), AttributeValueRawJson("""{"tables":{"sample":{"save":["participant",false,"sample",true]}}}""") + )) } }