haskell / haskell/hackage-server

Implement package candidate/published lifecycle

Open
#558 6 comments 5 reactions 1 assignee Claimed by @hvr View on GitHub
component: candidates
Dominant language
Haskell
Stars
467
Forks
225
PR merge metrics
No merged PRs in 30d

Description

Give we're moving toward a scheme were packages are uploaded as candidates rather than published directly to the index (c.f. https://github.com/haskell/cabal/issues/3931) we need to make sure that candidates don't pile up.

The usual workflow:
1. upload package candidate
2. inspect package candidate preview on hackage
3. repeat 1./2. until satisfied with outcome
4. publish candidate (either by Web UI or by `cabal upload --publish`)
5. delete candidate (either by Web UI or by CLI tooling which isn't widespread)

Step 5. is just busy work and gets easily forgotten

We could either address this in `cabal` by having it delete the candidate when using `cabal upload --publish`, but that wouldn't address the WebUI code-path.

So instead we should enforce the following invariant server-side:
- **A package version shall never exist both as published and candidate.**

Or put differently, a package version shall only be in one of 3 states:
- non-existent (initial state; -> {candidate, _published(*)_})
- candidate (-> {non-existent, published, candidate})
- published (final state)

_(*) going straight from non-existent to published will be restricted in future for new package names (c.f. #481)_

Expressed operationally, this could mean:
- when a package is published and there exists a candidate, said candidate shall be auto-deleted
- uploading a candidate version for an already published package version shall be rejected

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.