ProjectEvergreen / greenwood

Greenwood is your workbench for the web, embracing web standards from the ground up to empower your stack from front to back.
https://www.greenwoodjs.io
MIT License
96 stars 9 forks source link

increase or avoid rate limiting for init package #1078

Open thescientist13 opened 1 year ago

thescientist13 commented 1 year ago

Type of Change

Enhancement

Summary

As happens from time to time in our on test runs, the init package specs will fail due to rate limiting errors from GitHub. https://github.com/ProjectEvergreen/greenwood/actions/runs/4319688372/jobs/7539138955

2504 passing (4m)
[3700](https://github.com/ProjectEvergreen/greenwood/actions/runs/4319688372/jobs/7539138955#step:7:3701)
  28 pending
[3701](https://github.com/ProjectEvergreen/greenwood/actions/runs/4319688372/jobs/7539138955#step:7:3702)
  1 failing
[3702](https://github.com/ProjectEvergreen/greenwood/actions/runs/4319688372/jobs/7539138955#step:7:3703)

[3703](https://github.com/ProjectEvergreen/greenwood/actions/runs/4319688372/jobs/7539138955#step:7:3704)
  1) Scaffold Greenwood From a (Blog) Template: 
[3704](https://github.com/ProjectEvergreen/greenwood/actions/runs/4319688372/jobs/7539138955#step:7:3705)
       default blog template
[3705](https://github.com/ProjectEvergreen/greenwood/actions/runs/4319688372/jobs/7539138955#step:7:3706)
         "before all" hook in "default blog template":
[3706](https://github.com/ProjectEvergreen/greenwood/actions/runs/4319688372/jobs/7539138955#step:7:3707)
     Error: the string "HTTPResponseError: HTTP Error Response: 403 rate limit exceeded\n    at checkStatus (file:///home/runner/work/greenwood/greenwood/packages/init/src/index.js:161:17)\n    at file:///home/runner/work/greenwood/greenwood/packages/init/src/index.js:165:67\n    at processTicksAndRejections (node:internal/process/task_queues:96:5)\n    at async getTemplates (file:///home/runner/work/greenwood/greenwood/packages/init/src/index.js:165:21)\n    at async listAndSelectTemplate (file:///home/runner/work/greenwood/greenwood/packages/init/src/index.js:186:21)\n    at async run (file:///home/runner/work/greenwood/greenwood/packages/init/src/index.js:252:7) {\n  response: Response {\n    size: 0,\n    timeout: 0,\n    [Symbol(Body internals)]: { body: [PassThrough], disturbed: false, error: null },\n    [Symbol(Response internals)]: {\n      url: 'https://api.github.com/orgs/ProjectEvergreen/repos',\n      status: 403,\n      statusText: 'rate limit exceeded',\n      headers: [Headers],\n      counter: 0\n    }\n  }\n}\n" was thrown, throw an Error :)
[3707](https://github.com/ProjectEvergreen/greenwood/actions/runs/4319688372/jobs/7539138955#step:7:3708)
      at runMicrotasks (<anonymous>)
[3708](https://github.com/ProjectEvergreen/greenwood/actions/runs/4319688372/jobs/7539138955#step:7:3709)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)

Details

Not the project is that large, but suppose if enough users start running the init workflow, then they would potentially be susceptible to this as well, so would like to see what the limits are, if using a token would help, and try and just mitigate this prior to a 1.0 release.


There is a PR to adopt the GitHub "client" which was closed, which maybe could help? See #886