fix: upgrade openshell when installed version is below minimum#658
fix: upgrade openshell when installed version is below minimum#658
Conversation
The install script previously exited immediately if openshell was already installed, regardless of version. Users on 0.0.6 would stay on 0.0.6 and hit cgroup v2 failures fixed in 0.0.7 (OpenShell#329). Now checks the installed version against a minimum (0.0.7) and upgrades automatically if too old. Closes #136
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe install script now enforces a minimum openshell version (0.0.7). It parses the installed version and only skips installation when the installed version is >= MIN_VERSION; otherwise it warns and continues with install/upgrade. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@scripts/install-openshell.sh`:
- Around line 36-39: The current version_gte() function uses sort -V which is
not portable on macOS; replace it with a bash-native comparator: implement
version_gte to split the two version strings (in function version_gte) on dots
into arrays and compare each numeric segment in order (pad shorter version with
zeros), returning true when first segment of $1 > $2 or when all segments are
equal; ensure it handles non-numeric suffixes robustly (treat missing segments
as 0) and is POSIX-safe for use where version_gte() is invoked during the
upgrade/cgroup fix.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 5479a77f-8ec4-403a-bf73-3402c7cf1577
📒 Files selected for processing (1)
scripts/install-openshell.sh
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@scripts/install-openshell.sh`:
- Line 49: The current INSTALLED_VERSION assignment can return multiple
semantic-version tokens because grep -oE may emit more than one match; update
the extraction so it deterministically picks a single semantic-version (the
first match). Locate the INSTALLED_VERSION line that runs openshell --version
and change the grep usage to stop after the first match (e.g., add grep -m1 -oE
... or otherwise pipe to head -n1) so INSTALLED_VERSION always contains exactly
one x.y.z value; keep the fallback to '0.0.0' if no match is found.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 78cf97d4-db61-43c2-8f71-ed5e64b9d768
📒 Files selected for processing (1)
scripts/install-openshell.sh
…A#658) * fix: upgrade openshell when installed version is below minimum The install script previously exited immediately if openshell was already installed, regardless of version. Users on 0.0.6 would stay on 0.0.6 and hit cgroup v2 failures fixed in 0.0.7 (OpenShell#329). Now checks the installed version against a minimum (0.0.7) and upgrades automatically if too old. Closes NVIDIA#136 * fix: use portable version comparison (no sort -V for BSD compat) * fix: use head -1 to extract single version from openshell output
…A#658) * fix: upgrade openshell when installed version is below minimum The install script previously exited immediately if openshell was already installed, regardless of version. Users on 0.0.6 would stay on 0.0.6 and hit cgroup v2 failures fixed in 0.0.7 (OpenShell#329). Now checks the installed version against a minimum (0.0.7) and upgrades automatically if too old. Closes NVIDIA#136 * fix: use portable version comparison (no sort -V for BSD compat) * fix: use head -1 to extract single version from openshell output
…A#658) * fix: upgrade openshell when installed version is below minimum The install script previously exited immediately if openshell was already installed, regardless of version. Users on 0.0.6 would stay on 0.0.6 and hit cgroup v2 failures fixed in 0.0.7 (OpenShell#329). Now checks the installed version against a minimum (0.0.7) and upgrades automatically if too old. Closes NVIDIA#136 * fix: use portable version comparison (no sort -V for BSD compat) * fix: use head -1 to extract single version from openshell output
Summary
The install script previously skipped openshell installation if any version was already present. Users on 0.0.6 would never get upgraded and hit the cgroup v2 gateway crash fixed in 0.0.7 (NVIDIA/OpenShell#329).
Now checks the installed version against a minimum (0.0.7) and upgrades automatically if too old.
Changes
scripts/install-openshell.sh— replace the earlyexit 0with a version check usingsort -V. If installed version is below 0.0.7, proceeds with the download/install flow instead of exiting.Closes #136
Test plan
npm test— all tests passSummary by CodeRabbit