-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(cdk/schematics): fix resolving modules in ng update #21161
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
Conversation
@crisbeto The material schematics tests run into a memory issue. I suspect this is due to the migration now correctly resolving all related files, but I cannot say for certain. Do you have an idea on how this could be fixed? |
Even if it is resolving more files than before, we'd have to try really hard to get it to run out of memory. Could it be hitting an infinite loop somewhere? Also does this happen if you run the tests locally? |
Yes, I'm trying to investigate it right now. I need to setup the bazel debugging... |
I have currently narrowed it down to the material-imports.spec.ts and the hammer-migration-v9.spec.ts. I'm currently debugging it, to see what is happening. |
Ok, the problem seems to be, that getDir in the HostTree treats a non-existent file path as a potential directory. This means getDir cannot be used to assert a path being a directory (and it also does not expose the isDirectory of its nested host). |
@crisbeto I have refactored the directory check to query, if the parent directory has the given directory as a subdir. Please have another look. |
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.
Thank you for reworking it, it's looking much better! One more comment and it should be good to go.
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.
LGTM and thank you for taking the time to get rid of our old workaround.
No problem, thank you for the quick response. 😃 |
Since this is only schematics code, it can be merged in quicker, but I can't guarantee when it'll be released. |
Ok, that's not a problem. |
@crisbeto I tested this with a few real life projects from our company and discovered an additional problem. When projects import package.json, typescript checks potential entry points (e.g /package.json/package.json and /package.json/index.ts) which would result in a failure with getDir. To avoid this I added a check to verify that the parent "directory" is not an existing file. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Closes #21160