mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 22:11:36 -05:00
DeletePackage deletes a package and every one of its versions, matching PackageSummary's own field name (package, not name, confirmed against the API reference) in the deletedPackage response. A nonexistent package answers ResourceNotFoundException instead of silently succeeding. Existence and deletion go where the package actually lives: stored generic-format versions and their asset bytes for generic, and each format's sidecar for maven, npm, and pypi. Validates package and namespace shape, and requires or rejects a namespace per format, the same boundary describePackage already enforces, before touching repository or sidecar state. Synchronized like every other mutating method on this service, so a publish and a delete racing the same generic package cannot interleave. Within one generic version's own delete, its metadata record is removed before its asset bytes are cleaned up, so a cleanup failure on one asset can never leave a surviving record pointing at bytes that are now gone; the failure is logged and the rest of the package's assets still get cleaned up. Verdaccio and Reposilite can each remove a whole package in one call, confirmed against live containers: Verdaccio needs the packument's own _rev appended as npm's real unpublish protocol does (a bare DELETE with no revision is not a route at all), Reposilite removes everything under the group/artifact directory in a single DELETE. pypiserver has no single whole-package route, but its own management endpoint (POST / with :action=remove_pkg) does delete a named version for real, confirmed live against the pinned v2.4.2 image: every version is listed first through the same image's PyPI JSON API endpoint, then each file removed under its own, unnormalized name (an sdist and a wheel of the same release can legitimately differ there, so deleting by one shared name alone could silently leave the other file behind). RepositorySidecarManager.deletePackage's default still throws UnsupportedOperationException for a sidecar that genuinely cannot do this, and the service turns that into a documented InternalServerException rather than claiming a success it cannot back up or leaving an unhandled 500.