Disable SSH askpass for upstream status fetches#1921
Disable SSH askpass for upstream status fetches#1921merrkry wants to merge 1 commit intopingdotgg:mainfrom
Conversation
📝 WalkthroughWalkthroughThe changes extend git command execution infrastructure to support custom environment variables. An optional Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c1be4c9920
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
ApprovabilityVerdict: Needs human review This PR changes runtime behavior by disabling SSH askpass during background git fetch operations. While the change is small and includes tests, it modifies how the application interacts with SSH for all users, and the author is a first-time contributor to this file. A maintainer should verify the SSH behavior change is appropriate. You can customize Macroscope's approvability policy. Learn more. |
c1be4c9 to
d80b4f5
Compare
d80b4f5 to
eb500ad
Compare
- Extended `ExecuteGitOptions` with `env` field - Pass `SSH_ASKPASS_REQUIRE=never` to upstream status fetch to prevent annoying popups that cannot be usefully responded
eb500ad to
ae8379b
Compare
|
According to review comments, |
|
@coderabbitai review |
|
✅ Actions performedReview triggered.
|
|
✅ Actions performedReview triggered.
|
|
Codex Review: Didn't find any major issues. You're on a roll. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
What Changed
ExecuteGitOptionswithenvfieldSSH_ASKPASS_REQUIRE=neverto upstream status fetch to prevent annoying popups that cannot be usefully respondedWhy
GitCore.fetchUpstreamRefForStatusperiodically runsgit fetch. When Git interacts with an SSH remote that requires a passphrase to unlock the SSH key, an ssh-askpass window pops up each time this is invoked if the key is not available in the SSH agent. With a timeout of 5 seconds, it is difficult to react and type the passphrase.This change has minimal UX impact because users currently have to add the key manually nonetheless due to the timeout.
This should work around #356 and #1190.
Some possible remaining work:
Checklist
[ ] I included before/after screenshots for any UI changesNot applicable[ ] I included a video for animation/interaction changesNot applicableNote
Low Risk
Low risk: only the background
GitCore.fetchUpstreamRefForStatusgit fetchgets an extra environment override to suppress SSH credential prompting, plus test adjustments to assert the new behavior.Overview
Upstream status refresh
git fetchcalls now run withSSH_ASKPASS_REQUIRE=neverto prevent SSH askpass prompts during the periodic behind/ahead refresh.This introduces an optional
envfield onExecuteGitOptionsand forwards it throughexecuteGit, and updates the relevant checkout/status test to assert the fetch environment.Reviewed by Cursor Bugbot for commit ae8379b. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Set
SSH_ASKPASS_REQUIRE=neveron upstream status fetches inGitCoreenvfield to theExecuteGitOptionsinterface in GitCore.ts, forwarded to the underlyingexecutecall.{ SSH_ASKPASS_REQUIRE: 'never' }when callingfetchUpstreamRefForStatus, preventing SSH from prompting for credentials during background status fetches.git fetchcalls now run with a modified environment; otherexecuteGitcallers are unaffected unless they passenvexplicitly.Macroscope summarized ae8379b.