-
Notifications
You must be signed in to change notification settings - Fork 696
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
[Transitive's in Solution] Vulnerability indicators in solution level details pane for top-level packages #6010
Conversation
private IEnumerable<NuGetVersion> _vulnerableVersions = []; | ||
public IEnumerable<NuGetVersion> VulnerableVersions | ||
private Dictionary<NuGetVersion, int> _vulnerableVersions = []; | ||
public Dictionary<NuGetVersion, int> VulnerableVersions |
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 were mistakenly added in the previous PR and were never used.
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.
Looks good so far! Requesting a few changes.
...uGet.Clients/NuGet.PackageManagement.UI/Converters/InstalledVulnerabilitiesCountConverter.cs
Outdated
Show resolved
Hide resolved
src/NuGet.Clients/NuGet.PackageManagement.UI/Converters/IntToVisibilityConverter.cs
Outdated
Show resolved
Hide resolved
src/NuGet.Clients/NuGet.PackageManagement.UI/Models/PackageSolutionDetailControlModel.cs
Outdated
Show resolved
Hide resolved
src/NuGet.Clients/NuGet.PackageManagement.UI/Models/PackageSolutionDetailControlModel.cs
Outdated
Show resolved
Hide resolved
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.
Nice! Thanks for doing a little refactoring to make the converter more generic and updating tests!
Left some minor points that you could address before going to dev.
src/NuGet.Clients/NuGet.PackageManagement.UI/ViewModels/PackageItemViewModel.cs
Outdated
Show resolved
Hide resolved
src/NuGet.Clients/NuGet.PackageManagement.UI/Models/PackageSolutionDetailControlModel.cs
Outdated
Show resolved
Hide resolved
src/NuGet.Clients/NuGet.PackageManagement.UI/Models/PackageSolutionDetailControlModel.cs
Outdated
Show resolved
Hide resolved
src/NuGet.Clients/NuGet.PackageManagement.UI/ViewModels/PackageItemViewModel.cs
Show resolved
Hide resolved
src/NuGet.Clients/NuGet.PackageManagement.UI/Models/PackageSolutionDetailControlModel.cs
Outdated
Show resolved
Hide resolved
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.
Approving with suggestion. Just one change then 🚀!
if (maxSeverity > -1) | ||
{ | ||
VulnerableVersions.Add(version, maxSeverity); | ||
} | ||
|
||
VulnerabilityMaxSeverity = Math.Max(VulnerabilityMaxSeverity, maxSeverity); | ||
|
||
OnPropertyChanged(nameof(Status)); |
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.
For SetVulnerabilityMaxSeverity, would we want to only calculate and set the VulnerabilityMaxSeverity and call OnPropertyChanged if the maxSeverity is > -1?
cc328a9
to
949ba9f
Compare
34cc432
into
feature-TransitivePkgsInSolutionPMUI
… details pane for top-level packages (#6010) * Vulnerability indicators for top level in solution
Bug
Fixes: NuGet/Home#13760
Description
This PR enables calculating the vulnerabilities for all the packages that we have a metadata, in the previous PR for this feature we allowed the
PackageItemViewModel
to have data for all the installed versions in the Solution and store a copy of that metadata.Vulnerability indicators are also being added to the Solution Detail Pane so users are able to identify vulnerable installed packages more easily.
PR Checklist