Skip to content

Port Conductor multi-version-manager support from react_on_rails#2302#692

Merged
justin808 merged 2 commits intomasterfrom
jg/port-pr-2302
Jan 15, 2026
Merged

Port Conductor multi-version-manager support from react_on_rails#2302#692
justin808 merged 2 commits intomasterfrom
jg/port-pr-2302

Conversation

@justin808
Copy link
Member

Summary

Ports the Conductor multi-version-manager support from react_on_rails#2302:

  • Add bin/conductor-exec wrapper script for Conductor environments
  • Update conductor-setup.sh to detect and support mise, asdf, or direct PATH (rbenv/nvm/nodenv)
  • Use bin/conductor-exec in conductor.json scripts
  • Add test and lint scripts to conductor.json

How it works

The bin/conductor-exec wrapper:

  • Uses mise exec when mise is available
  • Falls back to direct execution for non-mise users (asdf, rbenv, nvm, nodenv)

The setup script now:

  1. Checks for mise first → uses bin/conductor-exec wrapper for all commands
  2. Falls back to asdf → sources asdf.sh to configure PATH
  3. Falls back to direct commands → assumes rbenv/nvm/nodenv or system tools are in PATH

Test plan

  • Test workspace setup in Conductor with mise
  • Test workspace setup in Conductor with asdf
  • Test workspace setup in Conductor with direct PATH

🤖 Generated with Claude Code

…ls#2302

- Add bin/conductor-exec wrapper for Conductor environments
- Update conductor-setup.sh to detect mise/asdf/direct PATH
- Use bin/conductor-exec in conductor.json scripts
- Add test and lint scripts to conductor.json

The wrapper uses mise exec when available, falling back to direct
execution for non-mise users (asdf, rbenv, nvm, nodenv).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Jan 15, 2026

Warning

Rate limit exceeded

@justin808 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 15 minutes and 17 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between ce0aef6 and 203449a.

📒 Files selected for processing (4)
  • CLAUDE.md
  • bin/conductor-exec
  • conductor-setup.sh
  • conductor.json

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch jg/port-pr-2302

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 and usage tips.

@github-actions
Copy link

🚀 Quick Review App Commands

Welcome! Here are the commands you can use in this PR:

/deploy-review-app

Deploy your PR branch for testing

/delete-review-app

Remove the review app when done

/help

Show detailed instructions, environment setup, and configuration options.


@claude
Copy link

claude bot commented Jan 15, 2026

PR Review: Port Conductor Multi-Version-Manager Support

Thank you for porting this feature from react_on_rails! This is a solid improvement for multi-version manager support. Here's my detailed review:

✅ Strengths

  1. Well-documented wrapper script - The bin/conductor-exec has excellent inline documentation explaining its purpose and usage
  2. Flexible version manager detection - Good fallback chain: mise → asdf → direct PATH
  3. Clear user feedback - The setup script provides helpful output and error messages
  4. Version validation - Good addition of Ruby and Node version checks
  5. Consistent script structure - Matches the pattern established in react_on_rails#2302

🔍 Code Quality Issues

