Package loaders should write extrinsic metadata on directories instead of revisions/releases
Currently, loaders write release metadata on revision objects (and we were planning to write to release objects after swh/devel/experiments/swh-db-audit#1258 (moved) is solved)
However, @rdicosmo pointed out that writing the metadata on directories would make them more useful, so they can be accessed without knowing the hash of the synthetic revision, using the hash of the directory (which is an intrinsic id)
There is an issue to work around before we can do this: if two releases have the exact same directory, the loader would write both metadata with the same discovery date on the same directory. So one would be lost, because (id, discovery_date, authority, fetcher)
is a unique index on the MD storage. But we need a way to keep both metadata.
Possible solutions:
- change the semantics of discovery date, so both entry have a different one
- add contexts in the MD storage's unique key
- use a different unique key altogether (perhaps a randomly generated UUID)
none of these solutions seems great IMO
Migrated from T2668 (view on Phabricator)