Disable interactive git credential prompts on fetch operations - #16
Conversation
Apply GIT_TERMINAL_PROMPT=0 to all network fetch paths so parallel git-rain runs fail fast with a frozen auth message instead of interleaved TTY prompts. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Warning Review limit reached
More reviews will be available in 37 minutes and 46 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (8)
✨ 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.
Stale comment
Not approving: the Cursor Bugbot check completed successfully, but the expected Cursor Bugbot review comment is missing from this PR. Human review is needed before merge; no reviewers were assigned because the only repo collaborator is the PR author.
Sent by Cursor Approval Agent: Pull Request Approver
## Summary - Add `PrepareNetworkGit` to set `GIT_TERMINAL_PROMPT=0` on fetch/push subprocesses - Apply to `FetchRemote`, `DetectConflict`, `PushBranch`, and `PushAllBranches` - Add unit and HTTPS integration tests asserting fast non-interactive auth failure ## Why Batch CLIs (`git-fire`, `git-rain`) run parallel network git operations. When HTTPS remotes lack cached credentials, git prompts on the controlling TTY — bypassing captured stdout/stderr and interleaving `Username for 'https://github.com':` with structured output. ## Related PRs - git-rain: git-fire/git-rain#16 - git-fire: git-fire/git-fire#107 **Merge order:** this PR first → tag harness release → update git-fire #107 `go.mod` pin → merge siblings. ## Test plan - [x] `go test -race -count=1 ./git/ -run 'TestNonInteractive|TestPrepareNetwork|TestFetchRemote_Unauthenticated' -v` - [ ] CI green Co-authored-by: Cursor <cursoragent@cursor.com>
…aser CI. Delegate PrepareNetworkGit to git-harness instead of duplicating the helper, pin github.com/git-fire/git-harness v0.3.1, and migrate stable releases from deprecated brews to homebrew_casks so release config validation passes. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Homebrew gate expects Formula
- Updated the release workflow to poll Casks/git-rain.rb (matching homebrew_casks) instead of Formula/git-rain.rb.
You can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit 3983ecb. Configure here.
| install: | | ||
| if OS.mac? | ||
| system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/git-rain"] | ||
| end |
There was a problem hiding this comment.
Homebrew gate expects Formula
High Severity
Stable release config now publishes homebrew_casks (Cask under Casks/) instead of brews (Formula/git-rain.rb), but the release workflow still waits for Formula/git-rain.rb to update. GoReleaser can succeed while the Homebrew verify step times out and fails the release.
Reviewed by Cursor Bugbot for commit 3983ecb. Configure here.
There was a problem hiding this comment.
Not approving: Cursor Bugbot reported one unresolved high-severity finding (Homebrew Formula vs Cask gate mismatch in .goreleaser.stable.yaml) and the Bugbot check finished in a skipped state. Human review is needed before merge; no reviewers were assigned because the only repo collaborator is the PR author.
Sent by Cursor Approval Agent: Pull Request Approver
## Summary - Bump `git-harness` to **v0.3.1** (released; sets `GIT_TERMINAL_PROMPT=0` on fetch/push) - Add executor integration tests for push-known and conflict-detection fetch paths ## Why `git-fire` delegates network git to `git-harness`. Without `GIT_TERMINAL_PROMPT=0`, parallel pushes/fetches can prompt for HTTPS credentials on the TTY when auth is missing. ## Related PRs - git-harness (merged, v0.3.1): git-fire/git-harness#9 - git-rain (sibling): git-fire/git-rain#16 ## Test plan - [x] `go test -race -count=1 ./internal/executor/ -run 'TestSummarizePushKnownRemote_Unauthenticated|TestDetectConflict_Unauthenticated' -v` - [x] `go.mod` pinned to `github.com/git-fire/git-harness v0.3.1` - [ ] CI green (GoReleaser config validation failure is pre-existing/unrelated) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Dependency bump and test-only executor coverage; release changes affect install path (cask) but not runtime app logic. > > **Overview** > **Pins `git-harness` to v0.3.1** so fetch/push run with `GIT_TERMINAL_PROMPT=0`, avoiding HTTPS credential prompts during parallel emergency backups when auth is missing. > > **Adds executor regression tests** (`network_git_test.go`) that hit real HTTPS remotes without credentials and assert `summarizePushKnownRemote` and `git.DetectConflict` fail quickly (within 15s), not hang on a TTY prompt. > > **Switches macOS distribution from a Homebrew formula to a cask** in `.goreleaser.stable.yaml` (binary + post-install `xattr` quarantine strip on macOS). The release workflow gate now polls `homebrew-tap`’s **cask** (`Casks/git-fire.rb`) instead of `Formula/git-fire.rb`. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 08901fa. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Ben Schellenberger <bschellenberger2600@users.noreply.github.com>




Summary
github.com/git-fire/git-harness v0.3.1and delegatePrepareNetworkGitto harness (no duplicated helper)fetch --all, mainline fetch, and full sync paths.goreleaser.stable.yamlfrom deprecatedbrews→homebrew_casks(fixes failing release config validation)Why
Parallel
git-rainworkers were leaking interactive HTTPS credential prompts when remotes lacked cached credentials. The fix belongs in git-harness (shared with git-fire); git-rain now consumes it instead of maintaining a forked copy.Related PRs
Test plan
go test -race -count=1 ./...go.modpinsgithub.com/git-fire/git-harness v0.3.1Note
Medium Risk
Changes how every parallel fetch handles missing credentials (fail fast instead of prompting), which is intentional but affects all remote fetch paths; release packaging also switches to homebrew_casks.
Overview
Parallel fetches were able to trigger interactive HTTPS username/password prompts, which mixed badly with scan and multi-repo progress output. This PR wires non-interactive network git through all remote fetch entry points.
Runtime behavior: New
internal/git.PrepareNetworkGitdelegates togit-harness(v0.3.1) so fetch/push-style commands get the same env as git-fire (e.g.GIT_TERMINAL_PROMPT=0). It is applied infetchOnly(cmd),MainlineFetchRemotes, and the initial fetch insideRainRepository.Tests: Coverage for
fetchFailureReasonwhen git reports terminal prompts disabled, an HTTPS integration test that fetch fails without prompting, and acmdtest case for the default-fetch error message path.Release: Stable GoReleaser config moves from
brewstohomebrew_casks, with a post-install hook to strip macOS quarantine on the binary.Reviewed by Cursor Bugbot for commit 3983ecb. Bugbot is set up for automated code reviews on this repo. Configure here.