chore: update @octokit/rest from v16 to v17#371
Conversation
This is a prerequisite for updating @octokit/rest.
|
@nodejs/github-bot |
| const res = await githubClient.pulls.listCommits({ | ||
| async function findLatestCommitInPr (options) { | ||
| const { Octokit } = require('@octokit/rest') | ||
| const githubClient = new Octokit({}) |
There was a problem hiding this comment.
Was it deliberate to not use githubClient from line 3?
There was a problem hiding this comment.
That was probably a blunder. Sorry about that!
There was a problem hiding this comment.
Is this why we're hitting rate limits? The github-bot logs now have lots of "API rate limit exceeded for 23.253.100.79. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)" errors, e.g.
{"name":"bot","hostname":"infra-rackspace-debian8-x64-1","pid":15899,"req_id":"e62c49d0-bbaa-11ed-9410-77b81a7c3334","identifier":"node-test-linux-ubuntu1804-64","event":"end","level":50,"err":{"message":"API rate limit exceeded for 23.253.100.79. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","name":"HttpError","stack":"HttpError: API rate limit exceeded for 23.253.100.79. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)\n at /home/iojs/github-bot/node_modules/@octokit/request/dist-node/index.js:86:21\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (internal/process/task_queues.js:93:5)\n at async Object.next (/home/iojs/github-bot/node_modules/@octokit/plugin-paginate-rest/dist-node/index.js:112:28)\n at async findLatestCommitInPr (/home/iojs/github-bot/lib/push-jenkins-update.js:88:23)","code":403},"msg":"Error while handling Jenkins end event","time":"2023-03-05T23:10:20.025Z","v":0}There was a problem hiding this comment.
Ugh, sending a PR momentarily. I wouldn't have realized this would caused this kind of problem. Sorry about that.
There was a problem hiding this comment.
Thanks for opportunity to learn why Github requests better be authenticated 👍🏻
| const commitsFixturePage1 = readFixture('pull-request-commits-page-1.json') | ||
| const commitsFixturePage2 = readFixture('pull-request-commits-page-2.json') | ||
| const commitsFixturePage3 = readFixture('pull-request-commits-page-3.json') | ||
| const commitsFixturePage4 = readFixture('pull-request-commits-page-4.json') |
There was a problem hiding this comment.
Hooray for tests being maintained and adjusted accordingly
|
@Trott sorry for the late reply, hectic week on my end... Looks promising from a distance 👍🏻 |
|
No worries, as long as it works. I was mostly asking in case it was a
workaround for whatever reason.
EDIT: this was supposed as a reply to #371 (comment), email reply's not always ideal.
|
Replace deprecated .hasLastPage() with pagination. This enables us to bump @octokit/rest from v16 to v17.