-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use new createrepo_c API to simplify code #3461
base: main
Are you sure you want to change the base?
Conversation
363da96
to
9477131
Compare
9477131
to
2e3e630
Compare
Found a bug, blocked: rpm-software-management/createrepo_c#426 |
general = checksum_types.get("general") | ||
metadata = checksum_types.get("metadata") | ||
# fallback order | ||
checksum_type = general or metadata or original.get(name) or default | ||
checksum_type = general or metadata or default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's safe to ditch this "original checksum" logic. I think the idea was to publish using the same checksums that the metadata had when it was synced. I don't know that it's particularly valuable now that we've started phasing out the legacy checksum types. The code was added back in 2020
In any event, it's a bit silly to do that for the checksum but not the compression type
@ggainey Can you think of any particular reason why we might want to prefer the original checksum types over the default of sha256?
Or maybe we shouldn't get rid of this entirely, but we can merge it into last_sync_details
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So first, to make sure I'm understanding what we're doing here - original_checksum_types holds the type-of-checksum that repomd.xml declared each metadata file was summed-with, as of last-sync. Since we always "have" the metadata files post-sync, no matter what mode was used, we will always have sha256 available.
This is only used when publishing, correct?
If we're doing a full-mirror-sync, we don't recreate the metadata files - we just use whatever is there.
On the one hand - it's probably safe to remove this. On the other - the cost of carrying it is low, and every single time we have "cleaned up" code involving "old checksum decisions nobody will ever need in Pulp again", we've ended up having to put it back.
So my take is, "the code works as-is and the benefit from cleaning it up is...minimal". I'd leave it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cost in this case is that the API we want to use doesn't support picking the checksum on a per file basis. So it's either get rid of it or don't do this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK that def changes the math :) Using the new API is demonstrably preferable, not-using "original" is unlikely to impact us. If we take your initial uggestion (store into last_sync_details), then we have the info available if anyone cares (or, more important.y, we decide we have to "fix" something...)
2e3e630
to
62121de
Compare
62121de
to
33eb14b
Compare
33eb14b
to
f36170e
Compare
96f5c49
to
302bb10
Compare
302bb10
to
94aa18b
Compare
b3abdbe
to
e343134
Compare
The new API can't handle it - it's also largely not relevant anymore. [noissue]
e343134
to
bca2f99
Compare
Zero-downtime migrations make things difficult [noissue]
[noissue]