FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Mark invalid SARIF errors as user errors in the `upload-sarif` Action by henrymercer · Pull Request #1872 · github/codeql-action · GitHub

Mark invalid SARIF errors as user errors in the upload-sarif Action - #1872

Merged
henrymercer merged 3 commits into
mainfrom
henrymercer/user-errors-for-upload-sarif
Sep 7, 2023
Merged

henrymercer merged 3 commits into
mainfrom
henrymercer/user-errors-for-upload-sarif

Conversation

henrymercer commented Sep 6, 2023
edited
Loading

Copy link
Copy Markdown
Contributor

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 the upload-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 the analyze or init-post steps, invalid SARIF upload requests remain Errors, 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

  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.
  • Confirm the changelog has been updated if necessary.

henrymercer requested a review from a team as a code owner September 6, 2023 20:04
angelapwen previously approved these changes Sep 6, 2023

angelapwen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks!!

Comment thread src/upload-lib.ts Outdated
/**
* An error that occurred due to an invalid SARIF upload request.
*/
class InvalidUploadSarifRequest extends Error {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Nit: could we we suffix this with Error?

Comment thread 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`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Maybe considerInvalidRequestUserError makes more sense to me, though it's not more concise 😆

angelapwen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

🥳

henrymercer merged commit 43750fe into main Sep 7, 2023
henrymercer deleted the henrymercer/user-errors-for-upload-sarif branch September 7, 2023 21:46
github-actions Bot mentioned this pull request Sep 13, 2023
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL