-
Notifications
You must be signed in to change notification settings - Fork 140
refactor: to use octokit throttling plugin #378
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
Conversation
lib/get-client.js
Outdated
auth: `token ${githubToken}`, | ||
baseUrl, | ||
request: { | ||
retries: RETRY_CONF.retries, |
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.
why did you set that? I don't think that is right, it's set dynamically by the throttling plugin.
Removing it fixes the "Throw SemanticReleaseError for invalid token" error
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 think other tests were failing when I did not set that. Tbh, it was through denial and error.
Refactors the client to use [@octokit/plugin-retry](https://www.npmjs.com/package/@octokit/plugin-retry) and [@octokit/plugin-throttling](https://www.npmjs.com/package/@octokit/plugin-throttling) as GitHub occasionally changes it's API and these plugins can abstract those changes away from this module. - Removes `lib/definitions/rate-limit.js` - Adds `lib/definitions/retry.js` and `lib/definitions/throttle.js` to handle retry/throttle settings - Updates tests to be more like GitHub (returing the correct rate limit response headers, etc) Fixes semantic-release#299 and semantic-release/semantic-release#2204 See also semantic-release#480 and semantic-release#378
This is still WIP, but I need help.
get-client
is failing, but I am not sure if they still make sense, given that we are switching to the plugin, which handles all of the logic. See below. Thoughts?nock
and hitting live endpoints? Or maybe it is just the throttling/retry that does that.Closes #377