Vendor compact_index from rubygems/rubygems.org#115
Merged
Conversation
Drop the runtime dependency on the compact_index gem and ship the library in tree, mirroring rubygems/rubygems.org@ed540ea. This removes the release-coordination overhead that the dependency used to require. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Pull the vendored files directly from rubygems/rubygems.org master so future syncs don't require manual copying. Override the source ref via the REF environment variable. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR removes the runtime dependency on the compact_index gem by vendoring the compact_index implementation directly into this repository, mirroring the approach used in rubygems.org to avoid coordinated releases.
Changes:
- Remove
compact_indexas a runtime dependency from the gemspec. - Add vendored
lib/compact_index*implementation and wire RubyGems indexer to require it locally. - Add a Rake task to re-sync the vendored files from
rubygems/rubygems.org.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| rubygems-generate_index.gemspec | Removes the compact_index runtime dependency. |
| Rakefile | Adds a vendor:compact_index task to sync vendored sources from upstream. |
| Manifest.txt | Includes the newly vendored compact index source files in the gem package. |
| lib/rubygems/indexer.rb | Switches to requiring the vendored compact index implementation. |
| lib/compact_index.rb | Adds the vendored compact index entrypoint and requires subcomponents. |
| lib/compact_index/dependency.rb | Adds vendored Dependency struct used to render info lines. |
| lib/compact_index/gem.rb | Adds vendored Gem struct used to represent compact-index gems. |
| lib/compact_index/gem_version.rb | Adds vendored GemVersion struct used for sorting/rendering versions. |
| lib/compact_index/versions_file.rb | Adds vendored VersionsFile logic for reading/writing versions. |
| .github/release.yml | Adds release configuration to exclude dependency-labeled entries from changelog. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+14
to
+21
| def <=>(other) | ||
| number_comp = number <=> other.number | ||
|
|
||
| if number_comp.zero? | ||
| [number, platform].compact <=> [other.number, other.platform].compact | ||
| else | ||
| number_comp | ||
| end |
| @@ -0,0 +1,25 @@ | |||
| # frozen_string_literal: true | |||
|
|
|||
| # Vendored from https://github.com/rubygems/compact_index v0.15.0 | |||
Comment on lines
+61
to
+66
| desc "Sync vendored compact_index from rubygems/rubygems.org (REF=master)" | ||
| task :compact_index do | ||
| require "open-uri" | ||
| require "fileutils" | ||
|
|
||
| ref = ENV["REF"] || "master" |
The files under lib/compact_index are copied verbatim from rubygems/rubygems.org and should not be reformatted to fit this repo's style; the upstream copy is the source of truth. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Vendor the compact_index library in tree instead of depending on the
compact_indexgem at runtime, mirroring rubygems/rubygems.org@ed540ea.compact_indexis specified and published from rubygems.org, and keepingit as a runtime dependency forced a release of
compact_indexbeforerubygems-generate_indexcould be updated.Vendoring removes that coordination overhead.