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(core): properly serialize override with object arg for command line #12499

Merged

Conversation

lukasalphta
Copy link
Contributor

@lukasalphta lukasalphta commented Oct 10, 2022

Avoid printing object args as [object Object] in terminal.

Current Behavior

When we pass not nx arguments as object

nx e2e myapp6467039-e2e --env.cliArgs="i am from the cli args" 

the task runner will print [object Object] instead of the passed arguments

> nx run myapp6467039-e2e:e2e --env=[object Object]

Expected Behavior

It should print unparsed arguments

>  nx run myapp6467039-e2e:e2e  --env.cliArgs="i am from the cli args" 

Related Issue(s)

Fixes #10808

@vercel
Copy link

vercel bot commented Oct 10, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
nx-dev ✅ Ready (Inspect) Visit Preview Oct 27, 2022 at 6:46PM (UTC)

@lukasalphta
Copy link
Contributor Author

lukasalphta commented Oct 13, 2022

Hi @FrozenPandaz, after a second look at my PR I started questioning what the expected behavior should be. In the previous versions before this problem occurred, arguments passed with dot notation were printed in the same way in terminal.

Running

nx e2e myapp6467039-e2e --env.cliArgs="i am from the cli args"

would have printed

> nx run myapp6467039-e2e:e2e --env.cliArgs="i am from the cli args"

Could you confirm that this would be the expected behavior here as well? Then I could rework the PR.

@FrozenPandaz
Copy link
Collaborator

FrozenPandaz commented Oct 27, 2022

Sorry, it's been a while. Thank you so much for your work here! The fix was in the right place but I found some code that we can reuse.

This logic isn't the cleanest... I think this logic should be kind of unnecessary. Rather than unparsing the parsed arguments which were actually passed, there should be a way where we can directly keep the arguments which were actually passed. We will look into in the near future.

For now, I fixed it a simpler way without exposing the underlying parsing of a single option. We actually have this code elsewhere so I moved it from there. I saw you actually had some logic which used the underlying parsing of a single option but I'm hoping we will fix it in a better strategy soon. Let's go with this fix for now, so that your issue is resolved while we work on a better strategy for this.

Again, thank you so much for your work. I can take it from here 👍

@FrozenPandaz FrozenPandaz merged commit 594c63b into nrwl:master Oct 27, 2022
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression - Cypress executor does not respect env cli parameters.
2 participants