Skip to content

Compare versions semantically in ruby_latest_full_version?#167

Merged
hsbt merged 1 commit into
masterfrom
fix-latest-full-version
May 12, 2026
Merged

Compare versions semantically in ruby_latest_full_version?#167
hsbt merged 1 commit into
masterfrom
fix-latest-full-version

Conversation

@hsbt
Copy link
Copy Markdown
Member

@hsbt hsbt commented May 12, 2026

Summary

ruby_latest_full_version? relied on releases.yml ordering to emit the MAJOR.MINOR alias, so a repository_dispatch build that fires before releases.yml is updated silently skips it. This is why 4.0 still points at 4.0.2 after the 4.0.3 / 4.0.4 builds.

Compare with Gem::Version against a candidate set that always includes the version being built. Re-running the 4.0.4 build is still required to retag 4.0 / 4.0-noble.

Fixes #165

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>
Copilot AI review requested due to automatic review settings May 12, 2026 07:03
Copy link
Copy Markdown

Copilot AI left a comment

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 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.z versions.
  • Select the latest candidate using Gem::Version to ensure semantic ordering and correct alias emission regardless of releases.yml timing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hsbt hsbt merged commit 97f2a33 into master May 12, 2026
44 checks passed
@hsbt hsbt deleted the fix-latest-full-version branch May 12, 2026 07:19
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.

4.0 points 4.0.2, not 4.0.3

2 participants