Skip to content

Move shared Platform code to separate modules#6719

Draft
jorgee wants to merge 2 commits intomasterfrom
nf-298-platform-modules
Draft

Move shared Platform code to separate modules#6719
jorgee wants to merge 2 commits intomasterfrom
nf-298-platform-modules

Conversation

@jorgee
Copy link
Contributor

@jorgee jorgee commented Jan 13, 2026

This pull request introduces modularization improvements to the Nextflow project and decouples some classes based on the usage of Nexflow classes in Platform

Enhancements

  • Decouple AssetManager and ConfigBuilder from cli package:
    • Define interfaces ConfigNodeOption, ConfigRunOptions and ConfigCliOptions to access the required options from ConfigBuilder without requiring the rest of cli classes
    • Same for HubOptions, it is now an interface at scm package and implement in cli as CliHubOptions
  • Remove NF class dependency from ConfigBuilder
    • DSL parser version can be moved to Const as it is just a Environment Variable inspection.
    • ConfigBuilder includes a strict flag to indicate when to use strict mode when merging maps.
  • Remove HistoryFile dependency from ConfigBuilder
    • Move normalizeResumeId to CmdRun. It is only used when the cmdRun field is set. Use ConfigRunOptions interface to get the normalized resume id value.
  • Move the classes to the new modules based on the functionality, we propose to create 3 new modules:
    • nf-secrets: contains the current secret package in the nextflow module and nextflow.util.SecretHelper class. Depends on nf-commons
    • nf-config: contains the current config package in the nextflow module and the nextflow.util.ConfigHelper class. Depends on nf-secrets and nf-commons
    • nf-scm: contains the current scm package in the nextflow module and the nextflow.script.ScriptFile class. Depends on nf-config and nf-commons
  • Move classes to nf-commons:
    • Some exceptions, nexflow.executor.BashTemplate and nextflow.util.MustacheTemplateEngine: used by Platform
    • nextflow.ast.NextflowXForm: required by config parsers
    • nextflow.parser.v2.ErrorListener: required by ConfigParserV2

Signed-off-by: jorgee <jorge.ejarque@seqera.io>
@netlify
Copy link

netlify bot commented Jan 13, 2026

Deploy Preview for nextflow-docs-staging canceled.

Name Link
🔨 Latest commit eb202ac
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/69674a7ad9fa930008a2410c

@jorgee jorgee changed the title Nextflow modularization imporvement for platform integration Improve Nextflow modularization for better platform integration Jan 13, 2026
@pditommaso pditommaso changed the title Improve Nextflow modularization for better platform integration Improve Nextflow modularization Jan 13, 2026
@bentsherman bentsherman changed the title Improve Nextflow modularization Move shared Platform code to separate modules Jan 13, 2026
@bentsherman
Copy link
Member

Thanks @jorgee for looking into this. Let's focus on your codebase analysis for now, as we need to agree on a plan first

I suspect if we finalize #5971 and make a few judgement calls, we can make this work with fewer changes. But I need to study your analysis first.

Once we agree on a plan, we can add it here as an ADR.

Signed-off-by: jorgee <jorge.ejarque@seqera.io>
Copy link
Member

@pditommaso pditommaso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart the previous comment, massive PR, well done!

// create the config
final config = new ConfigBuilder()
.setOptions(getLauncher().getOptions())
.setCliOptions(getLauncher().getOptions())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please avoid all not strictly required changes. We can make this kind of refactor in a followup pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants