-
Notifications
You must be signed in to change notification settings - Fork 36
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
Replace 'abuse limit' with 'secondary limit' #455
Conversation
This would be a breaking change, let's deprecate the "abuse" named methods and add new secondary rate limit named methods. We can then remove these in a new major version once the new team is in place. |
97330ae
to
4f81504
Compare
e45018d
to
a36302d
Compare
src/index.ts
Outdated
deprecate( | ||
state.onAbuseLimit, | ||
"'onAbuseLimit' is deprecated, use 'onSecondaryRateLimit' instead" | ||
) |
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.
@wolfy1339
This is the method you expected to be deprecated right?
Is util/deprecate
good in this case??
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.
This is the method you expected to be deprecated right?
Yes
Is
util/deprecate
good in this case??
That's a NodeJS only function. Octokit can be run in a browser environment.
Take example from this commit:
octokit/webhooks.js@f8f3d15
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.
Change applied.
For the @deprecated
annotation I think it has sense to improve types for octokitOptions
so we can mark it as deprecated. What do you think @wolfy1339 ?
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.
Drafted a PR here: #457
src/index.ts
Outdated
minimumAbuseRetryAfter: 5, | ||
minimumSecondaryRateRetryAfter: 5, |
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 decided to replace property minimumAbuseRetryAfter
with minimumSecondaryRateRetryAfter
. I assume the plugin is in control of it and it's not expected to be passed as an option by the user.
Is my assumption correct?
@@ -98,7 +102,14 @@ export function throttling(octokit: Octokit, octokitOptions = {}) { | |||
const events = {}; | |||
const emitter = new Bottleneck.Events(events); | |||
// @ts-ignore | |||
events.on("abuse-limit", state.onAbuseLimit); | |||
events.on( | |||
"secondary-limit", |
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'm assuming secondary-limit
event will be sent from the L145 (so we have full control of the name). Is that correct or it should be listening to both (["abuse-limit", "secondary-limit"]?
4231afb
to
7241f93
Compare
docs(secondary-limits): replace 'abuse-limits' with 'secondary-limits'
7241f93
to
872d4a1
Compare
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.
Looks good to me
you merged it to Sorry for the late response, I don't have much time right now to help with Octokit 😫 |
Interesting. I'm going to take a look on why that happened. Commits look good to me in terms of semantic.
I think we did the
Once a week I have time to contribute to OSS. I have time tomorrow CET so... no problem 😉. I'm here to help and learn.
No worries at all. Whenever you have time is fine, no rush. |
when you use "Squash & Merge", then the commit message defaults to the pull request title, if there is more than one commit.
oh okay if you already have deprecation than it's all good. I think I usually use |
True. What's the process when we commit this mistake?
Since we need to fix the commit message + release I can include |
Good question, we should document that, probably at https://github.com/octokit/octokit.js/blob/main/CONTRIBUTING.md#maintainers-only? I would create an empty commit with the correct commit message & body, that will trigger the release without making any code changes |
🎉 This PR is included in version 3.6.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
GitHub renamed `abuse limits` to `secondary rate limits` in 2021: https://docs.github.com/en/rest/overview/resources-in-the-rest-api#secondary-rate-limits `@octokit/plugin-throttling` followed suit in March 2022, and released version `3.6.0` with this new name (and deprecated `onAbuseLimit`): octokit/plugin-throttling.js#455 This commit updates the README file to use the new name.
GitHub renamed `abuse limits` to `secondary rate limits` in 2021: https://docs.github.com/en/rest/overview/resources-in-the-rest-api#secondary-rate-limits `@octokit/plugin-throttling` followed suit in March 2022, and released version `3.6.0` with this new name (and deprecated `onAbuseLimit`): octokit/plugin-throttling.js#455 This commit updates the codebase to use the new name.
Fixes #439