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(install/clean): infinite loops on circular dependencies #211

Merged
merged 4 commits into from
Nov 25, 2023

Conversation

await-ovo
Copy link
Member

add resolved_packages memo cache to state to avoid infinite loops when installing circular dependencies

Copy link

codecov bot commented Nov 21, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c62a631) 92.65% compared to head (cbe9d62) 92.68%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #211      +/-   ##
==========================================
+ Coverage   92.65%   92.68%   +0.02%     
==========================================
  Files          57       57              
  Lines        2847     2871      +24     
==========================================
+ Hits         2638     2661      +23     
- Misses        209      210       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@KSXGitHub KSXGitHub left a comment

Choose a reason for hiding this comment

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

Didn't expect you to fix this issue yourself. Very cool.

Anyway, I have some change requests.

crates/package-manager/src/install_without_lockfile.rs Outdated Show resolved Hide resolved
crates/package-manager/src/install_without_lockfile.rs Outdated Show resolved Hide resolved
crates/cli/src/state.rs Outdated Show resolved Hide resolved

eprintln!("Snapshot");
let index_file_contents = index_file_contents(&store_dir);
insta::assert_yaml_snapshot!(index_file_contents);
Copy link
Member

Choose a reason for hiding this comment

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

do really need this snapshot test? Maybe just check if the package is present in node_modules.

Copy link
Member Author

Choose a reason for hiding this comment

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

done ~

@KSXGitHub KSXGitHub changed the title fix(package-manager): avoid infinite loops when clean install circular dependencies fix(install/clean): infinite loops on circular dependencies Nov 22, 2023
@zkochan zkochan merged commit 6d8cec2 into pnpm:main Nov 25, 2023
13 checks passed
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.

3 participants