From b5bb08cec97454c03620b0fe97f52753df9c754d Mon Sep 17 00:00:00 2001 From: Ben Sherman Date: Mon, 13 Apr 2026 12:17:52 -0500 Subject: [PATCH] Exclude params from resolved config text Signed-off-by: Ben Sherman --- .../nextflow/config/ConfigBuilder.groovy | 2 ++ .../nextflow/config/ConfigBuilderTest.groovy | 33 ++++++++++--------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/modules/nextflow/src/main/groovy/nextflow/config/ConfigBuilder.groovy b/modules/nextflow/src/main/groovy/nextflow/config/ConfigBuilder.groovy index 8bae62923f..af6af61d0b 100644 --- a/modules/nextflow/src/main/groovy/nextflow/config/ConfigBuilder.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/config/ConfigBuilder.groovy @@ -932,6 +932,8 @@ class ConfigBuilder { .setBaseDir(baseDir) .buildConfigObject() + // strip params + config.remove('params') // strip secrets SecretHelper.hideSecrets(config) // compute config diff --git a/modules/nextflow/src/test/groovy/nextflow/config/ConfigBuilderTest.groovy b/modules/nextflow/src/test/groovy/nextflow/config/ConfigBuilderTest.groovy index 64de44bad8..e73b6db78f 100644 --- a/modules/nextflow/src/test/groovy/nextflow/config/ConfigBuilderTest.groovy +++ b/modules/nextflow/src/test/groovy/nextflow/config/ConfigBuilderTest.groovy @@ -2352,17 +2352,18 @@ class ConfigBuilderTest extends Specification { def 'should return parsed config' () { given: - def cmd = new CmdRun(profile: 'first', withTower: 'http://foo.com', launcher: new Launcher()) - def base = Files.createTempDirectory('test') - base.resolve('nextflow.config').text = ''' + def folder = Files.createTempDirectory('test') + def configFile = folder.resolve('nextflow.config') + configFile.text = ''' profiles { first { params { - foo = 'Hello world' - awsKey = 'xyz' + foo = 'Hello world' + awsKey = 'xyz' } process { - executor = { 'local' } + executor = 'local' + cpus = { 4 } } } second { @@ -2370,17 +2371,17 @@ class ConfigBuilderTest extends Specification { } } ''' + and: + def launcher = new Launcher(options: new CliOptions(config: [configFile.toFile().canonicalPath])) + def cmd = new CmdRun(profile: 'first', withTower: 'http://foo.com', launcher: launcher) + when: - def txt = ConfigBuilder.resolveConfig(base, cmd) + def result = ConfigBuilder.resolveConfig(folder, cmd) then: - txt == '''\ - params { - foo = 'Hello world' - awsKey = '[secret]' - } - + result == '''\ process { - executor = { 'local' } + executor = 'local' + cpus = { 4 } } outputFormat = 'text' @@ -2393,7 +2394,7 @@ class ConfigBuilderTest extends Specification { '''.stripIndent() cleanup: - base?.deleteDir() + folder?.deleteDir() } def 'should merge profiles with conditions' () { @@ -2428,7 +2429,7 @@ class ConfigBuilderTest extends Specification { ext.args = '--quiet' } } - params{ + params { another = true } '''