Replace raw compact index wire format with test helpers - #187
Merged
jenshenny merged 1 commit intoAug 27, 2026
Merged
Conversation
jenshenny
marked this pull request as ready for review
August 27, 2026 20:13
jenshenny
force-pushed
the
js/ca-compact-index-test-helpers
branch
2 times, most recently
from
August 27, 2026 20:18
e36f77b to
c21ac0d
Compare
jenshenny
force-pushed
the
js/ca-compact-index-test-helpers
branch
from
August 27, 2026 20:22
c21ac0d to
5d6ec09
Compare
There was a problem hiding this comment.
Copilot encountered an error: Your billing is not configured or you have Copilot licenses from multiple standalone organizations or enterprises. To use premium requests, select a billing entity via the GitHub site, under Settings > Copilot > Features.
girachawda
approved these changes
Aug 27, 2026
Comment on lines
+997
to
+1001
| def util_ca_spec(name, version, content_address, ruby_abi: nil, platform: "x86_64-linux", required_ruby_version: nil, &block) | ||
| util_spec(name, version) do |s| | ||
| s.platform = Gem::Platform.new(platform) | ||
| s.content_address = content_address | ||
| s.required_ruby_version = required_ruby_version || (ruby_abi ? "~> #{ruby_abi}.0" : nil) |
girachawda
reviewed
Aug 27, 2026
jenshenny
force-pushed
the
js/ca-compact-index-test-helpers
branch
from
August 27, 2026 20:58
5d6ec09 to
875b8d5
Compare
jenshenny
force-pushed
the
js/ca-compact-index-test-helpers
branch
2 times, most recently
from
August 27, 2026 21:21
61193a0 to
ec4e87e
Compare
Extend util_compact_index_info_line to emit CA metadata (version-content_address string, platform:=) and util_setup_compact_index to use CA version strings in the versions list. Add util_ca_spec helper (built on util_spec) for creating content-addressable specs. Refactor 5 test files (28 tests) to use util_ca_spec + util_setup_compact_index instead of raw wire-format strings. Edge case tests (empty info body, missing platform metadata, mixed CA+non-CA same name) remain raw. Also fix multiline operation indentation in ContentAddressableInfo#eql?. Assisted-By: devx/2658d4ad-be37-4929-8dda-b1d772952c7b
jenshenny
force-pushed
the
js/ca-compact-index-test-helpers
branch
from
August 27, 2026 21:22
ec4e87e to
e0b79ca
Compare
jenshenny
merged commit Aug 27, 2026
a3547fe
into
feature-branch-ca-changes-rubygems
135 of 137 checks passed
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.
Improve compact index test infrastructure for content-addressable gems
Problem
The CA test additions in ruby#9773 set up compact index fixtures by hand-rolling raw wire-format strings — versions lists, info bodies, checksums, and
platform:=metadata. This is fragile, verbose, and requires test authors to understand the compact index wire format:Solution
Extend the existing
util_setup_compact_index/util_compact_index_info_linehelpers to generate CA metadata from spec objects, and add autil_ca_spechelper (built onutil_spec) for creating content-addressable specs. Tests now read: