Skip to content

feat: add distribution mirroring for Composer packages#28

Merged
maartenbode merged 6 commits intomainfrom
feat/dist-mirroring
Mar 4, 2026
Merged

feat: add distribution mirroring for Composer packages#28
maartenbode merged 6 commits intomainfrom
feat/dist-mirroring

Conversation

@maartenbode
Copy link
Member

Summary

  • Add downloadArchive() to GitProviderInterface with implementations for GitHub (API zipball), GitLab (API archive), CachedGit (git archive), and GenericGit (unsupported)
  • Create CreateDistArchiveAction to orchestrate archive download, SHA-1 hashing, and storage
  • Integrate dist creation into SyncRefAction — archives are created after version sync, wrapped in try/catch so failures don't break the sync
  • Add DistController endpoint serving archives via file download (local disk) or signed URL redirect (S3)
  • Add CleanupDistArchivesAction + RemoveDistArchiveTask + dist:cleanup artisan command for per-package archive retention
  • Clean up dist files automatically when a PackageVersion is deleted (model event)
  • Include shasum in Composer metadata for integrity verification
  • Add config/pricore.php with DIST_ENABLED, DIST_DISK, and DIST_SIGNED_URL_EXPIRY settings
  • Add migration for dist_shasum, dist_path on package_versions and dist_keep_last_releases on packages
  • Add documentation page at docs/guide/dist-mirroring.md
  • Add 9 tests covering archive creation, download endpoint, and metadata output

Closes #27

@maartenbode maartenbode merged commit be7255e into main Mar 4, 2026
2 checks passed
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.

Package distribution mirroring

1 participant