HomeSoftware Heritage

npm: write metadata on revisions instead of snapshots.

Description

npm: write metadata on revisions instead of snapshots.

Writing them on snapshot allowed us to write the raw metadata from the API,
but it causes a lot of duplication; after running for only a couple of months,
the metadata storage is already 700GB in size, mostly because of these
(eg. there are 150k over 1MB each).

The metadata we wrote on snapshots was made of:

  • a 'versions' dict, whose content is moved to revisions
  • a 'time' dict, with one timestamp per version, which is used as the data of revision objects
  • 'dist-tags', which is currently ignored, but should be converted to ALIAS branches in a future commit.
  • a '_rev' property, which is internal to NPM, so not useful to archive
  • everything else can be recomputed from the metadata of the latest version.

Details