Skip to content

test: cover modern services winning over same-named v2 tools on install - #7575

Merged
viceice merged 1 commit into
mainfrom
fix/legacy-tool-followups
Oct 1, 2026
Merged

viceice merged 1 commit into
mainfrom
fix/legacy-tool-followups

Conversation

@viceice

@viceice viceice commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Changes

Follow-up to the python and ruby conversion (#7558, #7559):

  • A test that install-tool uses the TypeScript service when a custom image ships a v2 shell tool with the same name, like the existing prepare test.
  • The install container JSDoc describes the registration order instead of the removed "without its own service" filter.
  • The prepare test no longer leaves a ruby prepared marker behind for later tests.

Release note for #7558: v2 shell tools no longer get PIP_INDEX_URL from URL_REPLACE_*. A custom v2 tool that runs pip install behind a pypi mirror replacement has to set the index itself.

Context

  • This closes an existing Issue, Closes: #
  • This doesn't close an Issue, but I accept the risk that this PR may be closed if maintainers disagree with its opening or implementation

AI assistance disclosure

Did you use AI tools to create any part of this pull request?

  • No — I did not use AI for this contribution.
  • Yes — minimal assistance (e.g., IDE autocomplete, small code completions, grammar fixes).
  • Yes — substantive assistance (AI-generated non‑trivial portions of code, tests, or documentation).
  • Yes — other (please describe):

Code and tests were written by Claude Opus 5.5 in Claude Code.

Use of AI in replying to PR comments

Who answers review comments:

  • @username will read and reply directly. Name the account.
  • An agent will draft replies and @viceice will read them before they are posted.
  • Nobody has explicitly committed to replying.

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified tests

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Added coverage confirming that Ruby 3.4.11 installation uses the modern installer when a same-named v2 tool is also available.
    • Updated preparation test setup for the Ruby installer precedence scenario.

Also fix the install container JSDoc and keep the prepare test from leaving a ruby prepared marker behind.

Co-Authored-By: Claude Opus 5.5 <michael.kriese+claude-code@mend.io>
@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: containerbase/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: e7d79674-3af2-48c3-bdb7-39777e53a91b

📥 Commits

Reviewing files that changed from the base of the PR and between 7dd04ab and 092b724.

📒 Files selected for processing (3)
  • src/cli/install-tool/index.spec.ts
  • src/cli/install-tool/index.ts
  • src/cli/prepare-tool/index.spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

The install-tool comment now documents generic v2 shell-tool bindings and modern-service precedence. Tests verify Ruby installation dispatch when a same-named v2 tool exists and stub preparation state handling.

Changes

Ruby installer precedence

Layer / File(s) Summary
Installer precedence and Ruby test setup
src/cli/install-tool/index.ts, src/cli/install-tool/index.spec.ts, src/cli/prepare-tool/index.spec.ts
The comment describes generic v2 bindings and modern-service precedence. The install test checks that Ruby 3.4.11 uses RubyInstallService rather than V2ToolInstallService when both have the same name. The preparation test stubs PathService.setPrepared.

Priority: ⬇️ Low

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

Change: Other

Merge Risk: ⚪ Minimal · up to 092b7

This change clarifies installer precedence and adds isolated test coverage. The reported v2 pip-mirror behavior was not introduced here, so no actionable merge risk remains.

Architecture Summary

Architecture risk: 🔵 Low · up to 092b7

The change affects 1 system.

Changed systems: src

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — src (service) was modified; 3 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in src/cli/install-tool/index.spec.ts: Added the RubyInstallService import for the modern Ruby installer.
  • observed — Modified behavior in src/cli/install-tool/index.spec.ts: Added the V2ToolInstallService import to observe whether installation dispatches to the v2 shell-tool service.
  • observed — Modified behavior in src/cli/install-tool/index.spec.ts: Added a test that places ruby.sh in the v2 tools directory, stubs the modern Ruby install lifecycle, and verifies that installing Ruby 3.4.11 calls RubyInstallService.install once while leaving V2ToolInstallService.install uncalled. The test removes the temporary script in a finally block.
  • observed — Modified behavior in src/cli/install-tool/index.ts: The comment now says every v2 shell tool gets a generic service and that modern services win name conflicts because generic bindings are last; it previously limited generic services to tools without their own service.
🚥 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 clearly and concisely describes the main change: adding test coverage to confirm that modern services take precedence over same-named v2 tools during installation.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 3 files.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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

@viceice
viceice enabled auto-merge October 1, 2026 13:31
@viceice
viceice added this pull request to the merge queue Oct 1, 2026
Merged via the queue into main with commit 8c76475 Oct 1, 2026
109 of 113 checks passed
@viceice
viceice deleted the fix/legacy-tool-followups branch October 1, 2026 13:56
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