nextflow-io / nextflow

A DSL for data-driven computational pipelines
http://nextflow.io
Apache License 2.0
2.61k stars 606 forks source link

Fix the invocation of function with gstring #5020

Closed pditommaso closed 1 month ago

pditommaso commented 1 month ago

This fixes the invocation of a module function having a String type in the signature and GString value as argument.

netlify[bot] commented 1 month ago

Deploy Preview for nextflow-docs-staging canceled.

Name Link
Latest commit 8c697f7962d6b13f7c0734c27095d8afcff8dcf4
Latest deploy log https://app.netlify.com/sites/nextflow-docs-staging/deploys/664e06e995d57d000808b7b9
bentsherman commented 1 month ago

I think we can solve this in a much simpler way: https://github.com/nextflow-io/nextflow/blob/e2e608140cdde1da39df4c911f56286015538228/modules/nextflow/src/main/groovy/nextflow/config/ConfigBuilder.groovy#L835

This logic which was removed by #4840:

        else if( config instanceof GString ) {
            final holdSecrets = config.values.any { it instanceof SecretHolder }
            return holdSecrets ? config : config.toString()
        }

So let's just add it back without the secrets part:

        else if( config instanceof GString ) {
            return config.toString()
        }
pditommaso commented 1 month ago

The problem is not specific to config file. That's an inconsistency in the logic for function invocation on nextflow modules

bentsherman commented 1 month ago

Never mind, I just confirmed that it happens regardless of the config setting. Let's go with the more general solution