Commit Graph
2877 Commits
Author SHA1 Message Date
Hansjoerg Maurer b6cb4de05d Add system test for architecture variant mirrors 2026-11-05 23:10:30 +01:00
Hansjoerg Maurer 972cf0b981 Adapt command tests to gocheck 2026-11-05 21:16:51 +01:00
Hansjoerg Maurer 8fb07c7e9c Fix lint issues in architecture variant tests 2026-11-05 21:16:51 +01:00
Hansjoerg Maurer 673b4f02d8 Use neutral fixtures in architecture variant tests 2026-11-05 21:16:51 +01:00
Hansjoerg Maurer 0bcfabcead Fix filtered mirror dependencies for architecture variants 2026-11-05 21:16:51 +01:00
Hansjoerg Maurer 2f228199c5 Fix latest package filtering by architecture 2026-11-05 21:16:51 +01:00
Hansjoerg Maurer 217fcc3d2e Fix force replace for architecture variants 2026-11-05 21:00:37 +01:00
Hansjoerg Maurer d5812148a8 Fix snapshot pull for architecture variants 2026-11-05 21:00:37 +01:00
Hansjoerg Maurer dab494ecf3 Fix API snapshot pull destination loading 2026-11-05 21:00:37 +01:00
Hansjoerg Maurer 2452dadac7 Fix architecture variant package queries 2026-11-05 21:00:37 +01:00
Hansjoerg Maurer b5096eaea9 Display architecture variants in package output 2026-11-05 21:00:37 +01:00
Hansjoerg Maurer 6efb8e17fd Publish architecture variants in separate indexes 2026-11-05 21:00:37 +01:00
Hansjoerg Maurer 915fd24d7b Test mirror support for architecture variants 2026-11-05 21:00:37 +01:00
Hansjoerg Maurer bcb34b7140 Test architecture variant package persistence 2026-11-05 21:00:37 +01:00
Hansjoerg Maurer 38290613f3 Handle architecture variants in package reference lists 2026-11-05 21:00:37 +01:00
Hansjoerg Maurer 248296ddbf Add package identity support for architecture variants 2026-11-05 21:00:37 +01:00
André Roth f72347a0a8 Merge pull request #1650 from Rascalov/mirror-update-max-versions
Add `-max-versions` to get the N most recent versions of a package.
2026-11-05 13:29:10 +01:00
André Roth 151f67a294 fix merge conflicts 2026-11-05 12:51:13 +01:00
Rascalov 300837fe06 tests: cover mirror update -max-versions in system and unit tests 2026-11-05 11:22:28 +01:00
Rascalov 0609ac257a mirror update: clarify -max-versions output 2026-11-05 11:22:28 +01:00
Rascalov 78cd0c71ca docs: document mirror update -max-versions 2026-11-05 11:22:28 +01:00
Rascalov d7e58623a9 deb: add tests for keeping the N most recent versions 2026-11-05 11:22:28 +01:00
Rascalov 5bc1047ba8 mirror update: add -max-versions to keep the N most recent versions 2026-11-05 11:21:36 +01:00
André Roth 296e901cb6 Merge pull request #1633 from barnumbirr/concurrent-index-renames
deb: rename published indexes concurrently
2026-11-04 13:38:01 +01:00
Martin Simon b80f151b6d deb: make the index rename concurrency configurable
publishRenameConcurrency (publish_rename_concurrency in YAML) sets how
many index files RenameFiles renames at once. It defaults to 4, the
value that was hard-coded, and 1 renames them one at a time. Values
below 1 are treated as 1, since a semaphore with no capacity would
never admit a rename.

The setting is global rather than per publishing endpoint because the
renames run against every storage backend, not only S3.
2026-11-04 12:24:18 +01:00
Martin Simon c531cac535 deb: rename published indexes concurrently
RenameFiles walks renameMap one entry at a time. Every rename is a round trip,
and on an S3 backend RenameFile is a CopyObject followed by a DeleteObject, so
a publish that rewrites a dozen indexes spends most of its wall clock waiting
on them in sequence.

Bounded at four in flight, matching the default used for concurrent package
uploads. The first error is returned rather than the last, and the remaining
renames still run, so a failure does not leave part of the set staged behind a
half-finished switch.

Measured against MinIO behind a proxy adding 50ms each way, publishing a
repository whose Contents is dominated by one package carrying 19,500 files:
publish update drops from 2703ms to 1624ms median, n=5 either side, a 40% cut.
The published object set and its sizes are identical before and after.

