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

Put API/networking errors on another error code #857

Merged
merged 3 commits into from Mar 13, 2024

Conversation

another-rex
Copy link
Collaborator

@another-rex another-rex commented Mar 13, 2024

Separate out API errors into its own error code. The intention is to avoid lumping everything in error 127, since it is reserved for general errors not actionable by the user.

Errors related to the API should be separate as they are actionable by the user (e.g. the CI it's running on has no access to the internet), or our API is timing out, so they should try again...etc.

Another motivation is that currently because API errors are mixed in with general errors, it's not clear to the user what caused the osv-scanner GitHub action to fail, since we specifically ignore general errors and set the exit code to 0 in the GitHub action, as this could be caused by failing to parse a specific lockfile. This leads to situations like: https://github.com/google/osv.dev/actions/runs/8243615203/job/22544495994?pr=2048 , where it's unclear what the actual error is (it is hiding under Run Scanner For Existing Code step, which is a check).

This PR also clarifies the error wording to make it clear which query caused the error.

TODO: (In followup PRs)

  • Guided Remediation
  • Automated updates

@codecov-commenter
Copy link

codecov-commenter commented Mar 13, 2024

Codecov Report

Attention: Patch coverage is 12.50000% with 7 lines in your changes are missing coverage. Please review.

Project coverage is 61.16%. Comparing base (b28c1c8) to head (4ca052c).
Report is 26 commits behind head on main.

Files Patch % Lines
pkg/osvscanner/osvscanner.go 0.00% 4 Missing ⚠️
cmd/osv-scanner/main.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #857      +/-   ##
==========================================
+ Coverage   59.78%   61.16%   +1.37%     
==========================================
  Files         136      144       +8     
  Lines       11268    11807     +539     
==========================================
+ Hits         6737     7222     +485     
- Misses       4102     4112      +10     
- Partials      429      473      +44     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@another-rex another-rex marked this pull request as ready for review March 13, 2024 03:58
@another-rex another-rex merged commit 700a540 into google:main Mar 13, 2024
12 checks passed
cuixq added a commit that referenced this pull request Mar 14, 2024
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.

None yet

4 participants