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(package-graph): ensure to touch all nodes #3234

Merged
merged 1 commit into from Aug 12, 2022
Merged

Conversation

simllll
Copy link
Contributor

@simllll simllll commented Jul 7, 2022

Description

the fix of not touching a node twice (#2874) has a side effect so that not all scirpts are executed anymore.

this fixes it by still improving / keeping the performance benefits of the other pr.

fixes #3233

Copy link
Member

@JamesHenry JamesHenry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @simllll, is there a failing test we can add first and fix with this?

alreadyVisited.add(topLevelDependent);
const identifier = baseNode.name + ':' + topLevelDependent.name;
if (alreadyVisited.has(identifier)) {
console.log('topLevelDependent', identifier);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@simllll Please remove the console log

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oha, sorry about that

@simllll
Copy link
Contributor Author

simllll commented Jul 7, 2022

Okay, I was trying to break it down further, and I guess I found the real issue here: a dependency circle caused this behavior. Even though the circle is unrelated to this package. So it seems it's not really a bug, it's just a hard to find "issue". Sorry for the troubles

@simllll simllll closed this Jul 7, 2022
@simllll simllll reopened this Jul 26, 2022
@simllll
Copy link
Contributor Author

simllll commented Jul 26, 2022

I ran into the same thing today again, but now I don't have any circular dependencies.. still not sure what's going on (lerna 5.2.0), but it's for sure that even though the package list on lerna run build --no-private says it has exectued the packages, it does not run the commands.

@ghiscoding
Copy link

@simllll are you by any chance using the new useNx? I might have seem something similar when that option is enabled

@simllll
Copy link
Contributor Author

simllll commented Jul 26, 2022

Hi @ghiscoding , nope, not using this option

@ghiscoding
Copy link

so does this PR fix your latest issue then? if so I'd be willing to push it to Lerna-Lite

@simllll
Copy link
Contributor Author

simllll commented Jul 26, 2022

It does, but I'm not sure if we loose the performance benefits of the earlier patch with this one again... would be great if the one who created the #2874 PR can look at this (pinging @rix0rrr )

@ghiscoding
Copy link

ghiscoding commented Aug 6, 2022

@simllll I can confirm that #2874 is causing quite a negative side effect, we ran into this problem on a large project which had 43 packages changed, but only returned 5 of them were returned and that caused a lot of packages to not be published when they should have. Your code change seems to fix the issue, so I'll apply this code change into Lerna-Lite unless something better comes up. Thanks for that

@JamesHenry
Copy link
Member

Based on the feedback above let's get this merged, we'll need to spend some more time trying to understand these changes better though and have some test coverage.

If there are any other issues that get raised then we will likely have to revert the original change

@JamesHenry JamesHenry merged commit f3c211d into lerna:main Aug 12, 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.

package scripts not executed since 5.1.3
3 participants