mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 06:00:46 -05:00
CopyPackageVersions only covered the generic format; maven, npm, pypi, and nuget each publish straight to their own sidecar and keep no packageVersions record this action could read from or write to. Bridges all four, each confirmed live against a real container: maven reuses Reposilite's existing mvn-deploy write path, while npm/pypi/nuget each speak their own real wire protocol directly (Verdaccio's packument PUT, pypiserver's twine-shaped multipart upload, and BaGetter's NuGet push), the same protocol each format's own data-plane proxy already forwards unmodified for a native client. CopyPackageVersions now supports every format CodeArtifact does, matching real AWS, which places no format restriction on this action at all. An overwrite deletes a conflicting existing asset immediately before rewriting it for every format, since each sidecar rejects a plain overwrite of differing content; a best-effort compensating cleanup restores or removes whatever one version's write itself touched if a later step in that same version fails, preserving the original error. A copied Maven version is also merged into the destination's maven-metadata.xml so real clients can discover it, and copied bytes feed the same byte-accounting mechanism native publishes already use. A copied npm or pypi version's readme is propagated from this service's own captured-at-publish-time record, since neither sidecar can answer for one after the fact. The synthesized revision for every container-backed format is truncated to fit versionRevisions' own 50-character limit, so a revision obtained from DescribePackageVersion can be handed straight back into a revision-pinned copy. Also closes a cross-version batch-write gap: source assets are verified against the real sidecar before any destination write in the same batch, the same split the generic path already uses. Fixes two more real-sidecar quirks found on review: pypiserver's own delete call removes every file sharing a release's exact name and version, not just the one asset name it was asked to delete, so a release carrying both an sdist and a wheel lost one of them on overwrite when assets were deleted one at a time, interleaved with the writes. Every destination asset a version already holds is now deleted up front, in its own phase, before any new content is written, which changes nothing for Maven/npm/nuget since their own deletes are already scoped to exactly the asset (or, for npm/nuget, the single asset a version ever holds) being removed. An npm copy also used to rebuild a minimal version document from scratch, dropping dependencies and anything else npm's own protocol carries beyond dist; it now reuses the source's own version entry verbatim, with only dist itself rewritten to point at the copy.