RenameFiles had no test coverage. It has four cases now: every entry renamed,
the concurrency limit respected, a failure reported without abandoning the
rest, and an empty rename map.
2026-11-04 12:24:18 +01:00
André Roth 6f95fdca32 Merge pull request #1660 from barnumbirr/complete-default-config
conf: document the config keys missing from aptly.conf and the man page
2026-11-04 12:12:19 +01:00
André Roth 5eb3a8dc93 Merge pull request #1661 from barnumbirr/fix-misspelled-config-keys
conf: fix two misspelled keys in the default aptly.conf
2026-11-04 12:10:55 +01:00
Martin Simon 5b9a1a73fa conf: document gpg_keys, and the three keys the man page lacks
gpg_keys was missing from debian/aptly.conf, and the man page had no
entry for ppaBaseURL, enablePprofEndpoint or gpgKeys. The wording
follows the existing template comments where there is one.
2026-11-03 14:01:36 +01:00
Martin Simon 8c655504d2 conf: fix two misspelled keys in the default aptly.conf
debian/aptly.conf spelled dep_follow_all_variants as
dep_follow_allvariants and dep_verboseresolve as dep_verbose_resolve.
The YAML loader ignores unknown keys, so setting either to true in a
config written from this template had no effect.
2026-11-03 13:57:08 +01:00
Martin Simon 925996b8da conf: document acquire_by_hash_algorithms in the default aptly.conf
The key added in #1626 was missing from debian/aptly.conf, which aptly
writes out as ~/.aptly.conf on first run, so new installs never saw it.
2026-11-03 13:53:52 +01:00
André Roth 519602b3e8 Merge pull request #1626 from barnumbirr/configurable-by-hash-algorithms
Make the set of Acquire-By-Hash algorithms configurable
2026-11-03 13:44:00 +01:00
Martin Simon 0fcc80db7d Add the new config key to the YAML config-show gold file
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.
2026-11-03 13:13:18 +01:00
Martin Simon 74ff0194db Add the new config key to the config-show gold file
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.
2026-11-03 13:13:18 +01:00
Martin Simon e58bab9587 Make the set of Acquire-By-Hash algorithms configurable
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.
2026-11-03 13:13:18 +01:00
André Roth db3e062edc Merge pull request #1637 from luanmdang/api-metrics-listener
api: add metrics-only listener
2026-11-03 12:52:46 +01:00
Luan Dang 0d23d32840 test: handle HEAD metrics response cleanup 2026-11-03 11:42:38 +01:00
Luan DangandCopilot Autofix powered by AI 198c801f00 Refactor TestHeadMetrics for improved testing
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-11-03 11:42:38 +01:00
Luan Dang 328120f80a api: add metrics-only listener 2026-11-03 11:42:38 +01:00
André Roth 431f75c109 Merge pull request #1646 from twaik/fix-version-split-last-hyphen
deb: split Debian revision at the last hyphen
2026-11-03 10:38:54 +01:00
André Roth 70f423adaa Merge pull request #1603 from jmunson/jmunson/enable-pprof
Expose net/http/pprof handlers
2026-11-02 20:01:01 +01:00
James Munson 2d72d1f0d5 Expose net/http/pprof handlers under /api/debug/pprof/* when the new
enablePprofEndpoint (JSON) / enable_pprof_endpoint (YAML) config option
is true. The endpoint is disabled by default.
2026-11-02 15:14:35 +01:00
André Roth 81d119f421 deb: rebase changes 2026-11-02 14:59:52 +01:00
Twaik Yont 242a0d4010 deb: split Debian revision at the last hyphen
Per Debian Policy, the version is split at the last hyphen:
https://www.debian.org/doc/debian-policy/ch-controlfields.html#version

Add tests for the ordering of '+', which is a regular non-letter sorted by its ASCII value (see Comparing version numbers on the same page).
2026-11-02 14:48:41 +01:00
André Roth eaf9453897 Merge pull request #1601 from jaymzh/debian-version
Fix version parsing, validate debian package version
2026-11-02 10:11:20 +01:00
Phil Dibowitz 21487d4b5d Fix version parsing, validate debian package version
This patch adds validation to the version pasing logic (parseVersion) to
not allow packages to be registered which apt wouldn't accept anyway.

It then propogates validation errors through CompareVersions, the way
in which parseVersion gets called, so that appropriate decisions can be
made.

New packages with invalid versions are not accepted.

For any pre-exisiting packages with invalid versions, as much care is
taken as possible to log warnings, and not use those packages.

This PR is loosely bnased on one by by Aaron Foster
<afoster@cloudflare.com> though it has largely been written at this
point.

Signed off with internal and external emails for clarity, but commit
is under personal email where we typically do open source contributions
from.

Signed-off-by: Phil Dibowitz <pdibowitz@cloudflare.com>
Signed-off-by: Phil Dibowitz <pdibowitz@ipom.com>
2026-11-01 14:25:17 -08:00
André Roth 0b55b09eb2 Merge pull request #1659 from aptly-dev/fix/tmp-suffix
publish s3: remove tmp suffix for testing
2026-11-01 17:03:11 +01:00
André Roth 10e748a097 publish s3: remove tmp suffix for testing 2026-11-01 16:14:10 +01:00
André Roth 28609a918e Merge pull request #1629 from daniel-pinder/pgp-accept-multisigned-releases 2026-11-01 14:45:00 +01:00
André Roth 29db8333c5 recreate test keys with faketime 2026-11-01 13:26:36 +01:00