Remove ActiveSupport dependency from compact index - #6825
Merged
Conversation
jenshenny
force-pushed
the
compact-index-no-rails
branch
4 times, most recently
from
August 31, 2026 15:17
5557b2d to
148a6ff
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Removes the remaining ActiveSupport present? usage from the vendored compact index gem version logic by introducing a pure-Ruby predicate for content_address, keeping lib/compact_index/* usable without Rails loaded.
Changes:
- Replaced
content_address.present?checks with a new privatecontent_address?predicate. - Added
content_address?toCompactIndex::GemVersionMethodsand used it to controlversion_tokenformatting andto_linemetadata output.
Suppressed comments (1)
lib/compact_index/gem_version.rb:38
content_address?does not fully match ActiveSupportpresent?semantics: whitespace-only strings (e.g. " ") would be treated as present, changingversion_token/to_lineoutput and contradicting the PR goal of preservingpresent?behavior forcontent_address. Consider treating whitespace-only strings as absent (and handling non-string values safely).
def content_address?
!content_address.nil? && !content_address.empty?
end
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6825 +/- ##
=======================================
Coverage 97.80% 97.80%
=======================================
Files 534 534
Lines 11771 11773 +2
=======================================
+ Hits 11513 11515 +2
Misses 258 258 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Replace `Object#present?` (ActiveSupport) with a pure-Ruby private predicate in `CompactIndex::GemVersionMethods`, so the vendored `lib/compact_index*` files no longer rely on Rails being loaded. The predicate preserves `present?` semantics for `content_address` (nil or a non-empty hex string), guarding the empty-string case rather than relying on the host application's model validation invariant.
jenshenny
force-pushed
the
compact-index-no-rails
branch
from
August 31, 2026 15:26
148a6ff to
6f14522
Compare
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.
Replace
Object#present?(ActiveSupport) with a pure-Ruby private predicate inCompactIndex::GemVersionMethods, so the vendoredlib/compact_index*files in the client no longer rely on Rails being loaded. The predicate preservespresent?semantics forcontent_address(nil or a non-empty hex string), guarding the empty-string case rather than relying on the host application's model validation invariant.Ref: ruby/rubygems#9773 (comment)