Sitelet https://web.archive.org/web/20220509041255/https://github.com/angular/components/pull/21161
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(cdk/schematics): fix resolving modules in ng update #21161

Merged
merged 1 commit into from Dec 1, 2020
Merged

fix(cdk/schematics): fix resolving modules in ng update #21161

merged 1 commit into from Dec 1, 2020

Conversation

Copy link
Contributor

@kyubisation kyubisation commented Nov 27, 2020

Closes #21160

@google-cla google-cla bot added the cla: yes label Nov 27, 2020
@kyubisation
Copy link
Author

@kyubisation kyubisation commented Nov 29, 2020 •

@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?

@crisbeto
Copy link

@crisbeto crisbeto commented Nov 29, 2020

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?

@kyubisation
Copy link
Author

@kyubisation kyubisation commented Nov 29, 2020

Yes, I'm trying to investigate it right now. I need to setup the bazel debugging...

@kyubisation
Copy link
Author

@kyubisation kyubisation commented Nov 29, 2020

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.

@kyubisation
Copy link
Author

@kyubisation kyubisation commented Nov 29, 2020 •

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).
I'll see if there is an alternative solution.

@kyubisation
Copy link
Author

@kyubisation kyubisation commented Nov 29, 2020

@crisbeto I have refactored the directory check to query, if the parent directory has the given directory as a subdir. Please have another look.

Copy link
Member

@crisbeto crisbeto left a comment

Thank you for reworking it, it's looking much better! One more comment and it should be good to go.

Copy link
Member

@crisbeto crisbeto left a comment

LGTM and thank you for taking the time to get rid of our old workaround.

@crisbeto crisbeto added merge ready merge safe P3 target: patch labels Nov 30, 2020
@kyubisation
Copy link
Author

@kyubisation kyubisation commented Nov 30, 2020

No problem, thank you for the quick response. 😃
Do you think a release with this fix is possible this week or is that unlikely?
Depending on this we will wait for the release or try to provide a workaround internally in our company.

@crisbeto
Copy link

@crisbeto crisbeto commented Nov 30, 2020

Since this is only schematics code, it can be merged in quicker, but I can't guarantee when it'll be released.

@kyubisation
Copy link
Author

@kyubisation kyubisation commented Nov 30, 2020

Ok, that's not a problem.
The workaround is to simply run ng update package --migrateOnly --from=10 --to=11, so we can live with that.

@kyubisation
Copy link
Author

@kyubisation kyubisation commented Dec 1, 2020

@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.

@mmalerba mmalerba merged commit b8b3923 into angular:master Dec 1, 2020
16 checks passed
mmalerba pushed a commit that referenced this issue Dec 1, 2020
@kyubisation kyubisation deleted the patch-1 branch Dec 1, 2020
@angular-automatic-lock-bot
Copy link

@angular-automatic-lock-bot angular-automatic-lock-bot bot commented Jan 1, 2021

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jan 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes merge ready merge safe P3 target: patch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants