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

Nx's default --parallel value not correctly set to 3 #13782

Closed
mike-fam opened this issue Dec 13, 2022 · 2 comments · Fixed by #13837
Closed

Nx's default --parallel value not correctly set to 3 #13782

mike-fam opened this issue Dec 13, 2022 · 2 comments · Fixed by #13837
Labels

Comments

@mike-fam
Copy link
Contributor

mike-fam commented Dec 13, 2022

Current Behavior

If the --parallel tag is not explicitly set, then it defaults to undefined, although the documentation specifies that 3 is the default value.

Expected Behavior

It should be defaulted to 3, or the documentation should be updated to say the default value is undefined, meaning sequential execution

Github Repo

https://github.com/nrwl/nx/blob/master/packages/nx/src/utils/command-line-utils.ts#L168-L180

Steps to Reproduce

  1. Run nx run-many --target=lint --all, without the --parallel tag.
  2. All projects are linted sequentially.

Nx Report

NA

Failure Logs

NA

Additional Information

I believe the problem lies within this snippet:
https://github.com/nrwl/nx/blob/master/packages/nx/src/utils/command-line-utils.ts#L168-L180

If args['parallel'] is undefined, which it is when it’s not specified, then nxArgs['parallel'] is not set and defaults to undefined too.

I've tested this by adding this line directly below the snippet above:

	output.note({
		title: `Run with args.parallel being '${args['parallel']}', so nxArgs.parallel is set to '${nxArgs['parallel']}'`,
	});

Running nx run-many --target=lint --all on my repository (or any nx repository for that matter) gives:

>  NX   NOTE  Run with args.parallel being 'undefined', so nxArgs.parallel is set to 'undefined'

I can create a PR, but I need to know the Nx team's decision. Do you want this parallel value to default to 3 or do you want to update the documentation to match the current behaviour?

@AgentEnder AgentEnder added the scope: core core nx functionality label Dec 13, 2022
@AgentEnder
Copy link
Member

It should default to 3, you can proceed with a PR if you'd like.

@github-actions
Copy link

github-actions bot commented May 6, 2023

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

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

Successfully merging a pull request may close this issue.

2 participants