mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
16f-UPSTREAM-REPO (#8261) gave every container-backed format its own repository-to-repository upstream importer except cargo, since cargo didn't exist yet when that PR merged. Adds cargo's own share of it. CodeArtifactCargoUpstreamRepositoryImporter mirrors CodeArtifactNuGetUpstreamRepositoryImporter's own claim/fence/walk shell (transitive search via resolveUpstreamSearchOrder, Archived/Disposed propagation, falling through to UpstreamExternalConnectionFetch for the last leg through a candidate's own external connection), reusing CodeArtifactCargoExternalConnectionImporter's own index-line/wire-body helpers directly rather than duplicating the index-shape to publish-shape mapping a second time. The one new piece: mergeUpstreamRepositoryVersions, a real multi-version sparse-index merge across the whole upstream chain, the same reason mergeExternalVersions exists for the external-connection side. Unlike pypi's own single-target additionalInternalFilenames, this walks every reachable upstream candidate in search order rather than stopping at the first one with anything to offer, since it is merging real version lines across however many hops the chain has; each candidate's own external connection, if it has one, is layered in too via a direct mergeExternalVersions call with that candidate as the repository argument. Wired into CodeArtifactCargoController's existing two call sites, matching every sibling controller's own "external connection or upstreams, never both" shape. A live Docker integration test proves the real synthesized wire body this importer builds from one Kellnr container's own sparse-index line is accepted by a second, genuinely different Kellnr container, not just internally consistent against mocks.