Critical Issues

  1. Ruby version mismatch (conductor-setup.sh:41)

    • Comment says "This project requires Ruby 3.4.6"
    • .ruby-version file shows 3.4.3
    • Recommendation: Update comment to match actual version or update .ruby-version
  2. Potential PATH issues with asdf (conductor-setup.sh:18-28)

    • The asdf sourcing only happens in the setup script, not in bin/conductor-exec
    • If bin/conductor-exec is called in a clean shell (as with Conductor), asdf won't be in PATH
    • This could cause run_cmd to fail when VERSION_MANAGER="asdf" but conductor-exec doesn't know about asdf
    • Recommendation: Consider documenting that asdf users need asdf in their PATH for conductor-exec to work, or enhance conductor-exec to handle asdf
  3. Sort version comparison portability (conductor-setup.sh:53, 64)

    • Using sort -V which may not be available on all systems (BSD/macOS sort doesn't support -V by default)
    • Recommendation: Use a more portable version comparison or add a fallback

Minor Issues

  1. Inconsistent error handling (conductor-setup.sh:17)

    • mise trust 2>/dev/null || true silently ignores errors
    • While this may be intentional, consider logging when trust fails
  2. Missing shebang consistency check (bin/conductor-exec:1)

    • Uses #\!/usr/bin/env zsh
    • Most other bin/ scripts use #\!/usr/bin/env ruby
    • This is fine, but ensure zsh is available in all target environments
  3. Redundant PATH check in conductor-exec (bin/conductor-exec:19)

    • Checks for mise availability but doesn't check if bin/conductor-exec itself exists (referenced in conductor-setup.sh:36)
    • Minor: The existence check in setup could fail gracefully

🐛 Potential Bugs

  1. Race condition with mise install (conductor-setup.sh:17)

    • mise install runs before checking if Ruby/Node are available
    • If install fails, the subsequent checks may pass if system versions exist
    • Recommendation: Check mise install exit code or verify mise-installed versions specifically
  2. Unquoted variables (conductor-setup.sh:75-91)

    • Variables like $CONDUCTOR_ROOT_PATH are used in conditionals without quotes
    • While bash/zsh handles empty vars in [[ ]], it's safer to quote: [[ -f "$CONDUCTOR_ROOT_PATH/.env" ]]

🚀 Performance Considerations

  • Multiple command -v calls: The script calls command -v several times. This is minimal overhead and acceptable for a setup script.
  • mise exec overhead: Each bin/conductor-exec call adds a small overhead with mise exec. This is acceptable for the use case.

🔒 Security Concerns

  1. mise trust (conductor-setup.sh:17)

    • mise trust allows executing config from the current directory
    • This is documented and expected, but worth noting for users
    • The 2>/dev/null || true means users won't see trust warnings
    • Recommendation: Consider showing trust output or documenting security implications
  2. Unrestricted exec (bin/conductor-exec:20, 23)

    • exec "$@" passes through all arguments without validation
    • This is intended behavior but means the wrapper fully trusts caller
    • Not a vulnerability in this context, but worth documenting

📊 Test Coverage

Missing:

  • The PR checklist mentions testing with mise, asdf, and direct PATH but items are unchecked
  • No automated tests for the shell scripts
  • No CI workflow updates to test this functionality

Recommendations:

  • Add basic smoke tests in CI that verify bin/conductor-exec ruby --version works
  • Consider adding shellcheck to CI for script validation
  • Complete the test plan checklist before merging

🎯 Suggestions for Improvement

  1. Add error messaging for missing zsh
  2. Make version requirements configurable - Hard-coded version checks (3.0.0, 20.0.0) could be variables or read from config
  3. Add --help flag to conductor-exec
  4. Consider adding a .conductor-version or similar file to track compatible version manager configs

📝 Documentation

  • The inline comments are excellent
  • The PR description clearly explains the changes
  • Consider adding a note to README.md about Conductor requirements if not already present

✨ Summary

This is a well-implemented feature port with good documentation and error handling. The main concerns are:

  1. Fix the Ruby version comment/file mismatch ⚠️
  2. Address asdf PATH availability in conductor-exec ⚠️
  3. Fix sort -V portability issue ⚠️
  4. Complete the test plan before merging
  5. Consider adding quotes around variable expansions for safety

The code follows good shell scripting practices overall. Once the critical issues are addressed and testing is completed, this should be ready to merge.

Recommendation: Request changes - address critical issues before merging.


Review generated by Claude Code

@greptile-apps
Copy link

greptile-apps bot commented Jan 15, 2026

Greptile Summary

Adds multi-version-manager support for Conductor environments by introducing a wrapper script and enhanced setup detection logic. The implementation properly detects mise, asdf, or direct PATH environments and adapts command execution accordingly.

Key Changes:

  • New bin/conductor-exec wrapper uses mise exec when available, falls back to direct execution otherwise
  • Enhanced conductor-setup.sh with version manager detection (mise → asdf → direct PATH), tool version validation (Ruby >= 3.0.0, Node >= 20.0.0), and improved error messages
  • Updated conductor.json to use wrapper for run, test, and lint commands

Issues Found:

  • Ruby version comment incorrectly states 3.4.6 instead of 3.4.3 (see inline comment)

Confidence Score: 4/5

  • Safe to merge after fixing the Ruby version comment in conductor-setup.sh
  • The implementation is solid with proper fallback logic and good error handling. The only issue is a documentation error (wrong Ruby version) that should be corrected before merge. All scripts are well-structured and the version manager detection follows a sensible priority order.
  • Fix the Ruby version comment in conductor-setup.sh:43

Important Files Changed

Filename Overview
bin/conductor-exec New wrapper script that uses mise exec when available, falls back to direct execution otherwise. Clean implementation with good documentation.
conductor-setup.sh Enhanced setup script with version manager detection (mise/asdf/direct), tool version validation, and improved error handling. Contains one syntax error in Ruby version comment.
conductor.json Updated to use bin/conductor-exec wrapper for run, test, and lint commands. Clean and consistent.

Sequence Diagram

sequenceDiagram
    participant Conductor
    participant Setup as conductor-setup.sh
    participant Exec as bin/conductor-exec
    participant Mise
    participant Asdf
    participant Tool as ruby/node/bundle

    Conductor->>Setup: Execute setup script
    
    alt mise available
        Setup->>Mise: Check if mise exists
        Mise-->>Setup: Found
        Setup->>Setup: Set VERSION_MANAGER="mise"
        Setup->>Mise: mise trust & install
        Setup->>Exec: run_cmd ruby --version
        Exec->>Mise: Check if mise exists
        Mise-->>Exec: Found
        Exec->>Mise: mise exec -- ruby --version
        Mise->>Tool: Execute with correct version
        Tool-->>Setup: Version output
    else asdf available
        Setup->>Asdf: Check ~/.asdf/asdf.sh
        Asdf-->>Setup: Found
        Setup->>Asdf: source asdf.sh
        Setup->>Setup: Set VERSION_MANAGER="asdf"
        Setup->>Tool: ruby --version (asdf in PATH)
        Tool-->>Setup: Version output
    else direct PATH
        Setup->>Setup: Set VERSION_MANAGER="none"
        Setup->>Tool: ruby --version (system/rbenv/nvm)
        Tool-->>Setup: Version output
    end
    
    Setup->>Setup: Validate Ruby >= 3.0.0
    Setup->>Setup: Validate Node >= 20.0.0
    Setup->>Exec: run_cmd bin/setup --skip-server
    
    Note over Conductor,Tool: Later, in conductor.json
    Conductor->>Exec: bin/conductor-exec bin/dev
    alt mise available
        Exec->>Mise: mise exec -- bin/dev
        Mise->>Tool: Start with correct versions
    else no mise
        Exec->>Tool: bin/dev (direct execution)
    end
Loading

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

3 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

fi
}

