-
Notifications
You must be signed in to change notification settings - Fork 335
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
Mark invalid SARIF errors as user errors in the upload-sarif
Action
#1872
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.
Thanks!!
src/upload-lib.ts
Outdated
/** | ||
* An error that occurred due to an invalid SARIF upload request. | ||
*/ | ||
class InvalidUploadSarifRequest extends 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.
Nit: could we we suffix this with Error
?
src/upload-lib.ts
Outdated
/** | ||
* Uploads a single SARIF file or a directory of SARIF files depending on what `sarifPath` refers to. | ||
* | ||
* @param invalidRequestIsUserError Whether an invalid request, for example one with a `sarifPath` |
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.
Maybe considerInvalidRequestUserError
makes more sense to me, though it's not more concise 😆
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.
🥳
Found this while I was looking at CodeQL Action telemetry as I rolled out some other changes.
Categorizing user errors correctly in telemetry helps us detect and respond to incidents faster. This PR starts marking invalid SARIF upload requests as
UserError
when users use theupload-sarif
Action, as here the SARIF is not under our control, and things like invalid paths or invalid SARIF are not problems with our service. On the other hand, when uploading SARIF in theanalyze
orinit-post
steps, invalid SARIF upload requests remainError
s, since these could indicate a problem with our service.Suggestions for a better name for
invalidRequestIsUserError
welcome — this felt a little awkward.Merge / deployment checklist