Repository navigation
Separate metadata and archive hash policies - #21549
Conversation
f8a2d37 to
58f33c1
Compare
58f33c1 to
9f01084
Compare
9f01084 to
651738f
Compare
651738f to
41dda0e
Compare
| /// The context in which hashes should be generated. | ||
| /// Hash requirements accompanying a distribution metadata lookup. | ||
| /// | ||
| /// These concern the distribution archive, not a hash of the metadata. |
There was a problem hiding this comment.
Are you commenting on the way it's phrased, or the actual content of what it's saying?
There was a problem hiding this comment.
Sorry just driving by randomly at night... uhh I'm confused that it says this on the MetadataHashRequest and don't understand what it means in that context
uv test inventory changesThis PR changes the tests when compared with the
|
41dda0e to
dcd65a2
Compare
EliteTK
left a comment
There was a problem hiding this comment.
I think maybe if the naming was "...Policy" rather than "...Request" then this would be better. I still think this stuff is confusing, but I'd say that this does seem like somewhat of an improvement.
I haven't seen the follow up PR yet so this stuff might make more sense later.
| #[derive(Debug, Default, Clone, Copy, PartialEq, Eq)] | ||
| pub struct MetadataHashRequest<'a> { | ||
| /// Which missing hashes to collect for the resolution. | ||
| pub collection: Option<HashCollection>, |
There was a problem hiding this comment.
pre-existing: It feels kind of weird that we have some things with ::None variants and here HashCollection doesn't and ends up in an Option.
dcd65a2 to
1e491b4
Compare
Summary
HashPolicycurrently carries both resolution-wide hash collection settings and requirements for a specific archive. We split those intoMetadataHashPolicy, with collection and validation fields, andArchiveHashPolicy, which describes the hashes an archive must provide.The distribution database selects the archive policy. Expected hashes continue to take precedence over collection.
Preparation for #21279, which adds URL-hash reuse on top of this refactor.