Skip to content

feat(formats): Swift, CocoaPods, Pub, CRAN, Git LFS and Eclipse p2 - #533

Merged
M0Rf30 merged 24 commits into
mainfrom
feat/formats-nexus-parity
Nov 27, 2026
Merged

M0Rf30 merged 24 commits into
mainfrom
feat/formats-nexus-parity

Conversation

@M0Rf30

@M0Rf30 M0Rf30 commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Six new package formats, so every repository format of Sonatype Nexus Repository has an OpenArtifact equivalent (#522).

Format Format id Types URL Client
Swift packages (SE-0292 registry, SE-0391 publish) swift hosted, proxy, group /repos/swift/REPO swift package-registry, Xcode
CocoaPods (CDN trunk) cocoapods proxy /repos/REPO pod
Pub pub hosted, proxy (pub.dev), group /repos/pub/REPO dart pub, flutter pub
R (CRAN layout) cran hosted, proxy (cloud.r-project.org), group /repos/cran/REPO install.packages(), renv
Git LFS (batch API, basic transfer) gitlfs hosted /repos/gitlfs/REPO git lfs
Eclipse p2 (update sites, composites) p2 proxy /repos/p2/REPO/ Eclipse, Tycho

Every format follows docs/development/adding-a-format.md: a repotype Spec, the generic package tables (no new table), a plugin.Format registration with its storage descriptor, client setup, web format metadata, a smoke script, a docs page and fuzz targets for the new parsers (pkg/{swift,cocoapods,pub,cran,gitlfs,p2}). One migration, 033_package_formats.sql (+ _validate.no_tx.sql), widens chk_repo_format.

Notable behaviour:

  • CocoaPods: podspec source.http and GitHub git + tag/commit sources are rewritten to download through the proxy (cached, checksums kept); other git hosts and svn/hg sources are left to the client. No hosted or group repositories.
  • p2: artifacts.*/composite* (xml, xz, jar) are rewritten: p2.mirrorsURL and p2.statsURI are stripped, same-host composite children are relocated inside the proxy. Bundles pass through verbatim.
  • Git LFS: objects are content-addressed packages in the generic tables (quota, trash, cleanup, quarantine apply); a download batch needs read, an upload batch write. The locks API answers 501, which git push tolerates.
  • CRAN: PACKAGES, .gz and .rds are rendered from live rows with an ETag; source, Archive and binary trees.
  • Swift: publish is synchronous (no 202 flow); signatures are stored, not verified.
  • Pub: the three-step publish; the two publish GETs need write.

Upgrade note: repositories named cran, gitlfs, p2, pub or swift are no longer reachable by the generic URL (new format prefixes); docs/getting-started/upgrading.md says so.

Verification

Real clients in CI: client-matrix.yml on this branch runs scripts/smoke/{swift,cocoapods,pub,cran,gitlfs,p2}.sh against the built image, all six pass (run 46044866697: swift, cocoapods, pub, gitlfs; run 46046250963: p2, cran after the script fixes).

Real clients against a locally running server during development:

  • swift: SwiftPM 6.4.3 package-registry set/login/publish, swift package resolve and swift build --target against hosted, and through a group with a proxy member (behind a local TLS proxy: SwiftPM sends credentials only over https).
  • cocoapods: CocoaPods 1.17.0 pod repo add-cdn, pod spec cat, pod search, pod install of Alamofire (http source) and SnapKit (GitHub tag source) through a proxy of the real CDN.
  • pub: Dart 3.14.1 dart pub publish to hosted, dart pub get through a group (hosted + pub.dev proxy).
  • cran: R 4.6.2 R CMD build, upload, install.packages() of the package and glue through a group (hosted + CRAN proxy); PACKAGES.rds read by R.
  • gitlfs: git 2.56.1 + git-lfs 3.8.1 push/clone/git lfs pull (up to 200 MB), read-only token refused on upload.
  • p2: Tycho 4.0.10 mvn package of an eclipse-plugin resolving through a proxy of download.eclipse.org/releases/2024-12; mirrors URL absent in served metadata.

Checks on the integrated branch: scripts/dup-check.sh (0 clone groups), go build, go vet, golangci-lint run ./... (0 issues), make deadcode, make docs-check, make generate (no drift), reuse lint, go test -short ./..., go test -tags=integration ./internal/database/... ./migrations/... (local Postgres 18), web typecheck, bun test (2529 pass), bun run build.

Closes #522

Add the p2 format (issue #522 item 6): a proxy-only, MountIsolated
repository of an Eclipse p2 update site, as Nexus offers.

- pkg/p2: key classification, streaming rewrite of artifacts/content/composite
  documents (xml, xz, jar) and child relocation, with fuzz targets.
- internal/proxy: P2Hooks mirrors the path, pins bundles and features, rewrites
  repository documents (strips p2.mirrorsURL/p2.statsURI, fixes size, relocates
  composite children, same-host ones outside the repository under _host/).
- internal/formats, repotype Spec (NoHosted, no group), clientsetup (Tycho and
  Eclipse IDE snippets), migration 033_p2, openapi enums and generated files.
- docs/formats/p2.md, format index and repository docs rows.
- web: FORMAT_META, director install command, example upstream, tests.
- scripts/smoke/p2.sh: Tycho build against the proxy.
- New hosted-only gitlfs format: POST /objects/batch, PUT/GET/HEAD
  /objects/{oid}, POST /verify under /repos/gitlfs/{name}; the locks
  endpoints answer 501.
- Each object is one generic package (name = oid), so quota, trash,
  cleanup, quarantine and presign apply; trash kind gitlfs_object.
- RBAC reads the batch operation: only download needs read; a 401 carries
  an LFS-Authenticate challenge.
- Migration 033 (chk_repo_format + validate), typed store, clientsetup,
  web format meta, install command and i18n, metrics label, openapi
  enums, docs and a smoke script.
One migration 033_package_formats for the new formats; the format matrix page-link regex accepts digits (p2.md).
Adds the cocoapods format (proxy only, no hosted or group repositories):
CocoaPods-version.yml, all_pods.txt, sharded version lists, deprecated
podspecs, immutable podspecs rewritten to point at the proxy, and source
archives (http and GitHub tag/commit sources) verified against the podspec
checksum. Curation filters shards and refuses podspecs and archives.

Includes migration 033, clientsetup builder, web format meta and install
snippet, openapi enums, fuzz targets, smoke script and docs.
- New format `cran`: CRAN layout (src/contrib, Windows/macOS binary trees, Archive) with PACKAGES, .gz and .rds rendered on the fly from live rows, ETag/304, upload by PUT with DESCRIPTION validation, delete to trash (kind cran_package), license policy, quota.
- Proxy of a CRAN mirror with md5 verification and pinned source files; group merging indexes with hosted-wins.
- Spec (MountIsolated), migration 033_cran, store + sqlc queries, clientsetup (options(repos=...)), presign path, metrics label, OSV ecosystem CRAN.
- Web: format meta, install command, trash kind label in all locales; docs/formats/cran.md and smoke script.
- Tests: pkg/cran incl. DCF/DESCRIPTION fuzz targets, hosted, proxy, group, store integration test.
Spec, upload routes, metrics label, 033 migration, typed SwiftStore and queries, trash kind, RBAC login classification, and pkg/swift (names, Accept, Link, documents, archive reading, fuzz targets).
Merge origin/main; one 033 migration; docs counts, prefixes and upgrade notes for all six; test-only shard parser moved out of production code (deadcode); REUSE annotation for the swift archive fixture.
…rity

# Conflicts:
#	docs/getting-started/upgrading.md
Comment thread internal/proxy/swift.go Dismissed
…s, smoke script fixes

- dup-check: base.DeleteRelease, base.CommitBlobRow, proxy resolveDocLink and spoolUpstreamBody; pub HTTPStore embeds base.HandlerStore; gitlfs lock routes in a loop
- promote: bundle item path cases for cran, gitlfs, pub and swift
- smoke: p2 pins Maven 3.9 (Tycho 4.0 fails on 3.10), pub finds its cache dir, cran/swift/gitlfs install curl
…rity

# Conflicts:
#	docs/repositories/hosted-proxy-group.md
#	internal/api/openapi.json.gz
#	internal/repotype/repotype.go
…rity

# Conflicts:
#	internal/api/openapi.json.gz
@github-actions

Copy link
Copy Markdown

Coverage

Coverage vs main
Go, unit + integration 83.4% ±0.0
Go, unit tests only 70.2% +0.5
Go, integration tests only 51.1% -2.1
Web, lines 91.8% ±0.0
Web, functions 85.8% ±0.0
Go by area
Area Coverage vs main
cmd/docgen 80.3% ±0.0
cmd/genformats 90.8% ±0.0
cmd/oa 0.0% ±0.0
cmd/resetpw 0.0% ±0.0
cmd/server 70.2% ±0.0
internal/ai 85.6% ±0.0
internal/api 77.2% -0.3
internal/apkkeys 77.1% ±0.0
internal/apktest 90.7% ±0.0
internal/artifactpath 100.0% ±0.0
internal/attest 84.0% ±0.0
internal/attestation 79.2% ±0.0
internal/audit 97.6% ±0.0
internal/auth 91.6% ±0.0
internal/backup 72.4% ±0.0
internal/bgtask 96.8% ±0.0
internal/blockreason 100.0% ±0.0
internal/branding 93.5% ±0.0
internal/bundlechecks 100.0% ±0.0
internal/clientsetup 93.9% +0.9
internal/config 96.4% ±0.0
internal/cron 90.0% ±0.0
internal/crypto 91.0% ±0.0
internal/csaf 85.0% ±0.0
internal/curation 99.2% ±0.0
internal/database 76.2% +0.1
internal/declarative 84.1% ±0.0
internal/dtrack 85.3% ±0.0
internal/exploit 93.6% ±0.0
internal/federation 81.8% +0.1
internal/format 80.0% -0.2
internal/formats 88.6% +0.6
internal/gpgkeys 87.1% +0.3
internal/group 90.1% +0.3
internal/httpcache 100.0% ±0.0
internal/httpcompress 93.3% ±0.0
internal/httpx 85.7% ±0.0
internal/imagesbom 81.9% ±0.0
internal/importmeta 93.3% ±0.0
internal/iocopy 100.0% ±0.0
internal/itempath 98.3% ±0.0
internal/lazyre 100.0% ±0.0
internal/license 98.5% ±0.0
internal/licensemeta 87.5% ±0.0
internal/licensepolicy 92.6% ±0.0
internal/limitio 92.9% ±0.0
internal/mcp 89.9% ±0.0
internal/metrics 96.2% ±0.0
internal/middleware 94.5% ±0.0
internal/netutil 93.4% ±0.0
internal/nixkeys 79.6% ±0.0
internal/oacli 85.0% -0.2
internal/ocimanifest 100.0% ±0.0
internal/ocipath 100.0% ±0.0
internal/ociref 96.8% ±0.0
internal/osv 89.8% ±0.0
internal/passwd 93.3% ±0.0
internal/pathseg 100.0% ±0.0
internal/pglock 79.0% ±0.0
internal/pkgdeps 88.1% ±0.0
internal/presign 99.2% ±0.0
internal/promote 84.0% -0.4
internal/proxy 86.2% -0.6
internal/publicurl 96.8% ±0.0
internal/pypisimple 97.9% ±0.0
internal/quarantine 100.0% ±0.0
internal/quayapi 81.2% ±0.0
internal/quota 92.2% ±0.0
internal/recovery 84.8% -0.8
internal/registry 100.0% ±0.0
internal/replication 78.1% -0.1
internal/repodispatch 86.3% ±0.0
internal/repotype 97.1% ±0.0
internal/rpmextra 92.9% ±0.0
internal/sbom 89.9% ±0.0
internal/scanexport 96.4% ±0.0
internal/search 90.5% ±0.0
internal/secrets 91.4% ±0.0
internal/storage 84.9% ±0.0
internal/telemetry 92.2% ±0.0
internal/tiering 83.5% ±0.0
internal/trash 96.7% ±0.0
internal/urlparams 100.0% ±0.0
internal/vexsync 80.0% ±0.0
internal/vuln 89.8% -0.1
internal/webhook 86.1% ±0.0
internal/worker 82.7% ±0.0
internal/workq 79.5% ±0.0
pkg/ansible 89.8% ±0.0
pkg/cargo 95.6% ±0.0
pkg/cocoapods 94.3% new
pkg/compactindex 97.8% ±0.0
pkg/composer 94.5% ±0.0
pkg/conan 99.2% ±0.0
pkg/conda 94.8% ±0.0
pkg/cran 93.6% new
pkg/delta 71.4% ±0.0
pkg/gemversion 100.0% ±0.0
pkg/gitlfs 100.0% new
pkg/helm 97.0% ±0.0
pkg/lockfile 96.7% ±0.0
pkg/logger 96.9% ±0.0
pkg/maven 96.7% ±0.0
pkg/nix 99.1% ±0.0
pkg/npm 88.0% ±0.0
pkg/nuget 97.6% ±0.0
pkg/p2 90.2% new
pkg/pub 91.2% new
pkg/pyversion 100.0% ±0.0
pkg/rubymarshal 87.1% ±0.0
pkg/swift 91.8% new
tests/integration 78.8% ±0.0
web 93.7% ±0.0
Web by area (lines)
Area Coverage vs main
src 85.1% ±0.0
src/api 92.7% -0.1
src/components 90.3% ±0.0
src/composables 89.7% ±0.0
src/demo 93.0% ±0.0
src/i18n 98.5% ±0.0
src/lib 99.2% ±0.0
src/pages 92.1% ±0.0
src/pwa 97.6% ±0.0
src/router 98.6% ±0.0
src/stores 99.0% ±0.0
src/telemetry 90.8% ±0.0

Full report (HTML, merged profile) in the CI run artifacts

@M0Rf30
M0Rf30 merged commit 8761be0 into main Nov 27, 2026
28 checks passed
@M0Rf30
M0Rf30 deleted the feat/formats-nexus-parity branch November 27, 2026 18:15
M0Rf30 pushed a commit that referenced this pull request Dec 1, 2026
)

The nightly ClusterFuzzLite batch has failed to build since #533 (issue #514):
FuzzReadDescription passes its *testing.F to tarGz and zipOf, which took a
testing.TB, and the OSS-Fuzz Go build substitutes a testing.F that lacks
ArtifactDir. The helpers only call Helper and Fatal, so they take the small
fataler interface the terraform tests already use for the same reason. A scan
of every fuzz target finds no other testing.TB helper called with f.

Co-authored-by: Areef <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
M0Rf30 pushed a commit that referenced this pull request Dec 1, 2026
…nd Podfile.lock (#543)

The Swift, Pub, CRAN and CocoaPods formats of #533 had no lockfile oa check
could read.

- Package.resolved: the registry pins (scope.name, as the registry matches
  them); git pins are left out. No requirers, no dev dependencies.
- pubspec.lock: hosted packages; SDK, path and git ones are left out. A
  direct dev dependency is Dev, so --no-dev works. No requirers.
- renv.lock: packages installed from a repository; GitHub, GitLab,
  Bioconductor, URL and local ones are left out. Requirers from
  Requirements (renv 1.0 and later).
- Podfile.lock: by pod (a subspec is its pod, which does not require
  itself); pods under EXTERNAL SOURCES are left out. Requirers from PODS.

--fetch requests what each client does: the Swift release list, the pub
package document, and for CocoaPods CocoaPods-version.yml then the shard
of each pod in the repository's own sharding. A CRAN proxy has no version
list (no Versions hook), so its answers stay unknown whatever is cached:
--fetch refuses an renv.lock instead of warming nothing.

Fixtures, parse, reject, edge and KindOf tests, one fuzz target per
lockfile; the metadata path fuzz target covers the new kinds and their
/repos/<format>/ prefixes. docs/integrations/ci.md and the CLI reference
updated.

Co-authored-by: Areef <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
M0Rf30 pushed a commit that referenced this pull request Dec 3, 2026
)

The nightly ClusterFuzzLite batch still failed after #542, now with
"could not find the function: func FuzzPeekOperation" (#514): build.sh
deletes the files of an external test package before it builds, because the
OSS-Fuzz Go build compiles test files as ordinary sources, and #533 declared
FuzzPeekOperation in pkg/gitlfs/gitlfs_test.go and six targets in
pkg/swift/fuzz_test.go as package gitlfs_test and swift_test. Seven of the 228
targets vanished and the first missing one aborted the batch.

FuzzPeekOperation moves to pkg/gitlfs/fuzz_test.go and pkg/swift/fuzz_test.go
becomes package swift (swifttest imports nothing of swift, and its TB is the
small interface). tests/fuzz_targets_test.go fails on a fuzz target in an
external test package, so make test catches this before the nightly run does;
it reports all seven on main's tree.

Co-authored-by: Areef <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Formats: Swift packages, CocoaPods, Pub, R (CRAN), Git LFS, p2 (parity with Nexus)

2 participants