diff --git a/CHANGELOG.md b/CHANGELOG.md index d186c1b..36c915d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [[0.4.0](https://github.com/seqeralabs/nf-aggregate/releases/tag/0.4.0)] - 2024-07-26 + +### Credits + +Special thanks to the following for their contributions to the release: + +- [Friederike Hanssen](https://github.com/FriederikeHanssen) + +Thank you to everyone else that has contributed by reporting bugs, enhancements or in any other way, shape or form. + +### Enhancements & fixes + +[PR #52](https://github.com/seqeralabs/nf-aggregate/pull/52) - Organise results folder structure by pipeline +[PR #53](https://github.com/seqeralabs/nf-aggregate/pull/53) - Throw exception and terminate workflow in case config can't be read +[PR #57](https://github.com/seqeralabs/nf-aggregate/pull/57) - Check if fusion is enabled via the Platform API + ## [[0.3.0](https://github.com/seqeralabs/nf-aggregate/releases/tag/0.3.0)] - 2024-07-01 ### Credits diff --git a/modules/local/seqera_runs_dump/functions.nf b/modules/local/seqera_runs_dump/functions.nf index 038cb7c..3a71b62 100644 --- a/modules/local/seqera_runs_dump/functions.nf +++ b/modules/local/seqera_runs_dump/functions.nf @@ -1,6 +1,8 @@ @Grab('com.github.groovy-wslite:groovy-wslite:1.1.2;transitive=false') import wslite.rest.RESTClient import groovy.json.JsonSlurper +import nextflow.exception.ProcessException +import groovy.json.JsonBuilder // Set system properties for custom Java trustStore def setTrustStore(trustStorePath, trustStorePassword) { @@ -47,9 +49,11 @@ Map getRunMetadata(meta, log, api_endpoint, trustStorePath, trustStorePassword) if (workspaceId) { def workflowResponse = client.get(path: "/workflow/${runId}", query: ["workspaceId":workspaceId], headers: authHeader) if (workflowResponse.statusCode == 200) { - metaMap = workflowResponse?.json?.workflow?.subMap("runName", "workDir", "projectName") - config = new ConfigSlurper().parse( workflowResponse?.json?.workflow?.configText ) - metaMap.fusion = config.fusion.enabled + def metaMap = workflowResponse?.json?.workflow?.subMap("runName", "workDir", "projectName") + def configText = new JsonBuilder(workflowResponse?.json?.workflow?.configText) + def pattern = /fusion\s*\{\\n\s*enabled\s*=\s*true/ + def matcher = configText.toPrettyString() =~ pattern + metaMap.fusion = matcher.find() return metaMap ?: [:] } @@ -60,12 +64,15 @@ Map getRunMetadata(meta, log, api_endpoint, trustStorePath, trustStorePassword) ↳ Status code ${ex.response?.statusCode} returned from request to ${ex.request?.url} (authentication headers excluded) """.stripIndent() log.error "Exception: ${ex.message}", ex + throw new ProcessException("Failed to get workflow details for workflow ${runId} in workspace ${meta.workspace}", ex) } catch (Exception ex) { log.warn """ An error occurred while getting workflow details for workflow ${runId} in workspace ${meta.workspace}: ↳ ${ex.message} """.stripIndent() log.error "Exception: ${ex.message}", ex + throw new ProcessException("Failed to get workflow details for workflow ${runId} in workspace ${meta.workspace}", ex) + } return [:] } diff --git a/modules/local/seqera_runs_dump/tests/main.nf.test.snap b/modules/local/seqera_runs_dump/tests/main.nf.test.snap index c55f5c2..442fb9b 100644 --- a/modules/local/seqera_runs_dump/tests/main.nf.test.snap +++ b/modules/local/seqera_runs_dump/tests/main.nf.test.snap @@ -2,7 +2,7 @@ "Should run without failures": { "content": [ [ - "service-info.json:md5,108f149aafa287bb56d715c0c7ee0359", + "service-info.json:md5,72586e82ad2064d1a90008c7956d80d8", "workflow-load.json:md5,4f02d5a24ab89aa648cd4346785c8f2c", "workflow-metadata.json:md5,b37b4faeddf283a2c44cbe4000e4ab6e", "workflow-metrics.json:md5,13a5b5d7447fad4a8baa053d1abf85e5", @@ -13,8 +13,8 @@ ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.2" }, - "timestamp": "2024-05-20T15:32:40.565622058" + "timestamp": "2024-07-25T10:21:06.447483" } } \ No newline at end of file diff --git a/nextflow.config b/nextflow.config index 5178fbb..c61c3bf 100644 --- a/nextflow.config +++ b/nextflow.config @@ -222,6 +222,6 @@ manifest { mainScript = 'main.nf' nextflowVersion = '!>=23.10.0' defaultBranch = 'main' - version = '0.3.0' + version = '0.4.0' doi = '' } diff --git a/workflows/nf_aggregate/main.nf b/workflows/nf_aggregate/main.nf index c30f3c3..0296708 100644 --- a/workflows/nf_aggregate/main.nf +++ b/workflows/nf_aggregate/main.nf @@ -21,7 +21,7 @@ workflow NF_AGGREGATE { skip_multiqc // val: Skip MultiQC java_truststore_path // val: Path to java truststore if using private certs java_truststore_password // val: Password for java truststore if using private certs - + main: ch_versions = Channel.empty() @@ -30,6 +30,7 @@ workflow NF_AGGREGATE { // // MODULE: Fetch run information via the Seqera CLI // + SEQERA_RUNS_DUMP ( ids, seqera_api_endpoint,