AriPerkkio / eslint-remote-tester-run-action

Github action for running eslint-remote-tester and receiving results in Github issue
1 stars 1 forks source link

Handle Github API errors #18

Closed AriPerkkio closed 3 years ago

AriPerkkio commented 3 years ago

Scan in eslint-remote-tester run into Github API rate limit error: https://github.com/AriPerkkio/eslint-remote-tester/runs/3367064552?check_suite_focus=true

> Posting results
     Scanned 8597 repositories

Error: You have exceeded a secondary rate limit. Please wait a few minutes before you try again.
(node:1909) UnhandledPromiseRejectionWarning: HttpError: You have exceeded a secondary rate limit. Please wait a few minutes before you try again.
    at /home/runner/work/_actions/AriPerkkio/eslint-remote-tester-run-action/v1/dist/index.js:2869:26
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async GithubClient.getExistingIssue (/home/runner/work/_actions/AriPerkkio/eslint-remote-tester-run-action/v1/dist/index.js:5791:22)
    at async GithubClient.postResults (/home/runner/work/_actions/AriPerkkio/eslint-remote-tester-run-action/v1/dist/index.js:5777:27)
    at async run (/home/runner/work/_actions/AriPerkkio/eslint-remote-tester-run-action/v1/dist/index.js:5970:5)
(node:1909) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1909) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Secondary rate limits

Add error handling and a retry functionality to GithubClient:

https://github.com/AriPerkkio/eslint-remote-tester-run-action/blob/1cb8cb2daaaf5feba394c97fcf86826543b65adc/src/github-client.ts#L14-L18