-
Notifications
You must be signed in to change notification settings - Fork 694
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
PrivateAssets for central transitive dependencies should flow regardless whether the parent node is a project or a package #4952
Conversation
…rcink-20221128-assets_flow_for_project_and_packages
…ess whether the parent is a project or a package
Next one is #4953 |
Does this also solve NuGet/Home#10907 by any chance? (non CPM scenarios) |
…rcink-20221128-assets_flow_for_project_and_packages
…s_flow_for_project_and_packages
No, very unlikely. The only significant change here is in the |
…s_flow_for_project_and_packages
{ | ||
LibraryDependency parentDependency = targetFrameworkInformation.Dependencies.FirstOrDefault(i => i.Name.Equals(parentNode.Item.Key.Name, StringComparison.OrdinalIgnoreCase)); |
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.
targetFrameworkInformation.Dependencies
doesn't contain projects.
@marcin-krystianc it looks like some unit tests are failing, please take a look. |
Apologies for that, it is fixed now. |
No apology necessary, just wanted to make sure you were aware! |
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.
Some test feedback before approving.
LibraryDependency parentDependency = rootNode.Item.Data.Dependencies.FirstOrDefault(i => i.Name.Equals(parentNode.Item.Key.Name, StringComparison.OrdinalIgnoreCase)); | ||
|
||
// A transitive dependency that is a few levels deep won't be a top-level dependency so skip it | ||
if (parentDependency == null || parentDependency.ReferenceType != LibraryDependencyReferenceType.Direct) |
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.
This extra check is necessary, because rootNode.Item.Data.Dependencies
contains also centrally managed transitive references which should be ignored here.
Thanks for the heads up, I've simplified the test code a little bit, |
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.
Thanks for the contribution!
Bug
Fixes: NuGet/Home#12276
Regression? Last working version: no
Description
When we check whether a node directly belongs to a root node, we need to look at
rootNode.Item.Data.Dependencies
instead oftargetFrameworkInformation.Dependencies
. The former contains projects, but the latter does not.PR Checklist
PR has a meaningful title
PR has a linked issue.
Described changes
Tests
Documentation