-
-
Notifications
You must be signed in to change notification settings - Fork 103
Update Conductor config to support multiple version managers #867
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Detect and support mise, asdf, or direct PATH (rbenv/nvm/nodenv) - Add bin/conductor-exec wrapper for consistent tool execution - Use bin/conductor-exec in conductor.json scripts - Fall back to direct commands for non-mise users - Add test and lint scripts to conductor.json For mise users in Conductor's non-interactive shell, the setup script automatically uses bin/conductor-exec. The CLAUDE.md documentation covers manual usage when needed. Ported from react_on_rails PR #2302. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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. 📒 Files selected for processing (1)
Note Other AI code review bot(s) detectedCodeRabbit 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. WalkthroughAdds a version-manager-aware execution wrapper ( Changes
Sequence DiagramsequenceDiagram
autonumber
participant User
participant Setup as conductor-setup.sh
participant Exec as bin/conductor-exec
participant VM as VersionManager (mise/asdf/PATH)
participant Ruby
participant Node
User->>Setup: run setup
Setup->>VM: detect manager (mise/asdf/PATH/none)
VM-->>Setup: manager type
Setup->>VM: run_cmd -> check Ruby version
VM->>Ruby: ruby -v (via manager)
Ruby-->>VM: version
VM-->>Setup: ruby OK/fail
Setup->>VM: run_cmd -> check Node version
VM->>Node: node -v (via manager)
Node-->>VM: version
VM-->>Setup: node OK/fail
Setup->>VM: run_cmd -> bundle/yarn install, husky setup
VM->>Ruby: bundle install (if needed)
Ruby-->>VM: success
VM->>Node: yarn install (if needed)
Node-->>VM: success
User->>Exec: run tests/lint (e.g., `bin/conductor-exec bundle exec rspec`)
Exec->>VM: delegate to mise exec or direct exec
VM->>Ruby: execute command
Ruby-->>VM: result
VM-->>Exec: result
Exec-->>User: output
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
Code ReviewI've reviewed this PR and found it to be well-structured with good improvements to version manager support. Here's my detailed feedback: ✅ Strengths
🔍 Code Quality IssuesPortability Concerns
Version Comparison LogicLocation: The version comparison using
Suggestion: Add validation or use a more robust version comparison method 🐛 Potential Bugs
🔒 Security ConsiderationsNo major security issues found ✅
🧪 Test CoverageMissing: No automated tests for the shell scripts. Consider:
🎯 Recommendations SummaryHigh Priority:
Medium Priority:
✅ Approval RecommendationThis PR is nearly ready to merge after addressing the shell portability question. The code quality is good, the approach is sound, and the UX improvements are valuable. Suggested next steps:
Great work on improving the developer experience! 🎉 |
Greptile SummaryThis PR enhances Conductor workspace setup to support multiple version managers (mise, asdf, rbenv/nvm/nodenv), replacing the previous asdf-only approach. It introduces a new Key changes:
Considerations:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Conductor
participant conductor-setup.sh
participant bin/conductor-exec
participant mise/asdf/PATH
User->>Conductor: Run setup script
Conductor->>conductor-setup.sh: Execute
conductor-setup.sh->>conductor-setup.sh: Detect version manager
alt mise detected
conductor-setup.sh->>mise/asdf/PATH: mise trust
conductor-setup.sh->>mise/asdf/PATH: mise install
else asdf detected
conductor-setup.sh->>mise/asdf/PATH: source asdf.sh
else no version manager
conductor-setup.sh->>conductor-setup.sh: Use system PATH
end
conductor-setup.sh->>bin/conductor-exec: run_cmd ruby --version
bin/conductor-exec->>bin/conductor-exec: Check if mise available
alt mise available
bin/conductor-exec->>mise/asdf/PATH: mise exec -- ruby --version
else fallback
bin/conductor-exec->>mise/asdf/PATH: ruby --version
end
mise/asdf/PATH-->>conductor-setup.sh: Version info
conductor-setup.sh->>bin/conductor-exec: run_cmd bundle install
bin/conductor-exec->>mise/asdf/PATH: Execute with correct Ruby
conductor-setup.sh->>bin/conductor-exec: run_cmd yarn install
bin/conductor-exec->>mise/asdf/PATH: Execute with correct Node
conductor-setup.sh-->>Conductor: Setup complete
User->>Conductor: Run test/lint script
Conductor->>bin/conductor-exec: bin/conductor-exec bundle exec rspec
bin/conductor-exec->>mise/asdf/PATH: Execute with correct versions
mise/asdf/PATH-->>User: Test results
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5 files reviewed, 4 comments
bin/conductor-exec
Outdated
| @@ -0,0 +1,24 @@ | |||
| #!/usr/bin/env zsh | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Shebang inconsistency: this uses #!/usr/bin/env zsh while conductor-setup.sh:1 uses #!/bin/zsh. Should use the same approach for consistency.
| #!/usr/bin/env zsh | |
| #!/bin/zsh |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: bin/conductor-exec
Line: 1:1
Comment:
**style:** Shebang inconsistency: this uses `#!/usr/bin/env zsh` while `conductor-setup.sh:1` uses `#!/bin/zsh`. Should use the same approach for consistency.
```suggestion
#!/bin/zsh
```
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.
conductor-setup.sh
Outdated
| #!/bin/zsh | ||
| set -e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Changed from bash to zsh and removed stricter error handling. The old script used set -euo pipefail (fails on undefined variables and pipe failures), but this now only uses set -e. This could allow errors to slip through if undefined variables or failing pipe commands are used.
Prompt To Fix With AI
This is a comment left during a code review.
Path: conductor-setup.sh
Line: 1:2
Comment:
**style:** Changed from bash to zsh and removed stricter error handling. The old script used `set -euo pipefail` (fails on undefined variables and pipe failures), but this now only uses `set -e`. This could allow errors to slip through if undefined variables or failing pipe commands are used.
How can I resolve this? If you propose a fix, please make it concise.| VERSION_MANAGER="mise" | ||
| echo "✅ Found mise" | ||
| # Trust mise config for current directory only and install tools | ||
| mise trust 2>/dev/null || true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: The mise trust command trusts the mise configuration in the current directory. This is necessary for mise to work, but could be a security concern if running in untrusted repositories. The old script didn't require this trust step.
Prompt To Fix With AI
This is a comment left during a code review.
Path: conductor-setup.sh
Line: 16:16
Comment:
**style:** The `mise trust` command trusts the mise configuration in the current directory. This is necessary for mise to work, but could be a security concern if running in untrusted repositories. The old script didn't require this trust step.
How can I resolve this? If you propose a fix, please make it concise.| if command -v mise &> /dev/null; then | ||
| VERSION_MANAGER="mise" | ||
| echo "✅ Found mise" | ||
| # Trust mise config for current directory only and install tools | ||
| mise trust 2>/dev/null || true | ||
| mise install | ||
| elif [[ -f ~/.asdf/asdf.sh ]]; then | ||
| VERSION_MANAGER="asdf" | ||
| source ~/.asdf/asdf.sh | ||
| echo "✅ Found asdf (from ~/.asdf/asdf.sh)" | ||
| elif command -v asdf &> /dev/null; then | ||
| VERSION_MANAGER="asdf" | ||
| # For homebrew-installed asdf | ||
| if [[ -f /opt/homebrew/opt/asdf/libexec/asdf.sh ]]; then | ||
| source /opt/homebrew/opt/asdf/libexec/asdf.sh | ||
| fi | ||
| echo "✅ Found asdf" | ||
| else | ||
| BUNDLE_CMD="bundle" | ||
| echo "ℹ️ No version manager detected, using system PATH" | ||
| echo " (Assuming rbenv/nvm/nodenv or system tools are already configured)" | ||
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: The old script created .tool-versions file with echo "ruby 3.3.4" > .tool-versions to ensure asdf users had a Ruby version specified. The new script removes this, so asdf/mise users must have a pre-existing .tool-versions or .mise.toml file in the repository or their home directory. Check that all supported version managers will have access to appropriate version configuration.
Prompt To Fix With AI
This is a comment left during a code review.
Path: conductor-setup.sh
Line: 12:32
Comment:
**style:** The old script created `.tool-versions` file with `echo "ruby 3.3.4" > .tool-versions` to ensure asdf users had a Ruby version specified. The new script removes this, so asdf/mise users must have a pre-existing `.tool-versions` or `.mise.toml` file in the repository or their home directory. Check that all supported version managers will have access to appropriate version configuration.
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@conductor-setup.sh`:
- Around line 101-104: The echo message "✅ Running initial linting checks..." is
misleading because the script only runs `run_cmd bundle exec rubocop --version`;
either update the message to something like "✅ Verifying linting tools..." to
reflect that it checks installation, or actually run the lint by replacing the
`--version` invocation with `run_cmd bundle exec rubocop` (or add a separate
lint run) so the message matches the action; update the line near the `run_cmd
bundle exec rubocop --version` call accordingly.
🧹 Nitpick comments (2)
bin/conductor-exec (1)
1-1: Consider using/usr/bin/env shfor broader portability.The script only uses POSIX-compatible constructs (
command -v,if/else/fi,exec "$@"), so it could work with/bin/sh. However, if the project intentionally standardizes on zsh (matchingconductor-setup.sh), this is acceptable.conductor-setup.sh (1)
22-28: Missing Intel Mac homebrew path for asdf.The script only checks the Apple Silicon homebrew path (
/opt/homebrew/opt/asdf/...). Intel Macs use/usr/local/opt/asdf/libexec/asdf.sh.♻️ Proposed fix
elif command -v asdf &> /dev/null; then VERSION_MANAGER="asdf" # For homebrew-installed asdf if [[ -f /opt/homebrew/opt/asdf/libexec/asdf.sh ]]; then source /opt/homebrew/opt/asdf/libexec/asdf.sh + elif [[ -f /usr/local/opt/asdf/libexec/asdf.sh ]]; then + source /usr/local/opt/asdf/libexec/asdf.sh fi echo "✅ Found asdf"
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
.rubocop.ymlCLAUDE.mdbin/conductor-execconductor-setup.shconductor.json
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: CR
Repo: shakacode/shakapacker PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-22T04:44:25.430Z
Learning: This gem supports both webpack and rspack configurations - test changes with both bundlers when modifying core functionality
📚 Learning: 2025-12-22T04:44:25.430Z
Learnt from: CR
Repo: shakacode/shakapacker PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-22T04:44:25.430Z
Learning: ALWAYS use `bundle exec` prefix when running Ruby commands (rubocop, rspec, rake, etc.)
Applied to files:
bin/conductor-exec.rubocop.ymlconductor-setup.shconductor.jsonCLAUDE.md
📚 Learning: 2025-12-22T04:44:25.430Z
Learnt from: CR
Repo: shakacode/shakapacker PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-22T04:44:25.430Z
Learning: ALWAYS run `bundle exec rubocop` before committing Ruby changes
Applied to files:
.rubocop.ymlconductor-setup.shconductor.json
📚 Learning: 2024-10-09T10:46:03.499Z
Learnt from: marvinthepa
Repo: shakacode/shakapacker PR: 520
File: lib/shakapacker/utils/manager.rb:19-19
Timestamp: 2024-10-09T10:46:03.499Z
Learning: In `lib/install/template.rb` of the Shakapacker project, calls to `PackageJson.read` are wrapped inside `Dir.chdir(Rails.root)`, ensuring that `package.json` is read from the Rails root directory.
Applied to files:
conductor-setup.sh
📚 Learning: 2025-12-22T04:44:25.430Z
Learnt from: CR
Repo: shakacode/shakapacker PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-22T04:44:25.430Z
Learning: ALWAYS run `yarn lint` before committing JavaScript changes
Applied to files:
conductor-setup.sh
📚 Learning: 2025-12-22T04:44:25.430Z
Learnt from: CR
Repo: shakacode/shakapacker PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-22T04:44:25.430Z
Learning: Run the full test suite with `bundle exec rspec` before pushing
Applied to files:
conductor.json
📚 Learning: 2025-12-22T04:44:25.430Z
Learnt from: CR
Repo: shakacode/shakapacker PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-22T04:44:25.430Z
Learning: This gem supports both webpack and rspack configurations - test changes with both bundlers when modifying core functionality
Applied to files:
CLAUDE.md
📚 Learning: 2025-12-22T04:44:25.430Z
Learnt from: CR
Repo: shakacode/shakapacker PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-22T04:44:25.430Z
Learning: Be aware of the dual package.json/Gemfile dependency management
Applied to files:
CLAUDE.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
- GitHub Check: Greptile Review
- GitHub Check: Testing (ubuntu-latest, 3.2, gemfiles/Gemfile-rails.7.0.x)
- GitHub Check: Testing (ubuntu-latest, 3.3, gemfiles/Gemfile-rails.8.0.x)
- GitHub Check: Testing (ubuntu-latest, 2.7, gemfiles/Gemfile-rails.6.0.x)
- GitHub Check: Testing (ubuntu-latest, 3.4, gemfiles/Gemfile-rails.7.1.x)
- GitHub Check: Testing (ubuntu-latest, 3.3, gemfiles/Gemfile-rails.7.1.x)
- GitHub Check: Testing (ubuntu-latest, 3.0, gemfiles/Gemfile-rails.7.1.x)
- GitHub Check: Testing (ubuntu-latest, 3.2, gemfiles/Gemfile-rails.7.2.x)
- GitHub Check: Testing (ubuntu-latest, 3.2, gemfiles/Gemfile-rails.6.1.x)
- GitHub Check: Testing (ubuntu-latest, 2.7, gemfiles/Gemfile-rails.7.1.x)
- GitHub Check: Testing (ubuntu-latest, 3.2, gemfiles/Gemfile-rails.8.0.x)
- GitHub Check: Testing (ubuntu-latest, 3.1, gemfiles/Gemfile-rails.7.0.x)
- GitHub Check: Testing (ubuntu-latest, 3.3, gemfiles/Gemfile-rails.7.0.x)
- GitHub Check: Testing (ubuntu-latest, 2.7, gemfiles/Gemfile-rails.7.0.x)
- GitHub Check: Testing (ubuntu-latest, 3.1, gemfiles/Gemfile-rails.7.1.x)
- GitHub Check: Testing (ubuntu-latest, 3.2, gemfiles/Gemfile-rails.7.1.x)
- GitHub Check: Testing (ubuntu-latest, 3.0, gemfiles/Gemfile-rails.6.0.x)
- GitHub Check: Testing (ubuntu-latest, 3.0, gemfiles/Gemfile-rails.6.1.x)
- GitHub Check: Testing (ubuntu-latest, 2.7, gemfiles/Gemfile-rails.6.1.x)
- GitHub Check: claude-review
🔇 Additional comments (8)
.rubocop.yml (1)
13-13: LGTM!Correctly excludes the shell script from Ruby linting with a clear explanatory comment.
bin/conductor-exec (1)
19-24: LGTM!Clean and correct implementation. Proper use of
execto replace the shell process and"$@"for correct argument handling.conductor.json (1)
4-6: LGTM!Scripts correctly use the
bin/conductor-execwrapper and follow project conventions withbundle execprefix. The lint script properly combines both Ruby (rubocop) and JavaScript (yarn lint) checks. Based on learnings, this aligns with the project's requirements.conductor-setup.sh (4)
34-41: LGTM!The helper correctly delegates to
bin/conductor-execonly for mise users (since mise requiresmise execfor tool resolution), while asdf users benefit from the PATH modifications done by sourcingasdf.shearlier.
48-66: LGTM!Version extraction and comparison logic is correct. Using
sort -Vfor semantic version comparison is a robust approach.
68-79: LGTM!Safe handling of the optional
CONDUCTOR_ROOT_PATHvariable with proper fallback syntax.
81-99: LGTM!Correct use of
--frozen-lockfilefor reproducible installs and proper Husky setup with lint-staged integration.CLAUDE.md (1)
48-55: LGTM!Clear and helpful documentation of the Conductor environment setup and wrapper usage. Good note about conductor.json scripts already using the wrapper.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
If a version manager is detected but no .tool-versions or .mise.toml exists, create a default .tool-versions with Ruby 3.3.4 and Node 20.18.0. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use #!/bin/zsh consistently in both scripts - Restore set -euo pipefail for better error handling Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Code Review - PR #867Overall AssessmentThis is a well-structured PR that improves Conductor setup by supporting multiple version managers (mise, asdf, PATH). The implementation is clean with good documentation. However, there are some issues to address. Strengths
Potential Bugs & Issues1. CRITICAL: Inconsistent shebang usage
2. Logic inconsistency in run_cmd function (lines 44-50)
3. Race condition: bin/conductor-exec might not exist
4. Missing version validation
Security Considerations1. mise trust without confirmation (line 16)
2. Command injection: Properly handled ✅
Test Coverage
Code Quality✅ Good:
SummaryRecommendation: Approve with minor fixes Must fix before merge:
Nice to have:
Overall: Solid improvement to developer experience. Issues are minor and easily addressable. 🤖 Review generated with Claude Code |
The message said "Running initial linting checks" but only verified rubocop was installed. Changed to "Verifying linting tools". Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Code Review: Update Conductor config to support multiple version managersOverviewThis PR adds support for multiple version managers (mise, asdf, and PATH-based tools). Overall, this is a well-thought-out improvement that addresses real developer experience issues. ✅ Strengths
🔍 High Priority Issues1. Shell compatibility (conductor-setup.sh:1)The script uses Recommendation: Revert to bash or add a check to verify zsh is available. 2. Version comparison portability (conductor-setup.sh:60, 69)The Recommendation: Test on macOS or use a more portable version comparison function. 3. Tool installation inconsistencyThe script calls Recommendation: Add asdf tool installation for consistency. 🔧 Medium Priority Issues
🧪 Testing NeededBefore merging, test:
📝 Minor Suggestions
SummaryRecommendation: Request changes to address the high-priority portability issues (shell compatibility, version comparison, asdf install), then merge after testing on both macOS and Linux with different version managers. This is a valuable improvement - just needs some portability fixes before merging. |
PR Review: Update Conductor config to support multiple version managersSummaryThis PR adds multi-version-manager support (mise, asdf, PATH-based) to the Conductor setup script. Overall, this is a well-structured and thoughtful enhancement that improves the developer experience for Conductor users. ✅ StrengthsCode Quality
Documentation
Design Decisions
🔍 Issues & Recommendations1. Critical: Missing Trailing Newlines
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@conductor-setup.sh`:
- Around line 12-41: When mise is detected, the script currently runs "mise
install" before creating .tool-versions, so on a clean repo mise has nothing to
install; remove or defer the "mise install" call from the initial mise detection
block (leave mise trust there if desired) and invoke "mise install" after the
block that creates the .tool-versions file (i.e., add a conditional that runs
mise install only when VERSION_MANAGER == "mise" right after the section that
writes .tool-versions), ensuring the VERSION_MANAGER variable and existence
checks (.tool-versions/.mise.toml) are used to decide whether to call mise
install.
♻️ Duplicate comments (1)
conductor-setup.sh (1)
110-113: Message/action mismatch already noted in prior review.
On a clean repo, mise install was running before .tool-versions existed, so it had nothing to install. Now: 1. Detect mise and run mise trust 2. Create .tool-versions if missing 3. Run mise install (now has versions to install) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When creating .tool-versions for asdf/mise users, now reads from: - .ruby-version (if exists) for Ruby version - .node-version (if exists) for Node version Falls back to sensible defaults (Ruby 3.3.4, Node 20.18.0) only when these files don't exist. This prevents version drift between project version files and the generated .tool-versions. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary
bin/conductor-execwrapper that usesmise execwhen available, falls back to direct execution otherwiseHow it works
The setup script now:
bin/conductor-execwrapper for all commandsRelated
Ported from react_on_rails PR #2302.
Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation
Chores
✏️ Tip: You can customize this high-level summary in your review settings.