-
Notifications
You must be signed in to change notification settings - Fork 43
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
Handle package not found in package registries #3363
Conversation
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.
✅ No Invisible Unicode Characters Detected.
This is a draft because a) there are no tests and b) I think there is room for improvement (see inline comments) |
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.
✅ No Invisible Unicode Characters Detected.
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.
✅ No Mixed Scripts Detected.
If we don't find a package in the configured package registry, we would have errored out. Let's instead reply inline that there is a vulnerability but that we can't find information about the package.
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.
✅ No Invisible Unicode Characters Detected.
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.
✅ No Mixed Scripts Detected.
@@ -386,6 +393,9 @@ func TestPyPiPkgDb(t *testing.T) { | |||
} | |||
reply, err := repo.SendRecvRequest(context.Background(), dep, tt.patchedVersion, latest) | |||
if tt.expectError { | |||
if tt.errorToExpect != nil { | |||
assert.Equal(t, tt.errorToExpect, err, "Expected error") |
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.
why not use assert.ErrorIs
?
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.
because I'm dumb :-) let me fix it
Summary
If we don't find a package in the configured package registry, we would
have errored out. Let's instead reply inline that there is a
vulnerability but that we can't find information about the package.
Fixes: #3368
Change Type
Testing
Manual testing, see e.g. jakubtestorg/demo-repo-js#4
Review Checklist: