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 CLI params normalization #5661

Merged
merged 1 commit into from
Jan 17, 2025
Merged

Fix CLI params normalization #5661

merged 1 commit into from
Jan 17, 2025

Conversation

bentsherman
Copy link
Member

Close #5655

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

netlify bot commented Jan 9, 2025

Deploy Preview for nextflow-docs-staging canceled.

Name Link
🔨 Latest commit 57f7e58
🔍 Latest deploy log https://app.netlify.com/sites/nextflow-docs-staging/deploys/677ff1ec197bf00008b12c3f

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.

There should be a test that validates the solution

@bentsherman
Copy link
Member Author

I have updated the tests accordingly

@pditommaso
Copy link
Member

Not following much, the issue says

I would expect to see this output (according to https://github.com/nextflow-io/nextflow/pull/4702):

[thingOne:newval]
newval
But instead I see this:

[thing-one:newval, thingOne:nothing]
nothing

I would expect, the test to validate the correct behaviour, instead only add quotes to some numeric values

@bentsherman
Copy link
Member Author

Check again, it also changed addParam0 to addParam in order to test the full behavior

@pditommaso
Copy link
Member

Continue to not understand how the test validates the fix for the defect reported.

@bentsherman
Copy link
Member Author

Discussed internally. Here's the red-green analysis to show how the unit test captures the original problem.

Without the changes to CmdRun, the test fails as follows:

Condition not satisfied:

params['alphaBeta'] == 10
|     |             |
|     1             false
[alphaBeta:1, alpha-beta:10]

	at nextflow.cli.CmdRunTest.should convert cli params from kebab case to camel case(CmdRunTest.groovy:105)

Note that alphaBeta is set first, then alpha-beta which should be converted to alphaBeta and override the previous setting.

With the changes to CmdRun, the tests pass as shown in CI.

@pditommaso pditommaso merged commit b5d43ad into master Jan 17, 2025
20 checks passed
@pditommaso pditommaso deleted the 5655-fix-cli-params-kebab branch January 17, 2025 14:04
pditommaso pushed a commit that referenced this pull request Jan 20, 2025
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.

CLI parameter case normalization/translation (kebab-case to camelCase) doesn't work at all since recent update
2 participants