fix(source-control): explain clone failures #5005
ClosedKyleKincer(GitHub profile, opens in a new tab)wants to merge 3 commits into
main fromrefs/pull/5005/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
- apps/server/src/sourceControl/SourceControlRepositoryService.ts line 43OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -21,6 +23,21 @@21232224 import { ServerConfig } from "../config.ts";2325 import * as GitVcsDriver from "../vcs/GitVcsDriver.ts";2426 import * as SourceControlProviderRegistry from "./SourceControlProviderRegistry.ts";2527 const isSourceControlRepositoryError = Schema.is(SourceControlRepositoryError);262829+function cloneFailureDetail(stderr: string, remoteUrl: string): string {30+ if (/host key verification failed/iu.test(stderr)) {31+ return "SSH could not verify the source control host. Add its host key to known_hosts and try again.";32+ }33+ if (/permission denied \(publickey(?:,[^)]+)?\)/iu.test(stderr)) {34+ return "SSH authentication failed. Add an SSH key to your source control account and try again.";35+ }36+ if (37+ /authentication failed|http basic: access denied|could not read username|terminal prompts disabled/iu.test(38+ stderr,39+ )40+ ) {41+ return "HTTPS authentication failed. Configure Git credentials for the source control host and try again.";42+ }43+ if (/repository not found|could not read from remote repository/iu.test(stderr)) {
- apps/server/src/sourceControl/SourceControlRepositoryService.ts line 53OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -26,0 +33,21 @@33+ if (/permission denied \(publickey(?:,[^)]+)?\)/iu.test(stderr)) {34+ return "SSH authentication failed. Add an SSH key to your source control account and try again.";35+ }36+ if (37+ /authentication failed|http basic: access denied|could not read username|terminal prompts disabled/iu.test(38+ stderr,39+ )40+ ) {41+ return "HTTPS authentication failed. Configure Git credentials for the source control host and try again.";42+ }43+ if (/could not resolve (?:host|hostname)/iu.test(stderr)) {44+ return "The source control host could not be resolved. Check your network or VPN connection and try again.";45+ }46+ if (/connection (?:timed out|refused)|failed to connect/iu.test(stderr)) {47+ return "Git could not connect to the source control host. Check your network or VPN connection and try again.";48+ }49+ if (/repository not found|could not read from remote repository/iu.test(stderr)) {50+ return "The repository could not be read. Check that it exists and that your Git credentials have access.";51+ }52+53+ const transport = /^(?:ssh:\/\/|[^@/\s]+@[^:/\s]+:)/u.test(remoteUrl) ? "SSH" : "HTTPS";
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
shivamhwp(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
5d9cfd5b-81ae-4f02-8f0a-2aa1f61b4706You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
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