diff --git a/CHANGELOG.md b/CHANGELOG.md index 0084c05171b..3bc4448e4e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,6 +65,14 @@ For more information, see the [Cromwell 79 release notes](https://github.com/bro * Cromwell now attempts to translate `disks` attributes [written for GCP](https://cromwell.readthedocs.io/en/stable/RuntimeAttributes/#disks) into valid `disk` attributes for TES. For information on supported conversions, refer to the [TES documentation](https://cromwell.readthedocs.io/en/stable/backends/TES/). +### `/describe` endpoint support for `workflowDependencies` + +Previously it was not possible to describe a `workflowSource` that required `workflowDependencies` as the `/describe` +endpoint did not allow specifying the additional zip file. + +Now the endpoint will allow the user to upload the `workflowDependencies` zip file, will validate the top level +workflow plus the dependencies, then return the appropriate response including the defined workflow inputs and outputs. + ### Bug Fixes * Reference disks are only mounted if configured in the workflow options. diff --git a/CromIAM/src/main/resources/swagger/cromiam.yaml b/CromIAM/src/main/resources/swagger/cromiam.yaml index c6bf57fa609..8db42bbb567 100644 --- a/CromIAM/src/main/resources/swagger/cromiam.yaml +++ b/CromIAM/src/main/resources/swagger/cromiam.yaml @@ -838,6 +838,11 @@ paths: required: false type: file in: formData + - name: workflowDependencies + description: ZIP file containing workflow source files that are used to resolve local imports. This zip bundle will be unpacked in a sandbox accessible to this workflow. + required: false + type: file + in: formData - $ref: '#/parameters/workflowTypeParam' - $ref: '#/parameters/workflowTypeVersionParam' responses: diff --git a/centaur/src/main/scala/centaur/test/Test.scala b/centaur/src/main/scala/centaur/test/Test.scala index d0a56a2cbf5..a211ce91342 100644 --- a/centaur/src/main/scala/centaur/test/Test.scala +++ b/centaur/src/main/scala/centaur/test/Test.scala @@ -228,8 +228,7 @@ object Operations extends StrictLogging { override def run: IO[Unit] = { - // We can't describe workflows based on zipped imports, so don't try: - if (workflow.skipDescribeEndpointValidation || workflow.data.zippedImports.nonEmpty) { + if (workflow.skipDescribeEndpointValidation) { IO.pure(()) } else { checkDescriptionInner(0) diff --git a/centaur/src/main/scala/centaur/test/workflow/Workflow.scala b/centaur/src/main/scala/centaur/test/workflow/Workflow.scala index 743924bb9c6..5fec22cce57 100644 --- a/centaur/src/main/scala/centaur/test/workflow/Workflow.scala +++ b/centaur/src/main/scala/centaur/test/workflow/Workflow.scala @@ -43,7 +43,8 @@ final case class Workflow private(testName: String, workflowUrl = data.workflowUrl, workflowType = data.workflowType, workflowTypeVersion = data.workflowTypeVersion, - inputsJson = data.inputs.map(_.unsafeRunSync()) + inputsJson = data.inputs.map(_.unsafeRunSync()), + zippedImports = data.zippedImports, ) def secondRun: Workflow = { diff --git a/cromwellApiClient/src/main/scala/cromwell/api/CromwellClient.scala b/cromwellApiClient/src/main/scala/cromwell/api/CromwellClient.scala index b2a088e681b..52dc2efef45 100644 --- a/cromwellApiClient/src/main/scala/cromwell/api/CromwellClient.scala +++ b/cromwellApiClient/src/main/scala/cromwell/api/CromwellClient.scala @@ -261,7 +261,13 @@ object CromwellClient { Multipart.FormData.BodyPart(name, HttpEntity(MediaTypes.`application/json`, ByteString(source))) } - val multipartFormData = Multipart.FormData(sourceBodyParts.toSeq : _*) + val zipBodyParts = Map( + "workflowDependencies" -> describeRequest.zippedImports + ) collect { + case (name, Some(file)) => Multipart.FormData.BodyPart.fromPath(name, MediaTypes.`application/zip`, file.path) + } + + val multipartFormData = Multipart.FormData((sourceBodyParts ++ zipBodyParts).toSeq : _*) multipartFormData.toEntity() } diff --git a/cromwellApiClient/src/main/scala/cromwell/api/model/WorkflowDescribeRequest.scala b/cromwellApiClient/src/main/scala/cromwell/api/model/WorkflowDescribeRequest.scala index 9ab7ea45ec4..5fd77bdf2a4 100644 --- a/cromwellApiClient/src/main/scala/cromwell/api/model/WorkflowDescribeRequest.scala +++ b/cromwellApiClient/src/main/scala/cromwell/api/model/WorkflowDescribeRequest.scala @@ -1,7 +1,11 @@ package cromwell.api.model +import better.files.File + final case class WorkflowDescribeRequest(workflowSource: Option[String], workflowUrl: Option[String], workflowType: Option[String], workflowTypeVersion: Option[String], - inputsJson: Option[String]) + inputsJson: Option[String], + zippedImports: Option[File], + ) diff --git a/docs/api/RESTAPI.md b/docs/api/RESTAPI.md index 7a0585ca08e..4f221cd06a7 100644 --- a/docs/api/RESTAPI.md +++ b/docs/api/RESTAPI.md @@ -1,5 +1,5 @@