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

[Vulnerabilities]: order by severity on the display package page #8703

Closed
loic-sharma opened this issue Jul 26, 2021 · 4 comments
Closed

[Vulnerabilities]: order by severity on the display package page #8703

loic-sharma opened this issue Jul 26, 2021 · 4 comments

Comments

@loic-sharma
Copy link
Contributor

loic-sharma commented Jul 26, 2021

Related Problem

The display package page does not order packages' vulnerabilities by their severity. Notice how the most important vulnerability is last here:

image

The Elevator Pitch

Some packages have many vulnerabilities (example). Sorting the vulnerabilities by their severity would help customers prioritize their security review.

Additional Context and Details

No response

@sipmann
Copy link
Contributor

sipmann commented Aug 30, 2021

Hey @loic-sharma,
If this is still open for grabs, I would be happy to help and contribute.

@loic-sharma
Copy link
Contributor Author

Yup feel free to take it! Please let us know if you run into any problems :)

@sipmann
Copy link
Contributor

sipmann commented Aug 30, 2021

I tracked down till the PackageVulnerabilitiesCacheService source. Unfortunately, I'm not able to set the order through the SQL query. The only way I was able to order, was by setting the order at line 89. But I'm concerned with a possible performance issue. Any tips?

kv => kv.OrderByDescending(x => x.Severity).ToList().AsReadOnly() as IReadOnlyList<PackageVulnerability>));

@loic-sharma
Copy link
Contributor Author

@sipmann Your change has been deployed to nuget.org! Thanks for your contribution 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants