Make the set of Acquire-By-Hash algorithms configurable - #1626
Open
barnumbirr wants to merge 3 commits into
Open
Make the set of Acquire-By-Hash algorithms configurable#1626barnumbirr wants to merge 3 commits into
barnumbirr wants to merge 3 commits into
Conversation
Acquire-By-Hash entries are written for MD5Sum, SHA1, SHA256 and SHA512,
hardcoded in two places in deb/index_files.go. Every algorithm is a full
set of index copies on each publish, and on S3-like storage each of those
is a network round trip rather than a link.
Measured on an R2-backed archive of 25 packages across three suites, one
`aptly publish update` per suite:
Acquire-By-Hash off 38 S3 requests
Acquire-By-Hash on 222 S3 requests (88 HeadObject, 83 CopyObject,
35 DeleteObject, 13 PutObject)
Modern apt verifies with SHA256; MD5Sum and SHA1 are deprecated and
Debian has been phasing them out of Release files for years. Publishers
who do not need them are paying three quarters of that for nothing, with
no way to say so.
acquireByHashAlgorithms in aptly.conf now selects the set. An empty or
absent value keeps all four, so existing configurations are unaffected.
The order entries are written in comes from the code rather than the
config, so the directories created in one loop and the entries written in
another cannot disagree. An unrecognised name is an error rather than
something to skip: skipping a typo would produce "no by-hash entries for
that algorithm", which looks exactly like having configured it away.
Set per publish invocation from the config, the way SkipBz2 already is,
rather than persisted on the publish point.
Pre-existing test failures on this tree are unchanged by this commit:
deb goes 173->177 passed with the same 11 failures, utils keeps its one
(TestCompress), s3 stays green.
ConfigShowTest snapshots the output of `aptly config show`, which now carries acquireByHashAlgorithms with its default. The other three system files mentioning "architectures" are inputs rather than expected output, which is why only this one test failed.
Same reason as the JSON one: ConfigShowYAMLTest snapshots `aptly config show` in YAML form. Checked all three gold files under t02_config this time rather than the one CI named. CreateConfigTest_gold is a commented template rather than struct output, so it is unaffected, and it passes.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1626 +/- ##
==========================================
- Coverage 77.37% 77.09% -0.29%
==========================================
Files 165 165
Lines 15747 15780 +33
==========================================
- Hits 12185 12165 -20
- Misses 2356 2411 +55
+ Partials 1206 1204 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the Change
Acquire-By-Hash entries are written for
MD5Sum,SHA1,SHA256andSHA512,hardcoded in two places in
deb/index_files.go. Every algorithm is a full set ofindex copies on each publish, and on S3-like storage each of those is a network
round trip rather than a link.
Measured on an R2-backed archive of 25 packages across three suites, one
aptly publish updateper suite, counted at the storage backend:HeadObject, 83CopyObject, 35DeleteObject, 13PutObjectModern apt verifies with SHA256; MD5Sum and SHA1 are deprecated and Debian has
been phasing them out of
Releasefiles for years. Publishers who do not needthem are paying three quarters of that for nothing, with no way to say so.
acquireByHashAlgorithmsinaptly.confnow selects the set:Design notes
unaffected and the default behaviour is unchanged.
one loop and the entries written in another; taking the order from the config
would let those two disagree.
would produce "no by-hash entries for that algorithm", which is
indistinguishable from having configured it away.
SkipBz2already is,rather than persisted on the publish point.
Independent of #1625
This touches no file that #1625
touches — that one is confined to
s3/public.go. Both branch frommasterandcan merge in either order.
Checklist
deb/index_files_test.gocovers the default, the configured set, the fixed ordering, and rejection
of unknown names
if you point me at the right fixture
man/aptly.1.ronn.tmpland the generatedman/aptly.1Test state
This tree has pre-existing failures unrelated to the change; they are unchanged
by it:
debutilsTestCompress)s3