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

Docs: add parallel=1 #500

Open
edbzn opened this issue May 2, 2022 · 8 comments
Open

Docs: add parallel=1 #500

edbzn opened this issue May 2, 2022 · 8 comments
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@edbzn
Copy link
Member

edbzn commented May 2, 2022

OK I guess posting this issue helped me on finding the solution!

I just added parallel=1 to the command.

It would be nice to mention this in the documentation as I guess this is a common use case.

Originally posted by @christophediprima in #414 (comment)

@edbzn edbzn added documentation Improvements or additions to documentation good first issue Good for newcomers labels May 2, 2022
@dereekb
Copy link
Contributor

dereekb commented May 13, 2022

I ran into this and had some trouble figuring out where exactly to put the command. If you're going to use it inline with the run command, make sure you put it after run and before your nx target:

npx nx run --parallel=1 workspace:version

Here's the other example using this argument within nx.json:

semver/nx.json

Line 27 in 9c2047b

"parallel": 1

@edbzn
Copy link
Member Author

edbzn commented May 14, 2022

@dereekb would you want to contribute on this?

@dereekb
Copy link
Contributor

dereekb commented May 14, 2022

Sure, why not. I'll work on a small writeup to add to the docs and make a PR.

@subhranshudas
Copy link

i m curious, does this happen all the time? i have seen this happen few times but not sure how to repro it.
Mostly it happens when i am setting my NX workspace fresh (all packages are 0.0.0) and running the version for the 1st time.

yarn nx affected --target version --base= origin/main~1 --head= HEAD --verbose

and get the following
error-

Screen Shot 2022-05-15 at 3 15 16 PM

@dereekb
Copy link
Contributor

dereekb commented May 17, 2022

I'm still trying to reproduce the issue myself, since it pops up occasionally in my CI even with it inline.

Right now I'm having doubts as to whether or not "parallel" changes the behavior at all, or with what runners does it change the behavior, or if it only affects certain commands, such as nx run-many.

One possible guess is here:

concatMap((packageFiles) =>

There might be a race condition with performing concurrent addToStage() since we're using concatMap, so each project is still being updated in parallel. It's hard to reproduce though, but if the changes at addToStage were performed sequentially it might help in my case.

In your case, my guess is that the addToStage() from updating the changeLogs and updating the packageJson hit at the same time, since those are also done in parallel:

@hellraisercenobit
Copy link

Same behavior like @subhranshudas since v2.23.4 with or without parallel=1 and syncVersions to true.

@edbzn
Copy link
Member Author

edbzn commented May 23, 2022

Seems like the refactoring to get rid of standard-version introduced this issue, but I'm wondering why e2e tests don't catch anything, I have never seen this error myself.

@hellraisercenobit
Copy link

it's seems it's coming from the trade between concat and forkJoin operators.
i'm not sure about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants