purescript / registry-dev

Development work related to the PureScript Registry
https://github.com/purescript/registry
95 stars 80 forks source link

Proxy GitHub issue API calls to the registry server #649

Open thomashoneyman opened 1 year ago

thomashoneyman commented 1 year ago

Now that we have a registry server available at https://registry.purescript.org we can have GitHub jobs initiated via GitHub issues skip running a full build in GitHub Actions and instead proxy them to the registry server. The GitHub job can be a simple script (not even written in PureScript) that sends the request to the registry server, polls for logs, and — upon encountering a new log message — comments on the GitHub issue with that message.

This has a few advantages:

  1. It allows us to test the registry server more thoroughly, since jobs are actually hitting the server
  2. It allows us to tear out some of the GitHub-specific code and treat the GitHub issues as just another "package manager"
  3. It allows us, if we wish, to tear out the Nix setup for GitHub Actions and just use basic built-in functionality to send the request and process results. A node script, for example, would get the job done just fine, and we don't have to bother managing things like caches on GitHub.
  4. It will be faster since we don't have to build the whole registry-dev repository and load in its Nix dependencies before processing user issues — we can just immediately send off the request.
  5. It allows us to disable concurrent jobs, manage the number of package sets releases per day, and otherwise control the incoming jobs we have instead of being forced into the independent actions workflows done by GitHub.

We don't have to move entirely off of Actions; we can, for example, still use it to initiate processes like the legacy importer. It's just that the processing itself will happen on the server.