fix: add timeout and disable terminal prompts for remote git commands#1078
Conversation
Prevents indefinite hangs when accessing inaccessible repositories. Fixes yamadashy#1077
Summary of ChangesHello @Pipboyguy, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses potential indefinite hangs during remote Git operations by implementing a 30-second timeout and disabling interactive terminal prompts for credentials. These changes enhance the robustness of Git interactions, allowing the system to fail quickly and gracefully when encountering inaccessible, non-existent, or authentication-requiring repositories, thereby improving overall system reliability and responsiveness. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 📝 WalkthroughWalkthroughThis change adds timeout enforcement and terminal prompt suppression to Git remote operations in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ 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.
Code Review
This pull request correctly adds timeouts and disables terminal prompts for remote git commands to prevent hangs, which is a great improvement. However, the changes will break existing unit tests in tests/core/git/gitCommand.test.ts because the mocks for execFileAsync are no longer correct. This is a critical issue that needs to be addressed. Please update the tests to reflect the new arguments passed to execFileAsync and consider adding assertions for the new timeout and environment variables. I have also included some minor suggestions to improve code consistency by centralizing the remote command options.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
- Use gitRemoteOpts constant consistently across all remote git operations - Update tests to expect the third argument (options with timeout and env)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1078 +/- ##
=======================================
Coverage 87.15% 87.16%
=======================================
Files 116 116
Lines 4376 4379 +3
Branches 1019 1019
=======================================
+ Hits 3814 3817 +3
Misses 562 562 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Hi @Pipboyguy! Thanks for the PR! The fix looks good and the code is solid. Merging this now. Thanks for the contribution! 🙏 |
Add release notes for v1.11.1 covering: - Multi-root directory labels (#1024) - Non-interactive skill generation options (#1022) - Remote git command timeout fix (#1078) - CLI output visibility fix for light themes (#1088) - Library bundling documentation (#1075) Improve release note generation guidelines: - Clarify "What's New" vs "Improvements" usage - Add rule to include related issue numbers with PRs - Add rule to include links in documentation sections
Prevents indefinite hangs when accessing inaccessible repositories (non-existent, private, or requiring auth).
Changes:
GIT_TERMINAL_PROMPT=0to fail fast instead of waiting for credentialsFixes #1077