# Note: This project requires Ruby 3.4.6.
Copy link

Choose a reason for hiding this comment

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

syntax: Ruby version in comment is incorrect. .ruby-version file specifies 3.4.3, not 3.4.6.

Suggested change
# Note: This project requires Ruby 3.4.6.
# Note: This project requires Ruby 3.4.3.
Prompt To Fix With AI
This is a comment left during a code review.
Path: conductor-setup.sh
Line: 43:43

Comment:
**syntax:** Ruby version in comment is incorrect. `.ruby-version` file specifies `3.4.3`, not `3.4.6`.

```suggestion
# Note: This project requires Ruby 3.4.3.
```

How can I resolve this? If you propose a fix, please make it concise.

Port documentation from react_on_rails#2301 explaining how to use
bin/conductor-exec wrapper for version manager compatibility.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@justin808 justin808 merged commit 62103d0 into master Jan 15, 2026
6 checks passed
@justin808 justin808 deleted the jg/port-pr-2302 branch January 15, 2026 03:29
@github-actions
Copy link

github-actions bot commented Jan 15, 2026

✅ Review app for PR #692 was successfully deleted

View Completed Delete Logs

Control Plane Organization

@claude
Copy link

claude bot commented Jan 15, 2026

Code Review - PR #692: Port Conductor Multi-Version-Manager Support

