-
Notifications
You must be signed in to change notification settings - Fork 667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validate config schema #5816
base: master
Are you sure you want to change the base?
Validate config schema #5816
Conversation
Signed-off-by: Ben Sherman <[email protected]>
✅ Deploy Preview for nextflow-docs-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Signed-off-by: Ben Sherman <[email protected]>
Looking deeper into the failing unit test: params.foo = 'baz'
profiles {
test {
params.foo = 'foo'
profiles {
debug {
cleanup = false
}
}
}
} the test expects the following resolved config: params.foo = 'baz'
profiles {
test {
params.foo = 'foo'
}
debug {
cleanup = false
}
} in other words, the nested However, while it works with $ nextflow run hello -profile debug
N E X T F L O W ~ version 25.01.0-edge
Unknown configuration profile: 'debug' I think this is an artifact of the The v2 config parser doesn't support nested profiles, so it just warns about a spurious config option: $ NXF_SYNTAX_PARSER=v2 ./build/releases/nextflow-25.01.0-edge-dist config -a
WARN: Unrecognized config option 'profiles.debug.cleanup'
params.foo = 'baz'
profiles {
test {
params.foo = 'foo'
profiles {
debug {
cleanup = false
}
}
}
} |
Signed-off-by: Ben Sherman <[email protected]>
Signed-off-by: Ben Sherman <[email protected]>
Signed-off-by: Ben Sherman <[email protected]>
foo = 'bar' | ||
outputDir = 'results' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to pick some valid config option here. Alternatively we could leave the invalid options and include the warnings for them in the expected stdout
Redo of #4201
This PR uses the config scope classes (in the new compiler module) to validate the config at runtime, for the
config
andrun
commands.Validation occurs after plugins are loaded, and the validator uses the plugin system to collect all implementations of the
ConfigScope
interface, so plugins can use this interface to declare their config options to Nextflow.I suggest we merge this in an upcoming release and advise plugin developers to implement this interface before 25.04, to make the transition to next stable as smooth as possible.
This work is also a prerequisite to recognizing third-party plugin config in VS Code.