Repository navigation
feat: way to avoid github API limit (add tests + docs) - #123
Conversation
|
|
||
| <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> | ||
| <!-- prettier-ignore --> | ||
| | [<img src="https://avatars.githubusercontent.com/u/3869412?v=3" width="100px;"/><br /><sub><b>Jeroen Engels</b></sub>](https://github.com/jfmengels)<br />[💻](https://github.com/jfmengels/all-contributors-cli/commits?author=jfmengels "Code") [📖](https://github.com/jfmengels/all-contributors-cli/commits?author=jfmengels "Documentation") [⚠️](https://github.com/jfmengels/all-contributors-cli/commits?author=jfmengels "Tests") | [<img src="https://avatars.githubusercontent.com/u/1500684?v=3" width="100px;"/><br /><sub><b>Kent C. Dodds</b></sub>](http://kentcdodds.com/)<br />[📖](https://github.com/jfmengels/all-contributors-cli/commits?author=kentcdodds "Documentation") [💻](https://github.com/jfmengels/all-contributors-cli/commits?author=kentcdodds "Code") | [<img src="https://avatars.githubusercontent.com/u/14871650?v=3" width="100px;"/><br /><sub><b>João Guimarães</b></sub>](https://github.com/jccguimaraes)<br />[💻](https://github.com/jfmengels/all-contributors-cli/commits?author=jccguimaraes "Code") | [<img src="https://avatars.githubusercontent.com/u/1282980?v=3" width="100px;"/><br /><sub><b>Ben Briggs</b></sub>](http://beneb.info)<br />[💻](https://github.com/jfmengels/all-contributors-cli/commits?author=ben-eb "Code") | [<img src="https://avatars.githubusercontent.com/u/22768990?v=3" width="100px;"/><br /><sub><b>Itai Steinherz</b></sub>](https://github.com/itaisteinherz)<br />[📖](https://github.com/jfmengels/all-contributors-cli/commits?author=itaisteinherz "Documentation") [💻](https://github.com/jfmengels/all-contributors-cli/commits?author=itaisteinherz "Code") | [<img src="https://avatars.githubusercontent.com/u/5701162?v=3" width="100px;"/><br /><sub><b>Alex Jover</b></sub>](https://github.com/alexjoverm)<br />[💻](https://github.com/jfmengels/all-contributors-cli/commits?author=alexjoverm "Code") [📖](https://github.com/jfmengels/all-contributors-cli/commits?author=alexjoverm "Documentation") | |
There was a problem hiding this comment.
it appears running yarn kcd-scripts contributors generate does not work locally 🤔
There was a problem hiding this comment.
Turns out .all-contributorsrc JSON file was invalid and was crashing silently on generate
There was a problem hiding this comment.
Spent an hour debugging in node trying to find this. Have added better support with this in PR: https://github.com/jfmengels/all-contributors-cli/pull/124/files
| "avatar_url": "https://avatars2.githubusercontent.com/u/8073251?v=4", | ||
| "profile": "https://github.com/xuchaoying", | ||
| "contributions": [ | ||
| "code", |
There was a problem hiding this comment.
This was causing all-contributors to crash hard with a useless error message Cannot read property 'then' of null I'm going to propose we improve the parsing of the config file, to alert on issues like this
There was a problem hiding this comment.
added better detection of this in: https://github.com/jfmengels/all-contributors-cli/pull/124/files
|
@kentcdodds, follow up to #122, added tests/docs and fixed all-contributors (was previously broken with an invalid json files) (have added a guard for this in https://github.com/jfmengels/all-contributors-cli/pull/124/files). |
| } | ||
| ``` | ||
|
|
||
| In some cases you may see the error message 'GitHub API rate limit exceeded for xxx'. You may need to set an environment variable named `PRIVATE_TOKEN` in order to circumvent this [GitHub rate limit](https://developer.github.com/v3/rate_limit/). |
There was a problem hiding this comment.
I don't see anywhere in the code that reads the PRIVATE_TOKEN environment variable. Am I missing something?
There was a problem hiding this comment.
@kentcdodds I tied in to the same way all-contributors-cli supports gitlab: https://github.com/jfmengels/all-contributors-cli/blob/master/src/repo/index.js#L4
|
I can merge this, but the build is broken and we can't have a release until it's fixed (the release is automated). I don't have time to look into it I'm afraid. If you'd like to investigate and open a PR for that, I'd appreciate it. Thanks! |
Follow-up to #122, adding tests and docs. Also converted the pattern to follow what was done for gitlab.
What:
Add a way to avoid GITHUB API LIMIT by supplying an optional GITHUB_AUTH token to increase github rate limiting from 50 requests to 5000 (and limited by user, not IP)
Why:
Fixes: #121
How:
By Me
Checklist: