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

fix: handle rate limit error in get pr info fn #433

Merged
merged 3 commits into from
Mar 8, 2024

Conversation

joseph-sentry
Copy link
Contributor

We want to handle receiving a 429 or 403
status code response from gh that is related
to hitting the gh rate limit.

now we do that when we try to get PR info while
trying to auth with tokenless

we will return a exceptions.Throttled which
corresponds to a 429 status code

Links to relevant tickets

codecov/engineering-team#1247

What does this PR do?

  • Handle TorngitRateLimitError in get_pull_request_info
  • add tests for get_pull_request_info to test it can handle receiving a 429 status code

@codecov-qa
Copy link

codecov-qa bot commented Mar 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.04%. Comparing base (2dc2d60) to head (cfd65ad).

❗ Current head cfd65ad differs from pull request most recent head 9e0e8c4. Consider uploading reports for the commit 9e0e8c4 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #433      +/-   ##
==========================================
- Coverage   96.05%   96.04%   -0.02%     
==========================================
  Files         643      643              
  Lines       17080    17070      -10     
==========================================
- Hits        16407    16395      -12     
- Misses        673      675       +2     
Flag Coverage Δ
unit 96.04% <100.00%> (-0.02%) ⬇️
unit-latest-uploader 96.04% <100.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link

codecov-public-qa bot commented Mar 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (2dc2d60) 96.05% compared to head (9e0e8c4) 96.06%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #433   +/-   ##
=======================================
  Coverage   96.05%   96.06%           
=======================================
  Files         643      643           
  Lines       17080    17093   +13     
=======================================
+ Hits        16407    16420   +13     
  Misses        673      673           
Flag Coverage Δ
unit 96.06% <100.00%> (+<0.01%) ⬆️
unit-latest-uploader 96.06% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
codecov_auth/authentication/repo_auth.py 98.28% <100.00%> (+0.13%) ⬆️

Impacted file tree graph

@joseph-sentry joseph-sentry force-pushed the joseph/handle-rate-limit branch from c8fce43 to 533b914 Compare March 5, 2024 18:36
@joseph-sentry joseph-sentry force-pushed the joseph/handle-rate-limit branch from efcd98d to cfd65ad Compare March 7, 2024 14:25
joseph-sentry and others added 3 commits March 8, 2024 16:18
We want to handle receiving a 429 or 403
status code response from gh that is related
to hitting the gh rate limit.

now we do that when we try to get PR info while
trying to auth with tokenless

we will return a `exceptions.Throttled` which
corresponds to a 429 status code
Signed-off-by: joseph-sentry <joseph.sawaya@sentry.io>
Co-authored-by: Tom Hu <88201630+thomasrockhu-codecov@users.noreply.github.com>
@joseph-sentry joseph-sentry force-pushed the joseph/handle-rate-limit branch from cfd65ad to 9e0e8c4 Compare March 8, 2024 21:18
@codecov-staging
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@joseph-sentry joseph-sentry merged commit 80d01d2 into main Mar 8, 2024
17 of 18 checks passed
@joseph-sentry joseph-sentry deleted the joseph/handle-rate-limit branch March 8, 2024 21:33
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.

3 participants