fix(git): check write/root capability before installing git-lfs - #831
Conversation
isLocalAgent gates auto-install on "is this a local-docker provider" vs "is this a remote/SSH provider" (#828), but that's not the same as "does devsy have install rights here." A remote SSH machine provider running as an unprivileged user is non-local yet still gets a permission-denied apt/github-release install attempt on every clone, identical to the noise the original fix was meant to remove. pkgManagerStrategy.usable() now also requires root (apt/dpkg need it regardless of host type), and the release strategy checks the install directory is actually writable before downloading anything, so a guaranteed-to-fail install is never attempted rather than attempted and then failing loudly.
✅ Deploy Preview for images-devsy-sh canceled.
|
|
Warning Review limit reached
Next review available in: 49 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe installer now requires root privileges for package-manager strategies. It also validates that the installation directory exists or can be created and written before downloading the executable. Tests cover privilege and directory-validation behavior. ChangesInstaller validation
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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 |
✅ Deploy Preview for devsydev canceled.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@pkg/git/installer_release.go`:
- Around line 219-221: Update the probe cleanup flow around probe.Close so its
error is captured and returned after attempting os.Remove(name). Preserve
best-effort removal, but ensure a non-nil close error takes precedence over a
successful removal result, preventing the writability check from reporting
success.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 51db9bdd-8786-4e5d-95b6-a057c7b120d7
📒 Files selected for processing (3)
pkg/git/installer.gopkg/git/installer_release.gopkg/git/installer_test.go
A failed close (e.g. deferred write errors on some filesystems) was silently discarded, letting a doomed writability check report success.
Summary
Summary by CodeRabbit