This repository was archived by the owner on Apr 8, 2026. It is now read-only.
Add optional created_at field to GemVersion#183
Merged
eileencodes merged 3 commits intorubygems:masterfrom Apr 7, 2026
Merged
Conversation
Add a created_at field to the GemVersion struct so that the /info endpoint can include the publication timestamp for each gem version. When present, created_at is appended to the requirements section of the info line. When nil, the field is omitted for backwards compatibility.
Member
|
Hi @marcbest looks like you accidentally closed this? I'll reopen because so we can discuss adding this. |
tenderlove
approved these changes
Apr 7, 2026
We need this line for CI.
Contributor
Author
Thanks @eileencodes 🙇 I had closed it as I thought I was being a bit hasty after noticing there was already some discussion here: ruby/rubygems#9113 Thanks for picking it up! |
Member
|
👍 |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Problem
Supply chain attacks targeting package registries are a growing concern. Other package managers have already shipped minimum age features — npm, pnpm, and yarn all allow users to reject recently published versions during resolution.
Bundler currently has no equivalent. Adding one requires knowing when each gem version was published, but the compact index has no publication timestamp. Without it, clients must make a separate V1 API call per gem (
/api/v1/versions/<gem>.json) — adding seconds of latency and hitting the RubyGems.org rate limit (10 req/s) on projects with 50+ gems.Solution
Add an optional
created_atfield toGemVersion. When populated, it is appended to the requirements section of the/infoline:When
nil, the field is omitted entirely:created_atfrom data already fetched during resolutionChanges
GemVersionstruct: addedcreated_atas 8th field (defaultnil)GemVersion#to_line: appendscreated_at:<timestamp>when presentbuild_versiontest helper: accepts optional:created_atkwargDownstream
created_atto compact index output