Skip to content
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

Fix for nested params with the same name #2485

Merged
merged 2 commits into from
Dec 8, 2021

Conversation

jacarey
Copy link
Contributor

@jacarey jacarey commented Dec 7, 2021

This fixes #1982, #2166, #2247 and #2358

The first three issues were caused by a lack of cloning which allowed mutability of values where they should have been immutable.

The last issue required a deep merge vs a putAll to avoid overwriting multiple values at the same level when you are overriding them on the command line.

@jacarey jacarey force-pushed the fix-nested-params branch 5 times, most recently from ce82477 to 7d39b2a Compare December 7, 2021 17:47
…th the same names at different levels of nesting.

Create a deepMerge for command line params to avoid deleting values at the same level on override.

Signed-off-by: jay Carey <jay@fulcrumgenomics.com>
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.

Awesome patch, this was really tricky!

Find attached a patch to fix also a failing test, plus one more test to check the dotted notation of the same snippet

patch.txt

Signed-off-by: jay Carey <jay@fulcrumgenomics.com>
@jacarey jacarey requested a review from pditommaso December 8, 2021 19:43
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.

Awesome, thanks

@pditommaso
Copy link
Member

pditommaso commented Dec 22, 2021

Released along with version 21.12.1-edge

phue pushed a commit to phue/nextflow that referenced this pull request Jan 25, 2022
- Clone `scope` if found for current key to avoid overwriting params with the same names at different levels of nesting.
- Create a deepMerge for command line params to avoid deleting values at the same level on override.

Signed-off-by: jay Carey <jay@fulcrumgenomics.com>
@pditommaso pditommaso added this to the 22.04.0 milestone Feb 7, 2022
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.

Nested params in different scopes overwrite each other
3 participants