-
Notifications
You must be signed in to change notification settings - Fork 14
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
npm translator: Fix endless loop in case of dependency cycles #15
Conversation
de9c8ac
to
3bb69f0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering why I didn't implement something similar when we first faced the circular dependency issue last year. But I guess this solution only got possible due to a more recent refactoring that lead to the processPendingDeps function being implemented.
Could you please add a [FIX]
prefix to the commit message and maybe remove the spaces in the if-statement to follow the general code style?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meant to request changes... See approval comment
3bb69f0
to
0d8ed08
Compare
|
||
// Breadth-first search to prefer projects closer to root | ||
while (queue.length) { | ||
const project = queue.shift(); // Get and remove first entry from queue | ||
if (!project.id) { | ||
throw new Error("Encountered project with missing id"); | ||
} | ||
if (visited.has(project.id)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to to check for the combination of project.id
and project.version
instead of only the project.id
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The projectPreprocessor does the same also on id-level: projectPreprocessor.js#L55. So I guess it wouldn't change much down that line.
While it is yet to be decided and documented, we once agreed (for the time being) to always prefer the projects closer to the root, ignoring the version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per our Guidelines we prefer the commit message summary prefix to be uppercase 😉
Btw. I'm not sure whether our changelog would even include commits with a lower case prefix: .chglog/config.yml#L11
0d8ed08
to
c5905b1
Compare
How could I miss that... |
Fixes https://github.com/SAP/ui5-project/issues/14 .