Skip to content

Conversation

@bentsherman
Copy link
Member

@bentsherman bentsherman commented Aug 18, 2023

Close #4200

Adds a helper method to check a config scope for invalid options. Since config options are defined in a dynamic and distributed manner, this approach allows them to be validated in the same way.

Enabled with NXF_ENABLE_STRICT_CONFIG. Use NXF_ENABLE_STRICT to turn the warning into an error.

TODO:

  • docker, singularity, etc
  • executor
  • mail
  • notification
  • wave

Signed-off-by: Ben Sherman <[email protected]>
@netlify
Copy link

netlify bot commented Aug 18, 2023

Deploy Preview for nextflow-docs-staging canceled.

Name Link
🔨 Latest commit d284d1c
🔍 Latest deploy log https://app.netlify.com/sites/nextflow-docs-staging/deploys/65e1723a9d318c0008c26084

Signed-off-by: Ben Sherman <[email protected]>
@pditommaso
Copy link
Member

This is a big work but I don't think it's worth of. The plan is to rely on an alternative configuration mechanism providing a built-in type system

@pditommaso pditommaso closed this Dec 2, 2023
@bentsherman
Copy link
Member Author

Agreed 👍 this PR will be a good reference for the config overhaul

@bentsherman bentsherman changed the title Add strict config mode Config schema Mar 1, 2024
@bentsherman bentsherman reopened this Mar 1, 2024
@bentsherman bentsherman marked this pull request as draft March 1, 2024 05:03
@bentsherman
Copy link
Member Author

Rebooting this PR since we didn't go with the Micronaut config. Instead I am trying a custom annotation approach so that the config schema can be typed.

I got it working for a few config scopes but there are currently two challenges:

  • The @ConfigOption must be declared on a class field or method, but not all config scopes are defined this way. For this I think we just need to define a proper class for each config scope.

  • The plugin system is used to collect all config schema classes, including from plugins. But if the plugin (e.g. nf-amazon) isn't already loaded when the config is validated, the config schemas in that plugin won't be detected. So we may need to load plugins based on config settings (e.g. plugins spec, aws scope, etc) after the config is parsed but before it is validated.

Anyway, just wanted to get a basic prototype working. I think we can address these challenges if we decide to keep and improve the Nextflow config format rather than move to a new one. Micronaut config and picocli should be good sources of inspiration for any bells and whistles we might need.

@pditommaso pditommaso force-pushed the master branch 2 times, most recently from 5a93547 to 27345a6 Compare February 10, 2025 21:46
@bentsherman bentsherman changed the title Config schema Typed config map Feb 22, 2025
@bentsherman bentsherman changed the title Typed config map Config schema Feb 22, 2025
@bentsherman
Copy link
Member Author

Closing in favor of #5816

Some of this code may be useful later if/when we want to unify the ConfigScope classes with existing config classes (CondaConfig, Manifest, etc).

@bentsherman bentsherman deleted the 4200-validate-config-schema branch February 25, 2025 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants