Skip to content

Vendor compact_index from rubygems/rubygems.org#115

Merged
hsbt merged 4 commits into
mainfrom
vendor-compact-index
May 7, 2026
Merged

Vendor compact_index from rubygems/rubygems.org#115
hsbt merged 4 commits into
mainfrom
vendor-compact-index

Conversation

@hsbt

@hsbt hsbt commented May 7, 2026

Copy link
Copy Markdown
Member

Vendor the compact_index library in tree instead of depending on the
compact_index gem at runtime, mirroring rubygems/rubygems.org@ed540ea.

compact_index is specified and published from rubygems.org, and keeping
it as a runtime dependency forced a release of compact_index before
rubygems-generate_index could be updated.

Vendoring removes that coordination overhead.

hsbt and others added 3 commits May 7, 2026 11:36
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>
Copilot AI review requested due to automatic review settings May 7, 2026 03:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_index as 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
Comment thread lib/compact_index.rb
@@ -0,0 +1,25 @@
# frozen_string_literal: true

# Vendored from https://github.com/rubygems/compact_index v0.15.0
Comment thread Rakefile
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>
@hsbt hsbt merged commit 93d0270 into main May 7, 2026
21 checks passed
@hsbt hsbt deleted the vendor-compact-index branch May 7, 2026 03:11
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.

2 participants