Summary

This PR adds comprehensive version manager support for Conductor environments, enabling proper tool version detection for mise, asdf, rbenv, nvm, and nodenv. The implementation is well-structured and addresses a real pain point in non-interactive shell environments.


✅ Strengths

  1. Clear Problem Statement: CLAUDE.md effectively documents the problem, symptoms, and solution
  2. Fallback Strategy: Excellent cascading detection logic (mise → asdf → direct PATH)
  3. Good Documentation: Inline comments and examples are helpful
  4. Defensive Programming: Version checks with clear error messages (lines 51-69 in conductor-setup.sh)
  5. User Experience: Helpful output messages with emojis make the setup process friendly

🐛 Potential Issues

1. Shell Portability Concerns (Medium Priority)

Location: conductor-setup.sh:1, bin/conductor-exec:1

Both scripts use shebang #!/bin/zsh which may not be available on all systems. While zsh is common on macOS, many CI environments and Linux systems default to bash.

Issue: If zsh is not installed, the scripts will fail immediately with a cryptic error.

Recommendation: Consider using #!/usr/bin/env bash or add an early zsh check with a helpful error message.


2. Version Comparison Logic May Fail (Medium Priority)

Location: conductor-setup.sh:54, conductor-setup.sh:64

The version comparison using sort -V has edge cases:

  • sort -V behavior varies across platforms (GNU vs BSD)
  • Will not work correctly with pre-release versions (e.g., 3.4.0-preview1)
  • The echo -e flag is unnecessary here

Recommendation: Use a more robust version comparison or at minimum document the limitation by stripping pre-release suffixes before comparison.


3. Security: Implicit Trust of mise Configuration (Medium Priority)

Location: conductor-setup.sh:16

The script automatically runs mise trust which executes configuration from .mise.toml or .tool-versions. This could be a security risk if the repository is cloned from an untrusted source or malicious tasks are defined in mise configuration.

Recommendation: Add a warning message explaining what mise trust does, especially for public repositories.


4. Silent Failure in mise trust (Low Priority)

Location: conductor-setup.sh:16

The line mise trust 2>/dev/null || true suppresses stderr, making debugging difficult if mise trust fails for unexpected reasons.

Recommendation: Consider providing a warning message if mise trust fails to help with troubleshooting.


🧪 Test Coverage

Missing: No automated tests for the new functionality.

Recommendations:

  1. Add shell script tests using bats or similar testing framework
  2. Test cases should cover:
    • mise detected and used correctly
    • asdf detected and used correctly
    • Fallback to direct PATH works
    • Version validation fails appropriately
    • Missing tools are detected

📋 Additional Suggestions

  1. CLAUDE.md: Consider adding a troubleshooting section for common issues
  2. conductor.json: The new test and lint scripts are great! Consider adding format and console commands too
  3. Error Messages: Consider adding troubleshooting URLs to error messages

✅ Approval Recommendation

Overall Assessment: ✅ Approve with minor revisions

This is a solid implementation that solves a real problem. The main concerns are:

  • Shell portability (zsh dependency)
  • Version comparison edge cases
  • Security consideration around automatic mise trust

None of these are blocking issues, but addressing them would make the solution more robust.

Priority Fixes (if desired):

  1. High: Consider bash compatibility or document zsh requirement
  2. Medium: Improve version comparison or document limitations
  3. Low: Add tests for regression prevention

Great work documenting the problem in CLAUDE.md - this will help future maintainers significantly! 🎉

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