Skip to content

registry: add bundler (gem:bundler) - #10939

Merged
jdx merged 2 commits into
jdx:mainfrom
risu729:codex-20260711-150111-417ffa
Jul 11, 2026
Merged

jdx merged 2 commits into
jdx:mainfrom
risu729:codex-20260711-150111-417ffa

Conversation

@risu729

@risu729 risu729 commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • add bundler as a registry alias for gem:bundler
  • ensure the explicitly managed Bundler precedes Ruby's bundled bundle executable on PATH
  • make test-tool expose its synthetic resolved toolset to backend dependency environments

Why a gem: registry entry

Runtime-backed registry entries are generally undesirable because they depend on a separately installed runtime. Bundler is an unusual case: Ruby already supplies the required gem command, but it also supplies a bundle executable that wins on PATH when users configure gem:bundler directly. This is the problem reported in discussion #10931.

The registry's overrides metadata is currently the only declarative way to put the standalone tool before the runtime that bundles the same executable. It is intentionally not exposed in user tool configuration because executable collisions are uncommon and adding another general-purpose ordering option would broaden the configuration surface for a narrow case.

An alternative would be to make depends imply both install ordering and reverse runtime PATH precedence. That couples two different relationships: needing a tool during installation does not necessarily mean the dependent should override the dependency's executables. Keeping depends install-only and recording this exceptional collision in curated registry metadata is more explicit.

The gem backend already declares Ruby as its dependency, so this entry does not duplicate that relationship.

CI root cause

The initial registry CI run installed Ruby before Bundler, but test-tool represented both as synthetic CLI arguments while backend dependency environments were reconstructed from Config. As a result, the gem backend could not find the freshly installed gem executable.

test-tool now places its resolved, concrete tool requests into its cloned config before installation. This keeps backend dependency resolution aligned with the synthetic test toolset and avoids relying on unresolved latest runtime symlinks while dependencies are still being installed.

Popularity

  • RubyGems: 3.55 billion total downloads; Bundler 4.0.16 has over 210,000 downloads since its July 10, 2026 release
  • GitHub (rubygems/rubygems): 3,935 stars, 1,921 forks, active development as of July 10, 2026
  • Used by: the Ruby ecosystem as the standard application dependency manager and distributed with Ruby

Validation

  • mise run render
  • mise run lint-fix
  • target/debug/mise test-tool --jobs 1 bundler
  • target/debug/mise registry bundler
  • target/debug/mise ls-remote bundler

Summary by CodeRabbit

  • New Features

    • Added Bundler backend configuration with Ruby categorization.
    • Added Bundler version detection/validation via the Bundler command.
  • Improvements

    • Enhanced the CLI test tool flow so it builds and applies a complete request set during tests, improving dependency resolution for backend/runtime-backed tools.

@coderabbitai

coderabbitai Bot commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

Bundler backend and test tool resolution

Layer / File(s) Summary
Bundler registry configuration
registry/bundler.toml
Registers gem:bundler, classifies it under Ruby, adds metadata, and defines the bundle --version validation command.
Test tool request propagation
src/cli/test_tool.rs, src/config/mod.rs
Builds a ToolRequestSet from synthetic tool versions and applies it to a derived configuration for dependency resolution during testing.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

I’m a bunny with Bundler in flight,
Ruby’s new backend is tucked in just right.
Test requests hop through config with care,
So every needed tool is waiting there.
A tiny trail of code—
And version checks lighten the load.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding the Bundler registry entry via gem:bundler.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@greptile-apps

greptile-apps Bot commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds bundler as a registry alias for gem:bundler with overrides = ["ruby"] so the installed bundle executable precedes Ruby's built-in one on PATH. It also fixes a test-tool CI failure where the gem backend couldn't locate the freshly-installed gem executable because backend dependency resolution reads from Config rather than the synthetic CLI toolset.

  • registry/bundler.toml: New entry following the established npm/node pattern; overrides = ["ruby"] handles the PATH collision, and bundle --version with {{version}} is a correct substring-match test since the command outputs Bundler version X.Y.Z.
  • src/cli/test_tool.rs: After building the toolset, resolved concrete versions are inserted into a new ToolRequestSet and injected into Config via with_tool_request_set, so gem (and similar runtime-backed tools) can find their dependency backends during installation.
  • src/config/mod.rs: New with_tool_request_set helper clones Config through with_config_files (guaranteeing a fresh OnceCell) and pre-populates it; the .unwrap() on set is safe because the cell is always newly created.

Confidence Score: 5/5

Safe to merge — all three changes are narrowly scoped, the registry entry mirrors an established pattern, and the test-tool fix addresses a real CI reproducibility issue without affecting any existing behavior.

The registry entry is a straightforward addition that follows the npm/node precedent. The Config helper is safe because with_config_files always produces a fresh OnceCell before the set call. The test-tool change only affects synthetic test runs and correctly threads the resolved toolset into Config without touching the normal installation path.

No files require special attention.

Important Files Changed

Filename Overview
registry/bundler.toml New registry entry for gem:bundler with overrides=["ruby"] to ensure bundler's PATH entries win over Ruby's built-in bundle executable — mirrors the established npm.toml/node pattern
src/cli/test_tool.rs Injects the resolved, concrete ToolRequestSet from the built toolset back into Config so runtime-backed backend dependency resolution (e.g., gem backend finding ruby) works during test-tool installation
src/config/mod.rs Adds with_tool_request_set helper that clones Config via with_config_files and pre-populates the tool_request_set OnceCell; the unwrap is safe because with_config_files always produces a fresh, empty OnceCell

Reviews (2): Last reviewed commit: "fix(test-tool): expose dependency tools ..." | Re-trigger Greptile

@risu729
risu729 marked this pull request as ready for review July 11, 2026 07:42
@jdx
jdx merged commit 806b4ab into jdx:main Jul 11, 2026
34 checks passed
@risu729
risu729 deleted the codex-20260711-150111-417ffa branch July 12, 2026 03:57
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.

2 participants