Use a hash as id/ unicity key for MetadataFetcher and MetadataAuthority
These two model objects are currently used in a weird way, in that if they have their metadata
attribute set to None
they are used as IDs (eg. as attributes in RawExtrinsicMetadata objects), and otherwise they are actual objects.
So we should move to a different scheme. The obvious solution is to use a 2-tuple, but I think instead we should use a hash of all their fields (resp. name+version+metadata and type+url+metadata), because:
- it would be consistent with other model objects, which use a hash of (almost) all their fields
- it allows having different metadata for the same authority or fetcher. I don't yet see a use for authorities, but for fetchers it would allow multiple fetcher configurations with the same fetcher name+version.
- (as a consequence of the previous point) it would be consistent with indexer "tools", which include the indexer config in the unicity key
- it would solve #2686 as a side-effect
Migrated from T2704 (view on Phabricator)