Skip to content

fix(ruby): require build revision releases#10428

Merged
jdx merged 1 commit into
mainfrom
codex/mise-build-revision-releases
Jun 14, 2026
Merged

fix(ruby): require build revision releases#10428
jdx merged 1 commit into
mainfrom
codex/mise-build-revision-releases

Conversation

@jdx

@jdx jdx commented Jun 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • require the default jdx/ruby precompiled source to resolve numeric build revision tags instead of using the floating base release tag
  • keep custom Ruby precompiled GitHub sources on the existing behavior
  • update docs to stop describing the base release as an expected Ruby precompiled lockfile target

Context

jdx/ruby publishes immutable build revision releases like 3.3.11-1 alongside the floating base release. Since every jdx/ruby precompiled Ruby version should have a build revision, mise should not lock or install the base release tag for that default source.

Validation

  • cargo fmt --check
  • git diff --check
  • cargo test ruby_build_revision
  • cargo test test_ruby_default_precompiled_source_requires_build_revision
  • cargo test test_build_revision

Note

Medium Risk
Changes Ruby install/lock resolution for the default precompiled source; versions that only have a base tag may stop using precompiled binaries until a build revision exists, while custom sources are unchanged.

Overview
Default jdx/ruby precompiled installs and lock URLs no longer target the floating base release tag (e.g. 3.3.11). Resolution prefers the highest numeric build revision (3.3.11-1, 3.3.11-2, …) and aborts the precompiled path when no such tag exists, so mise can fall back to source compile instead of locking a mutable base asset.

GitHub release selection gains get_release_with_build_revision_status and pick_best_numeric_build_revision, which report whether a numeric -N suffix was found; the Ruby plugin applies that only when the precompiled source is the default jdx/ruby repo—custom ruby.precompiled_url GitHub sources still allow the old base-tag fallback.

Docs drop treating the base release as an expected lockfile revision and state that mise uses build-revision tags for jdx/ruby, with slightly clearer lockfile refresh steps.

Reviewed by Cursor Bugbot for commit 4a85a47. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • Documentation
    • Expanded guidance for Ruby precompiled build revisions, including how mise.lock pins a specific build-revision tag (e.g., 3.3.11-1, 3.3.11-2), how “latest available” behavior works without the lockfile, and how to interpret the corresponding release URL paths.
  • Improvements
    • Improved Ruby precompiled binary selection to properly recognize numeric build-revision tags, ignore non-matching tag formats, and behave more predictably when a locked revision is required.

@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9a64abf6-9ec7-4d86-a677-bd728f077e85

📥 Commits

Reviewing files that changed from the base of the PR and between 3e99e52 and 4a85a47.

📒 Files selected for processing (4)
  • docs/dev-tools/mise-lock.md
  • docs/lang/ruby.md
  • src/github.rs
  • src/plugins/core/ruby.rs
✅ Files skipped from review due to trivial changes (1)
  • docs/lang/ruby.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/dev-tools/mise-lock.md

📝 Walkthrough

Walkthrough

Refactors GitHub release API to distinguish numeric build-revision tags, integrates it into RubyPlugin with helpers and early-exit logic for missing build-revision releases, extends unit tests, and documents the behavior in Ruby and mise-lock reference docs.

Changes

Ruby Precompiled Build Revision

Layer / File(s) Summary
GitHub API: build revision status and numeric selection
src/github.rs
Replaces get_release_with_build_revision with get_release_with_build_revision_status, which returns (GithubRelease, bool) to indicate whether a numeric build-revision tag was selected. Adds pick_best_numeric_build_revision to select the highest -N suffix, ignoring the base tag. Includes unit tests for numeric-only behavior.
Ruby plugin: build revision helpers and early-exit
src/plugins/core/ruby.rs
Adds is_default_ruby_source and is_build_revision_tag helpers for explicit validation. Implements source_requires_build_revision to gate build-revision requirement on the default source. Refactors extract_build_revision_from_lock_platforms to use the new tag predicate. Short-circuits find_precompiled_asset_in_repo with Ok(None) when a build-revision-required source has no numeric release, using the new GitHub API in both locked and non-locked paths. Extends unit tests for default-source and numeric tag-validation behavior.
Ruby and mise-lock documentation
docs/lang/ruby.md, docs/dev-tools/mise-lock.md
Adds "Precompiled build revisions" subsection to Ruby docs explaining build revision tags, how mise.lock pins revisions via platform URL, and how to identify and regenerate revisions. Updates mise-lock reference with inline explanation that 3.3.11-1 is build revision 1.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • jdx/mise#10419: Aligns Ruby precompiled build-revision documentation (e.g., how mise.lock/platform URLs map to 3.3.11-<n>) with the build-revision behavior.
  • jdx/mise#10260: Changes src/plugins/core/ruby.rs to control the "use versions host" boolean passed into github::sigstore::verify_attestation during precompiled Ruby attestation verification, using the same default-source gating logic.
  • jdx/mise#9992: Touches Ruby lockfile precompiled URL logic in src/plugins/core/ruby.rs; this PR's build-revision tag parsing depends on the {version}-{N} segment in the precompiled releases/download/<tag>/ URL that PR #9992 records.

Poem

🐇 Hop! The GitHub API now tells true,
Which tag is numeric—-1, -2—shiny and new.
RubyPlugin listens with helpers so keen,
Short-circuits when no build revision is seen.
Docs bloom with examples, locks pin the way—
A tidy solution to build once a day! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(ruby): require build revision releases' directly summarizes the main change: requiring numeric build revision releases for the default jdx/ruby source instead of accepting floating base tags.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps

