Skip to content

Conversation

@evilrobot-01
Copy link
Contributor

@evilrobot-01 evilrobot-01 commented Apr 23, 2025

Applies some of the best practices from https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api in an attempt to minimize errors caused by rate limiting of the Github API. When rate limiting occurs, errors will be returned with more detail information.

One can also now create a personal token on GitHub and specify locally via GITHUB_TOKEN if rate limiting occurs. The default limit is 60 per hour, so probably fine for most standard CLI usage.

todos:

  • response caching within the context of tests only
  • doc comments
  • tests

[sc-3686]

@evilrobot-01 evilrobot-01 requested a review from AlexD10S April 23, 2025 16:27
@evilrobot-01 evilrobot-01 added the ready-for-high-level-review The PR needs a high level review label Apr 23, 2025
@codecov
Copy link

codecov bot commented Apr 23, 2025

Codecov Report

Attention: Patch coverage is 88.97338% with 29 lines in your changes missing coverage. Please review.

Project coverage is 79.05%. Comparing base (cdb51a3) to head (b351e0e).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
crates/pop-common/src/api.rs 91.66% 2 Missing and 18 partials ⚠️
crates/pop-common/src/git.rs 66.66% 1 Missing and 5 partials ⚠️
crates/pop-common/src/sourcing/mod.rs 40.00% 1 Missing and 2 partials ⚠️
@@            Coverage Diff             @@
##             main     #530      +/-   ##
==========================================
+ Coverage   78.89%   79.05%   +0.16%     
==========================================
  Files         100      101       +1     
  Lines       23452    23689     +237     
  Branches    23452    23689     +237     
==========================================
+ Hits        18503    18728     +225     
- Misses       2741     2743       +2     
- Partials     2208     2218      +10     
Files with missing lines Coverage Δ
crates/pop-common/src/lib.rs 74.50% <ø> (ø)
crates/pop-common/src/sourcing/mod.rs 86.27% <40.00%> (+0.30%) ⬆️
crates/pop-common/src/git.rs 78.32% <66.66%> (+1.70%) ⬆️
crates/pop-common/src/api.rs 91.66% <91.66%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@evilrobot-01 evilrobot-01 changed the title refactor(common): wrap github rest api access in an apiclient fix: wrap github rest api access in an apiclient Apr 24, 2025
@evilrobot-01 evilrobot-01 added ready-for-final-review The PR is ready for final review and removed ready-for-high-level-review The PR needs a high level review labels Apr 24, 2025
@evilrobot-01 evilrobot-01 marked this pull request as ready for review April 24, 2025 11:13
Copy link
Collaborator

@AlexD10S AlexD10S left a comment

Choose a reason for hiding this comment

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

Super helpful fix, really appreciate you taking this on!

@evilrobot-01 evilrobot-01 merged commit 23c7b82 into main Apr 24, 2025
23 checks passed
@evilrobot-01 evilrobot-01 deleted the frank/api-client branch April 24, 2025 13:42
@chungquantin chungquantin mentioned this pull request May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-final-review The PR is ready for final review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants