allcontributors icon indicating copy to clipboard operation
allcontributors copied to clipboard

Add rate limit checking

Open chartgerink opened this issue 1 year ago • 2 comments

This PR adds a small function to check the rate limit on the GitHub API. When this hits 0, it will display a warning.

This will help people get feedback on when they are exceeding the rate limit, which can be helpful to scope down the task to be more manageable.

Pre-discussed in #36. Happy to take feedback as you know your standards for this package best. I tried to stick to how you've previously implemented warnings for sake of package consistency.

chartgerink avatar Feb 28 '24 08:02 chartgerink

@chartgerink That looks great! Could you please fix the tests? They include mock results of all external calls, so now fail because new API calls have been introduced. You should be able to update them with these steps:

  1. Delete the tests/testthat/getcontribs directory (not git rm, just rm!)
  2. Run
    library (httptest2)
    testthat::test_local ()
    
  3. git add tests/testthat/getcontribs

Then you can stage all of those files, commit, and push. Thanks!

mpadge avatar Mar 04 '24 14:03 mpadge

Thanks @mpadge - updated according to your steps 👍

EDIT: It seems like the tests still fail on remote, even though they pass locally. The error indicates a timeout?

chartgerink avatar Mar 18 '24 09:03 chartgerink

Sorry for dropping this @chartgerink. This still fails tests, but I'll merge and fix everything straight away, before moving straight on to #35.

mpadge avatar May 15 '24 11:05 mpadge