Compare versions semantically in ruby_latest_full_version?#167
Merged
Conversation
Previously this depended on the order of entries in www.ruby-lang.org's releases.yml, so when a repository_dispatch build was triggered before releases.yml had been updated with the new release, the major.minor alias (e.g. 4.0) was not produced. As a result 4.0 kept pointing at 4.0.2 even after 4.0.3 and 4.0.4 had been built. Compare with Gem::Version against a candidate set that always includes the version being built so the alias is correct regardless of releases.yml timing, and double-digit teeny versions also order correctly. Fixes #165 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes tag/alias emission for Ruby Docker images by making ruby_latest_full_version? determine the “latest full version” (MAJOR.MINOR.TEENY) via semantic version comparison rather than relying on the ordering/presence of entries in www.ruby-lang.org’s releases.yml. This prevents missing MAJOR.MINOR aliases (e.g., 4.0, 4.0-noble) when a build runs before releases.yml is updated, and it correctly orders double-digit teeny releases (e.g., 3.4.10 > 3.4.9).
Changes:
- Build a candidate set that always includes the version being built and filter to stable
x.y.zversions. - Select the latest candidate using
Gem::Versionto ensure semantic ordering and correct alias emission regardless ofreleases.ymltiming.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
ruby_latest_full_version?relied onreleases.ymlordering to emit theMAJOR.MINORalias, so arepository_dispatchbuild that fires beforereleases.ymlis updated silently skips it. This is why4.0still points at 4.0.2 after the 4.0.3 / 4.0.4 builds.Compare with
Gem::Versionagainst a candidate set that always includes the version being built. Re-running the 4.0.4 build is still required to retag4.0/4.0-noble.Fixes #165