purescript / registry-dev

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

Add ability to republish a package if Pursuit previously failed #604

Closed thomashoneyman closed 1 year ago

thomashoneyman commented 1 year ago

Fixes https://github.com/purescript/registry-dev/issues/343. In that issue we talked about three possible failure cases:

  1. We published metadata but the tarball never made it to the storage backend
  2. We published the tarball but the Pursuit docs failed
  3. We published the tarball and Pursuit docs but failed to add the package to the package sets

Of these three original concerns, only the second is really relevant.

  1. We only publish the metadata if the tarball already made it to the storage backend, so you can already retry.
  2. This PR!
  3. The package sets are now independent of the publishing workflow, and if a package failed to be added there's the manual endpoint for re-attempting adding the package to the package sets.

We have some cases where a package fails to be added to Pursuit and, other than Pulp, there's currently no way to retry. In this PR I branch the publish workflow with the following process:

When you publish a package, we check whether the version has already been published. If not, then we go through the normal publishing workflow. If so, then we check whether the docs made it to Pursuit. If not, then we retry only the Pursuit publishing process (we don't repackage the tarball). If so, then we terminate publishing and provide you a link to your published documentation and post the metadata.