github-script icon indicating copy to clipboard operation
github-script copied to clipboard

Please consider retries for the Octokit client

Open awendt opened this issue 3 years ago • 12 comments

Is your feature request related to a problem? Please describe.

I just ran into a problem where a call to the Github API unexpectedly returned a 404 error. This failed our workflow. The error was intermittent and wasn't reproducible when I re-ran the job.

Describe the solution you'd like

I'd like any API calls made by the github client to be retried, preferably using the retry plugin

Describe alternatives you've considered

I've considered adding the retry logic to our workflow but this defeats the purpose of having a pre-authenticated API client.

awendt avatar Nov 30 '20 10:11 awendt

This issue is stale because it has been open for 60 days with no activity. Remove the "Stale" label or comment on the issue, or it will be closed in 7 days.

github-actions[bot] avatar Jan 30 '21 00:01 github-actions[bot]

This issue is stale because it has been open for 60 days with no activity. Remove the "Stale" label or comment on the issue, or it will be closed in 7 days.

github-actions[bot] avatar Apr 04 '21 00:04 github-actions[bot]

This issue has been marked as stale and closed due to no activity on it.

github-actions[bot] avatar Apr 11 '21 01:04 github-actions[bot]

Since not all consumers may want this behavior, we could support it behind an optional input

  enable-retries:
    description: Whether to use the retry plugin to retry GitHub requests
    default: false

joshmgross avatar Nov 02 '21 18:11 joshmgross

@joshmgross we're hitting rate-limiting in our GitHub action. Would definitely use retry plugin if it was available.

andris-zalitis avatar Nov 16 '21 17:11 andris-zalitis

This issue is stale because it has been open for 60 days with no activity. Remove the "Stale" label or comment on the issue, or it will be closed in 7 days.

github-actions[bot] avatar Jan 16 '22 00:01 github-actions[bot]

I'm not sure retry plugin would help for rate limiting, but similarly would be great to have an option to enable throttling plugin, as well.

sarkis avatar Feb 03 '22 16:02 sarkis

Would like to see retry capability also

MichaelJJ avatar Feb 11 '22 17:02 MichaelJJ

👍

ghost avatar Feb 28 '22 17:02 ghost

See also #229

jsoref avatar Apr 03 '22 05:04 jsoref

Until this is officially supported, we have achieved the same by using the wrap hook, here's a great example from @gr2m: https://github.com/octokit/octokit.js/issues/1069#retry

markmssd avatar Apr 04 '22 13:04 markmssd

@markmssd Thanks for this! Looks like this would solve our problem. I'd be in favor of closing this then.

awendt avatar Apr 20 '22 07:04 awendt

👋 This is now available in v6.3.0, thanks @luketomlinson for the implementation 🙇

See https://github.com/actions/github-script/tree/v6.3.0#retries for more information

I'll bump the v6 to point to v6.2.0 tomorrow.

joshmgross avatar Sep 26 '22 21:09 joshmgross