Add local gems repositories #153

Merged
benvin merged 1 commits from benvin/local-gems into master 2026-10-18 01:12:37 +11:00
Member

In-house gems have nowhere to publish: gems locals only take raw file uploads, which gem push, gem install and bundler cannot use.

  • accept gem push (POST <repo>/api/v1/gems, 256MiB cap, 8MiB metadata cap) and gem yank (DELETE <repo>/api/v1/gems/yank); any API key works
  • parse the gemspec from the .gem; reject an existing name-version-platform with 409
  • serve the compact index (versions, info/<gem>, names), .gem files and generated quick/Marshal.4.8 specs; no legacy specs.4.8.gz
  • route HEAD on locals (gem probes versions with HEAD)
  • add docs/gems/local.md, a UI snippet and a stock ruby:3.3 e2e-docker case
In-house gems have nowhere to publish: gems locals only take raw file uploads, which `gem push`, `gem install` and bundler cannot use. - accept `gem push` (`POST <repo>/api/v1/gems`, 256MiB cap, 8MiB metadata cap) and `gem yank` (`DELETE <repo>/api/v1/gems/yank`); any API key works - parse the gemspec from the `.gem`; reject an existing name-version-platform with 409 - serve the compact index (`versions`, `info/<gem>`, `names`), `.gem` files and generated `quick/Marshal.4.8` specs; no legacy `specs.4.8.gz` - route HEAD on locals (gem probes `versions` with HEAD) - add `docs/gems/local.md`, a UI snippet and a stock `ruby:3.3` e2e-docker case
unkin-agent added 1 commit 2026-10-18 00:39:18 +11:00
Add local gems repositories
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
38641983e7
Serve gem push/yank and the compact index from local gems repos.
Author
Member
  • nit: internal/api/v1/gems.go:154 — yank hard-deletes the .gem, quick spec and index line, so the same name-version can be re-pushed with different bytes and break consumers whose Gemfile.lock pins the old checksum → keep a tombstone (or refuse re-push of a yanked version) if that matters; otherwise ignore.
  • nit: internal/api/v1/gems.go:242 — every /versions and /names request downloads one blob per published version (N S3 reads, bundler hits /versions on every run) → derive names from file paths for /names; consider caching the rendered versions body.
  • nit: internal/provider/gems/local.go:452 — a gemspec date before 1900 makes uint32(t.Year()-1900) wrap into the other Time bits, producing a corrupt Time → clamp to Unix epoch like the zero-date case.
- nit: internal/api/v1/gems.go:154 — yank hard-deletes the .gem, quick spec and index line, so the same name-version can be re-pushed with different bytes and break consumers whose Gemfile.lock pins the old checksum → keep a tombstone (or refuse re-push of a yanked version) if that matters; otherwise ignore. - nit: internal/api/v1/gems.go:242 — every /versions and /names request downloads one blob per published version (N S3 reads, bundler hits /versions on every run) → derive names from file paths for /names; consider caching the rendered versions body. - nit: internal/provider/gems/local.go:452 — a gemspec date before 1900 makes uint32(t.Year()-1900) wrap into the other Time bits, producing a corrupt Time → clamp to Unix epoch like the zero-date case.
benvin merged commit 7dd7fc70d1 into master 2026-10-18 01:12:37 +11:00
benvin deleted branch benvin/local-gems 2026-10-18 01:12:37 +11:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: unkin/artifactapi#153