feat: Git Bash can install and complete uloop on Windows#1055
Conversation
Allow the POSIX installer to resolve and install the Windows amd64 release asset from Git Bash/MSYS, including paged latest-release lookup and zip extraction. Detect Git Bash for completion installation while preserving the PowerShell defaults for regular Windows terminals, and align user-facing completion helper guidance with the top-level --list-* commands.
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ 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. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR refactors shell detection to support MSYSTEM environment variable (for Git Bash on Windows), updates CLI help text to promote global ChangesShell Detection with MSYSTEM Support & Completion UX
Installation Script Refactoring for Multi-Asset Support
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
scripts/install.sh (1)
25-53:⚠️ Potential issue | 🟠 Major | 🏗️ Heavy liftAdd Linux support to OS detection or the installer will fail on Linux systems.
The
case "$os"block handlesDarwinandMINGW*|MSYS*, but on Linux,uname -sreturns"Linux", which hits the catch-all and exits with "Unsupported OS: Linux". Add a Linux case:Linux) os_name="linux" ;;🤖 Prompt for 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. In `@scripts/install.sh` around lines 25 - 53, The OS detection case for "$os" fails to recognize Linux; update the case handling in the installer script to add a Linux branch by mapping "Linux" to os_name="linux" so uname -s values on Linux produce the correct os_name; modify the case that currently matches Darwin and MINGW*|MSYS* to include a Linux) os_name="linux" ;; entry (affecting variables os and os_name and the final artifact name echo "uloop-$os_name-$arch_name.tar.gz").
🤖 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 `@scripts/install.sh`:
- Around line 114-128: The ZIP extraction can leave files nested and install
expects $tmp_dir/uloop.exe; update extract_asset (referencing asset_name and
tmp_dir) to ensure binaries end up at tmp_dir root: either use unzip with
path-stripping (e.g., the -j/junk-paths option) or after unzip, search for
uloop.exe under $tmp_dir and move it to $tmp_dir/uloop.exe (cleaning any created
subdirs); also preserve the existing tar fallback behavior for non-zip assets.
---
Outside diff comments:
In `@scripts/install.sh`:
- Around line 25-53: The OS detection case for "$os" fails to recognize Linux;
update the case handling in the installer script to add a Linux branch by
mapping "Linux" to os_name="linux" so uname -s values on Linux produce the
correct os_name; modify the case that currently matches Darwin and MINGW*|MSYS*
to include a Linux) os_name="linux" ;; entry (affecting variables os and os_name
and the final artifact name echo "uloop-$os_name-$arch_name.tar.gz").
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: a0369e19-7be2-4730-a577-449e6b62c5f6
⛔ Files ignored due to path filters (6)
Packages/src/Cli~/Core~/dist/darwin-amd64/uloop-coreis excluded by!**/dist/**and included by nonePackages/src/Cli~/Core~/dist/darwin-arm64/uloop-coreis excluded by!**/dist/**and included by nonePackages/src/Cli~/Core~/dist/windows-amd64/uloop-core.exeis excluded by!**/dist/**,!**/*.exeand included by nonePackages/src/Cli~/Dispatcher~/dist/darwin-amd64/uloop-dispatcheris excluded by!**/dist/**and included by nonePackages/src/Cli~/Dispatcher~/dist/darwin-arm64/uloop-dispatcheris excluded by!**/dist/**and included by nonePackages/src/Cli~/Dispatcher~/dist/windows-amd64/uloop-dispatcher.exeis excluded by!**/dist/**,!**/*.exeand included by none
📒 Files selected for processing (9)
Packages/src/Cli~/Core~/internal/presentation/cli/completion.goPackages/src/Cli~/Core~/internal/presentation/cli/completion_test.goPackages/src/Cli~/Core~/internal/presentation/cli/help_test.goPackages/src/Cli~/Core~/internal/presentation/cli/run_help.goPackages/src/Cli~/Core~/internal/presentation/cli/tools.goPackages/src/Cli~/Dispatcher~/internal/dispatcher/completion_shell.goPackages/src/Cli~/Dispatcher~/internal/dispatcher/dispatcher_test.goPackages/src/Cli~/Dispatcher~/internal/dispatcher/help.goscripts/install.sh
Fail with a clear installer error when the Windows release archive does not contain the expected uloop.exe at the archive root, so Git Bash installs do not continue to a cryptic missing-path failure.
Summary
ulooplauncher from Git Bash/MSYS using the POSIX installer.User Impact
scripts/install.shfrom Git Bash failed withUnsupported OS: MINGW64_NT....uloop.exe, install completion into.bashrc, and use the documented completion helper commands from the same shell.Changes
scripts/install.shto resolve the publisheduloop-windows-amd64.zipasset, page through GitHub releases for matching assets, verify checksums, extract zip files, and smoke-testuloop.exebefore installation.uloop --list-commandsanduloop --list-options <command>helpers.Verification
GOROOT=/c/Users/booql/sdk/go1.26.1 PATH=/c/Users/booql/sdk/go1.26.1/bin:/c/Users/booql/go/bin:$PATH scripts/check-go-cli-source.shGOROOT=/c/Users/booql/sdk/go1.26.1 PATH=/c/Users/booql/sdk/go1.26.1/bin:/c/Users/booql/go/bin:$PATH scripts/check-go-cli.shULOOP_INSTALL_DIR=$(mktemp -d) sh scripts/install.shuloop completion --installwith a temporaryHOMEuloop --list-commandsanduloop --list-options compileGit Bash Support for uloop Installation and Completion on Windows
This PR enables Windows users running Git Bash/MSYS to install and complete uloop, resolving a previous limitation where the POSIX installer would fail with "Unsupported OS: MINGW64_NT...".
Key Changes
Shell Detection Enhancement
detectShellFromEnvironment()helper incompletion.goandcompletion_shell.gothat intelligently routes shell detection based on the platform and environment variablesSHELLandMSYSTEMenvironment variable is set (indicating Git Bash/MSYS); otherwise defaults to PowerShellSHELLdetectPosixShell()to no longer short-circuit to PowerShell on Windows, allowing proper POSIX shell detection when appropriateInstallation Script Refactoring (
scripts/install.sh)detect_installed_command_name()helper to derive the target command name (e.g.,uloop.exeon Windows) from the asset type (ZIP vs tarball)set_download_urls()that searches GitHub releases for the latest matching asset viafind_latest_asset_url(), replacing hardcoded "latest/download" URL patternsextract_asset()function to handle both ZIP archives (viaunzip) and tarballsreport_path_shadowing()to use the computed installed command name rather than hardcodinguloopHelp and Error Guidance Updates
run_help.goandhelp.goto documentuloop --list-commandsanduloop --list-options <command>as the primary methods for listing commands/optionsuloop completion --list-commandsanduloop completion --list-options <command>patternstools.goto direct users touloop --list-options <tool>Test Coverage
TestDetectShellOnWindowsGitBashUsesBash()to verify Git Bash environments are detected as bash shellsTestDetectShellOnWindowsPowerShellDefaultsToPowerShell()to ensure non-Git Bash Windows terminals still default to PowerShelldispatcher_test.goto pass the newmsystemparameterUser Impact
scripts/install.shto installuloop.exe.bashrcwhen running in Git Bash