Allow yanking a specific Ruby ABI variant - #862
Open
jenshenny wants to merge 1 commit into
Open
Conversation
Multiple content-addressable versions can share a number and platform, one per Ruby ABI, so resolving a deletion by number and platform alone matched an arbitrary variant. find_version! now scopes on ruby_abi (nil by default, preserving behavior for all existing versions) and the deletions API accepts a ruby_abi param to target a variant. Without the param, yanks against ABI variants return 404 rather than deleting an arbitrary one. The gem yank CLI needs a matching option to pass ruby_abi.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
rubygems#6674
Problem
Content-addressable gems mean multiple versions can now share the same
numberandplatform— one per Ruby ABI:The deletions API resolves the version to yank via
Rubygem#find_version!(number:, platform:), which usesfind_by!— sogem yank sandworm -v 1.0.0 --platform x86_64-linux-muslwould match both rows and delete whichever the database returned first. A destructive operation should never pick its target arbitrarily.Solution
find_version!now scopes onruby_abi, defaulting tonil, and the deletions API accepts an optionalruby_abiparam:platform+ matchingruby_abiplatform+ruby_abimatching no variantplatformonly, when only ABI variants existplatformonly, when a version supporting multiple Ruby ABIs coexistsruby_abiwithoutplatformruby_abiparam.presence, matchingplatform's existing handling)Testing
Push three real
.gemfiles (ABI 3.2 + 3.4 variants and a version supporting multiple Ruby ABIs, all sharing number + platform) through the full push pipeline with the feature flag enabled, then exercises every yank resolution path, asserting HTTP status, response body, and the indexed state of all three versions after each step.Run from the repo root with the server on
:3000— paste the whole block into your console:Tophat script (single paste)
Output (24 passed, 0 failed)