Skip to content

Fix params inclusion across modules in v2 parser#6766

Merged
bentsherman merged 2 commits intomasterfrom
fix-v2-parser-include-params
Jan 29, 2026
Merged

Fix params inclusion across modules in v2 parser#6766
bentsherman merged 2 commits intomasterfrom
fix-v2-parser-include-params

Conversation

@bentsherman
Copy link
Member

Close #6762

This PR fixes a bug where params defined before an include were not passed to the included module.

Even though this pattern is now discouraged, it is still technically supported until we disallow params outside the entry workflow entirely.

The problem was that the v2 parser was not preserving the order of script declarations, so param assignments were always placed after includes in the generated Groovy code. The sorting code was taken from ScriptFormattingVisitor, which also has to preserve the original declaration order.

Signed-off-by: Ben Sherman <bentshermann@gmail.com>
@netlify
Copy link

netlify bot commented Jan 27, 2026

Deploy Preview for nextflow-docs-staging canceled.

Name Link
🔨 Latest commit ffa31e0
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/697babf494379b0008766b47

@bentsherman bentsherman merged commit 3223ffe into master Jan 29, 2026
24 checks passed
@bentsherman bentsherman deleted the fix-v2-parser-include-params branch January 29, 2026 19:43
pditommaso added a commit that referenced this pull request Feb 9, 2026
cgoina pushed a commit to cgoina/nextflow that referenced this pull request Feb 10, 2026
bentsherman added a commit that referenced this pull request Feb 10, 2026
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
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.

v2 parser: params defined in including script not visible in module

2 participants