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

NuGetAudit must not cause restore to fail #5608

Merged
merged 2 commits into from
Jan 25, 2024

Conversation

zivkan
Copy link
Member

@zivkan zivkan commented Jan 24, 2024

Bug

Fixes: NuGet/Home#13085

Regression? no

Description

While the vulnerability info resource is designed to fail gracefully (not throw, return a result object with an exception), if restore didn't need to talk to any sources before running audit, then getting the service index, or getting the vulnerability resource from the service index can throw. This needs to be guarded because Audit should never cause a build to fail (unless customers opt into warnings as errors)

PR Checklist

  • PR has a meaningful title

  • PR has a linked issue.

  • Described changes

  • Tests

    • Automated tests added
    • OR
    • Test exception
    • OR
    • N/A
  • Documentation

    • Documentation PR or issue filled
    • OR
    • N/A

@zivkan zivkan requested a review from a team as a code owner January 24, 2024 20:56
Copy link
Member

@nkolev92 nkolev92 left a comment

Choose a reason for hiding this comment

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

Can we fix the SolutionRestoreJob side too?

It should not crash if a single project throws should it?
If you prefer that to be handled in a separate PR, please create an issue.

@zivkan
Copy link
Member Author

zivkan commented Jan 24, 2024

It's really not clear to me how to solve the unhandled exceptions. Where and how should the errors be reported to customers in VS? How should the error be shown on the CLI? Should a "fake" assets file be created and written out?

If I was to work on it, it'd take me significantly longer than what this PR has already taken me, so I think it's better off as a different issue/PR.

@zivkan zivkan merged commit 8838136 into dev Jan 25, 2024
16 checks passed
@zivkan zivkan deleted the dev-zivkan-NuGetAudit-source-not-available branch January 25, 2024 21:09
@donnie-msft
Copy link
Contributor

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