Skip to content

Disable interactive git credential prompts on fetch operations - #16

Merged
bschellenberger2600 merged 2 commits into
mainfrom
fix/non-interactive-git-network
Jun 16, 2026
Merged

Disable interactive git credential prompts on fetch operations#16
bschellenberger2600 merged 2 commits into
mainfrom
fix/non-interactive-git-network

Conversation

@bschellenberger2600

@bschellenberger2600 bschellenberger2600 commented Jun 16, 2026

Copy link
Copy Markdown
Member

Summary

  • Pin github.com/git-fire/git-harness v0.3.1 and delegate PrepareNetworkGit to harness (no duplicated helper)
  • Apply non-interactive fetch behavior on default fetch --all, mainline fetch, and full sync paths
  • Migrate .goreleaser.stable.yaml from deprecated brewshomebrew_casks (fixes failing release config validation)

Why

Parallel git-rain workers 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.mod pins github.com/git-fire/git-harness v0.3.1
  • CI green (including Validate GoReleaser Configs)

Note

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.PrepareNetworkGit delegates to git-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 in fetchOnly (cmd), MainlineFetchRemotes, and the initial fetch inside RainRepository.

Tests: Coverage for fetchFailureReason when git reports terminal prompts disabled, an HTTPS integration test that fetch fails without prompting, and a cmd test case for the default-fetch error message path.

Release: Stable GoReleaser config moves from brews to homebrew_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.

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>
@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@bschellenberger2600, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0449b1d9-1b70-4e3e-b22a-6d37651da88c

📥 Commits

Reviewing files that changed from the base of the PR and between 3b65f5e and 3983ecb.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (8)
  • .goreleaser.stable.yaml
  • cmd/root.go
  • cmd/root_test.go
  • go.mod
  • internal/git/command.go
  • internal/git/command_test.go
  • internal/git/fetch_mainline.go
  • internal/git/rain.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/non-interactive-git-network

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver

bschellenberger2600 added a commit to git-fire/git-harness that referenced this pull request Jun 16, 2026
## 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>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

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.

Comment thread .goreleaser.stable.yaml
install: |
if OS.mac?
system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/git-rain"]
end

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3983ecb. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver

@bschellenberger2600
bschellenberger2600 merged commit 2fa5c83 into main Jun 16, 2026
13 checks passed
@bschellenberger2600
bschellenberger2600 deleted the fix/non-interactive-git-network branch June 16, 2026 03:56
bschellenberger2600 added a commit to git-fire/git-fire that referenced this pull request Jun 17, 2026
## 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant