Keep a tombstone on gem yank #155
Reference in New Issue
Block a user
Delete Branch "benvin/gems-yank-tombstone"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Yank hard-deleted a local gem version, so the same name-version-platform could be re-pushed with different bytes and break lockfiles pinning the old checksum. rubygems.org forbids re-pushing a yanked version.
_yanked/<name>/<full>tombstone before deleting the gem, quick spec and index line_index/and_yanked/paths on gems locals_yanked/<name>/<full>is served by the generic serveLocalFile GET like_index/(200 with the index line) → deny_yanked/and_index/paths in the gems local GET..gem/quick write (different bytes vs a row yank has not deleted yet, e.g. yank deletedgems/but notquick/) or errors, leaves itsgems/<full>.gemrow behind. The yanked version stays downloadable and the tombstone blocks any later cleanup → on any exit aftergemsPushHook()other than success, re-check the tombstone and delete the paths this request created.r.Context(); a client disconnect cancels the deletes, which are only logged, leaving the_index/row (the visibility gate) live for a tombstoned version → usecontext.WithoutCancel(r.Context())for the rollback deletes.yanked()returns true and rolls back a legitimate push → distinguish error from hit, 500 without deleting.unkin-agent referenced this pull request2026-10-18 02:14:14 +11:00