Repository navigation
Mirror Composer releases - #594
Merged
Merged
Conversation
Mirroring a PyPI version passed each file's sha256 as the integrity GetOrFetchArtifactFromURLWithIntegrity records with the version. Wheels of one version share the name and version they are cached under, so the last file's checksum replaced the others', and serving the other wheels from the cache failed the integrity check. The mirror now passes the sha256 as a digest, which is checked against that file's content hash alone.
A conda version is mirrored with every build anaconda.org lists for it, each cached under the channel, name, version and subdir/filename the conda download handler reads from its path. The channel comes from the namespace or the channel qualifier; a package without one is refused, as retention keys without one are. The subdir, build and type qualifiers select builds. Which files a version has, which qualifiers select them and where the handler caches them is now described per ecosystem, so PyPI and conda share mirrorFiles. Part of git-pkgs#414.
Mirroring pkg:composer failed with unsupported ecosystem. A tagged release is now mirrored with the dist archive upstream.composer lists, under the file name the Composer handler serves it as and checked against the listed shasum. The release's publish time is stored as the handler stores it, so the archive is served from the cache without the metadata, with cooldown on as well. Branches are refused, since the handler reads the metadata for every branch download, and so are archive URLs with a query and packages in upstream.composer_routes. The mirror now finds the whole version rather than its files, for the dist type and publish time. Part of git-pkgs#414.
This was referenced Oct 25, 2026
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.
Part of #414. Builds on #593 (and #592); the last commit is this PR.
Mirroring
pkg:composer/...failed withunsupported ecosystem. A tagged release is now mirrored with the dist archiveupstream.composerlists:/composer/files/{vendor}/{package}/{version}/{file}serves it as, using the handler'sdistFilename;serveCachedReleaseserves the archive without the metadata, with cooldown on too.Refused, with a message saying why:
dev-main): the handler reads the metadata for every branch download, so a mirrored archive wouldn't be served offline;upstream.composer_routes. The old message said "give a version", which doesn't help there.FileListerbecameVersionFinder, which returns the whole version, since Composer needs the dist type and publish time.Tested through the mirror and the Composer handler with the upstream closed and cooldown on (
internal/server/mirror_composer_test.go); that test fails without the stored publish time. Against packagist.org I mirroredpsr/log@3.0.2andmonolog/monolog@3.8.1and served both withupstream.composerunreachable and a 3d cooldown.