npm / benchmarks

The npm CLI's benchmark suite

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update ci.yml to send correct payload information to benchmark repo

mikemimik opened this issue · comments

Currently we have to run the following line to get the benchmark suite to work. The https://github.com/npm/cli repo has to send a request to this repository which is private, which means auth is needed.

https://github.com/npm/cli/blob/latest/.github/workflows/benchmark.yml#L38

Changing this repository to public should negate the need for auth. Allowing this request to just be sent.

Testing

  • should be able to validate this with just some curl requests

Made the repo public. Still need to validate that the npm/cli project doesn't need to send the authorization headers

Situation

With regards to fixing the npm/benchmarks repo so that all pull-requests (specifically those created by those in the community) will have the suite run against them.

The dispatch endpoint is an authenticated endpoint, so you have to send a request that has a Personal Access Token (PAT) attached to it. The PAT needs to be from an account that has access to the repo, even though the repo is public. I suppose this makes sense otherwise anyone could trigger the events that you're repository is relying on.

This does mean that only pull-requests that are opened in the npm/cli repo will trigger the benchmarks. If we're okay this this, it just means that the release-x.y.z branch needs to have a pull-request created for it, so that the benchmark suite will run. If we do care that contributed pull-requests have the suite run, then we'll need to come up with a solution.

Suggestion

This should be broken out into a separate ticket/story, for now. Making the repository public was the hypothesis to supporting community pull-requests. While not the case, this repository can (and should) still remain public.

Possible Solution

A GitHub App that we own running on a server somewhere (heroku?), which does this dispatching for us. The npm/cli repo just needs to have a webhook setup that upon a pull-request to send that POST to the GitHub App. The app then does what the GitHub Action used to do, which is send a dispatch to the https://api.github.com/repos/npm/benchmarks/dispatch endpoint.