greptile-apps Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR tightens the default jdx/ruby precompiled install path so mise only accepts numeric build-revision tags (e.g. 3.3.11-1) and rejects the floating base release tag (3.3.11) as a valid install or lock target. Custom ruby.precompiled_url sources retain the previous behaviour.

  • src/github.rs: Splits the old get_release_with_build_revision into pick_best_numeric_build_revision (strictly numeric suffix only) and a renamed public entry point get_release_with_build_revision_status that returns a (GithubRelease, bool) flag, preserving the old wider fallback for non-default sources.
  • src/plugins/core/ruby.rs: Adds is_default_ruby_source / source_requires_build_revision / is_build_revision_tag helpers and gates find_precompiled_asset_in_repo on the flag so the default source returns Ok(None) (falling back to source compile) when no numeric build-revision release exists.
  • Docs (ruby.md, mise-lock.md): Removes the base release as an expected lockfile target and adds a "precompiled build revisions" explanation with upgrade instructions.

Confidence Score: 5/5

Safe to merge; the change is well-scoped to the default jdx/ruby source and custom sources are unaffected.

All changed logic is covered by new unit tests. The is_build_revision_tag refactor is semantically identical to the old inline let-chain. The requires_build_revision gate correctly short-circuits to Ok(None) triggering source-compile fallback rather than crashing.

No files require special attention.

Important Files Changed

Filename Overview
src/github.rs Introduces pick_best_numeric_build_revision and renames the public entry point to get_release_with_build_revision_status, returning a boolean flag indicating whether a numeric build-revision tag was found. Logic is correct; releases.clone() is a minor allocation cost but not a bug.
src/plugins/core/ruby.rs Adds is_default_ruby_source, source_requires_build_revision, and is_build_revision_tag helpers, then threads the requires_build_revision gate through find_precompiled_asset_in_repo. Refactor of extract_build_revision_from_lock_platforms is semantically equivalent to the old inline logic.
docs/lang/ruby.md Removes the base release as an acceptable lockfile target and documents that mise requires numeric build-revision tags for the default jdx/ruby source. Accurately reflects the new behaviour.
docs/dev-tools/mise-lock.md Small sentence simplification that removes the now-incorrect "base release" description while keeping the cross-reference to the Ruby guide.

Reviews (2): Last reviewed commit: "fix(ruby): require build revision releas..." | Re-trigger Greptile

Comment thread src/plugins/core/ruby.rs

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/lang/ruby.md`:
- Around line 88-95: The lockfile refresh instructions in the Ruby documentation
are unclear and potentially misleading about how much needs to be removed.
Currently the text says to remove "the Ruby entry (or the relevant platform
URL)" but since the Ruby lockfile code scans every stored platform entry,
removing just one platform URL is insufficient and will leave the old revision
pinned. Update the instructions to explicitly state that users must either
delete the entire Ruby entry from mise.lock, or delete every Ruby platform URL
entry (not just one platform URL), before regenerating the lockfile with mise
lock ruby and mise install --force ruby.

In `@src/plugins/core/ruby.rs`:
- Around line 620-623: The current code infers the absence of a build revision
release by comparing tag_name to version, but
`get_release_with_build_revision()` can fall back to the base tag even when a
build-revision release exists. Modify `get_release_with_build_revision()` to
explicitly report whether a build-revision release was actually found (rather
than just a fallback to the base tag), then update the conditional check in
`Self::source_requires_build_revision(repo)` to use this explicit status instead
of inferring it from the tag name comparison.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4bb41242-afed-4632-b28f-022b18768d01

📥 Commits

Reviewing files that changed from the base of the PR and between b65d93d and 3e99e52.

📒 Files selected for processing (3)
  • docs/dev-tools/mise-lock.md
  • docs/lang/ruby.md
  • src/plugins/core/ruby.rs

Comment thread docs/lang/ruby.md Outdated
Comment thread src/plugins/core/ruby.rs Outdated
@jdx jdx force-pushed the codex/mise-build-revision-releases branch from 3e99e52 to 4a85a47 Compare June 14, 2026 06:31
@github-actions

Copy link
Copy Markdown

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.6.7 x -- echo 19.7 ± 1.0 17.9 24.9 1.00
mise x -- echo 20.6 ± 1.4 18.5 33.8 1.05 ± 0.09

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.6.7 env 19.3 ± 1.0 17.4 25.1 1.00
mise env 19.8 ± 1.0 18.0 24.8 1.03 ± 0.07

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.6.7 hook-env 20.1 ± 0.9 18.4 23.6 1.00
mise hook-env 20.5 ± 0.9 18.7 25.8 1.02 ± 0.06

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.6.7 ls 16.8 ± 0.8 15.4 20.1 1.00
mise ls 17.4 ± 0.9 15.6 21.1 1.03 ± 0.07

xtasks/test/perf

Command mise-2026.6.7 mise Variance
install (cached) 137ms 137ms +0%
ls (cached) 60ms 60ms +0%
bin-paths (cached) 65ms 66ms -1%
task-ls (cached) 125ms 127ms -1%

@jdx jdx merged commit 5ebecdc into main Jun 14, 2026
35 checks passed
@jdx jdx deleted the codex/mise-build-revision-releases branch June 14, 2026 07:58
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.

1 participant