flora-pm / flora-server

A package index for the Haskell ecosystem
https://flora.pm/about
Other
124 stars 38 forks source link

Becoming aware of revisions #436

Closed tchoutri closed 11 months ago

tchoutri commented 11 months ago

When we fetch the upload date of a release, it's actually the upload date of the latest revision. It would be interesting to keep the original upload date and show revision dates.

When we get the JSON payload from the Hackage API for https://hackage.haskell.org/package/text-2.0.2.json:

{
  "author": "Bryan O'Sullivan <bos@serpentine.com>",
  "copyright": "2009-2011 Bryan O'Sullivan, 2008-2009 Tom Harper, 2021 Andrew Lelechenko",
  "description": "…",
  "homepage": "https://github.com/haskell/text",
  "license": "BSD-2-Clause",
  "metadata_revision": 1,
  "synopsis": "An efficient packed Unicode text type.",
  "uploaded_at": "2023-07-10T19:55:59.951986162Z"
}

We see that this is revision n°1. We could do a GET on https://hackage.haskell.org/package/text-2.0.2/revision/0.json and get:

{
  "author": "Bryan O'Sullivan <bos@serpentine.com>",
  "copyright": "2009-2011 Bryan O'Sullivan, 2008-2009 Tom Harper, 2021 Andrew Lelechenko",
  "description": "…",
  "homepage": "https://github.com/haskell/text",
  "license": "BSD-2-Clause",
  "metadata_revision": 0,
  "synopsis": "An efficient packed Unicode text type.",
  "uploaded_at": "2023-02-21T01:05:57.01631844Z" <-- original upload date
}

Thus, storing the latest revision upload date and the original upload date.