fix: use remote with .git suffix as main clone url - #4301
Conversation
…t suffix Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
|
|
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ccc6661. Configure here.
| self.logger.warning( | ||
| f"Clone with .git suffix failed, falling back to bare URL: {remote}" | ||
| ) | ||
| await run_shell_command([*base_cmd, remote, "."], cwd=path) |
There was a problem hiding this comment.
Retryable errors trigger URL fallback
Medium Severity
The .git-suffix clone path uses a bare except Exception, so transient failures such as RateLimitError, NetworkError, and RemoteServerError from run_shell_command trigger an immediate bare-URL clone instead of propagating for @retry_on_clone_error. That bypasses exponential backoff on the primary URL and can add an extra clone during rate limits or outages.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit ccc6661. Configure here.
There was a problem hiding this comment.
Pull request overview
This PR updates the git-integration clone flow to be more tolerant of remotes that may or may not require a .git suffix, and reduces the number of retry attempts for certain clone failures.
Changes:
- Reduced tenacity retry attempts for retryable clone errors from 6 to 3.
- Added “try
{remote}.gitfirst, then fall back to{remote}” logic for both minimal and full clones.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| except Exception: | ||
| self.logger.warning( | ||
| f"Clone with .git suffix failed, falling back to bare URL: {remote}" | ||
| ) | ||
| await run_shell_command([*base_cmd, remote, "."], cwd=path) |
| except Exception: | ||
| self.logger.warning( | ||
| f"Clone with .git suffix failed, falling back to bare URL: {remote}" | ||
| ) | ||
| await run_shell_command([*base_cmd, remote, "."], cwd=repo_path) |
| base_cmd = ["git", "clone", "--depth=1", "--no-tags", "--single-branch"] | ||
| try: | ||
| await run_shell_command([*base_cmd, f"{remote}.git", "."], cwd=path) |
Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
Signed-off-by: Mouad BANI <mouad-mb@outlook.com> Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>


This pull request improves the robustness of the git cloning process in
clone_service.pyby introducing fallback logic for repository URLs and adjusting retry behavior. The most important changes are:Cloning Robustness Improvements:
_perform_minimal_cloneand_perform_full_clonenow attempt to clone using the.gitsuffix on the remote URL first, and if that fails, they log a warning and retry with the original URL. This helps handle repositories that may or may not require the.gitsuffix. [1] [2]Retry Behavior Adjustment:
Note
Medium Risk
Changes core onboarding clone paths and broad
except Exceptionfallback could hide non-URL failures; fewer retries may increase clone failures under flaky networks.Overview
Clone URL handling in
_perform_minimal_cloneand_perform_full_clonenow triesgit cloneagainst{remote}.gitfirst, then on any failure logs a warning and retries with the stored bareremote(callers already normalize viaremovesuffix(".git")).Retry policy for
@retry_on_clone_error(minimal/full clone and batch deepen) drops max attempts from 6 → 3, so transient rate-limit/network errors fail faster.Reviewed by Cursor Bugbot for commit 4ee591d. Bugbot is set up for automated code reviews on this repo. Configure here.