-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: use retry and throttle octokit plugins #487
Merged
gr2m
merged 14 commits into
semantic-release:master
from
achingbrain:fix/use-retry-and-throttle-plugins
May 27, 2023
Merged
Changes from 3 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
fa3e386
fix: use retry and throttle octokit plugins
achingbrain cc2d192
Merge remote-tracking branch 'upstream/master' into fix/use-retry-and…
achingbrain 97c3a42
Merge remote-tracking branch 'upstream/master' into fix/use-retry-and…
achingbrain 4d747fc
chore: apply suggestions from code review
achingbrain fe07975
Merge remote-tracking branch 'upstream/master' into fix/use-retry-and…
achingbrain e9a8f38
Merge branch 'master' into fix/use-retry-and-throttle-plugins
gr2m 94fe3f3
build(deps): replace `@ocotkit/rest` with `@octokit/core` to minimize…
gr2m db2c425
build(package): lock file
gr2m fe7a5c9
retry on 422s and add comment that we explicitly DO want to retry on …
gr2m 2cc806c
refactor: use `octokit.request` instead of REST API methods that do n…
gr2m 9457f8c
remove default value from retry conf, it is already set in octokit
gr2m 182b821
refactor get-client for easier mocking in testing
gr2m aea4373
test: adapt tests
gr2m eb51fac
build(package): lock file
gr2m File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* Default exponential backoff configuration for retries. | ||
*/ | ||
const RETRY_CONF = { | ||
retries: 3, | ||
retryAfterBaseValue: 1000, | ||
doNotRetry: [400, 401, 403], | ||
}; | ||
|
||
module.exports = {RETRY_CONF}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/** | ||
* Default exponential backoff configuration for retries. | ||
achingbrain marked this conversation as resolved.
Show resolved
Hide resolved
|
||
*/ | ||
const THROTTLE_CONF = {retryAfterBaseValue: 1000}; | ||
|
||
module.exports = {THROTTLE_CONF}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After switching to your branch (thanks for that) we still see rate-limits, but they always seem to return with a 403.
Any reason why 403s where excluded?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, maybe that's the issue I ran into. I noticed that rate limiting wasn't retrying. I should look at those bugs in the core retry plugin to see if those can be patched.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if you still use the instruction provided in #487 (comment), but for us it started to work after actually defining an override in our
package.json
:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the secondary rate limit error is caused by this: octokit/plugin-throttling.js#454
This may be a short-term solution - #487 (comment) but I think it'll turn off the (rather nice) feature that adds a comment to each PR in a given release saying "this PR is included in release version XXX"