-
Notifications
You must be signed in to change notification settings - Fork 5
Add error handling for runInit in container entrypoint #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -83,6 +83,15 @@ const cloneRepository = async ( | |
| return; | ||
| } | ||
|
|
||
| const repoName = repoUrl.replace(/\/+$/, "").split("/").pop() ?? "repo"; | ||
| const cleanRepoName = repoName.replace(/\.git$/, ""); | ||
| const repoPath = path.join(workspaceHome, cleanRepoName); | ||
| if (await pathExists(repoPath)) { | ||
| console.log(`Repository directory '${cleanRepoName}' already exists. Skipping clone.`); | ||
| await configureGitSshKey(workspaceHome, repoPath, runtimeConfig?.ssh?.selectedKey ?? ""); | ||
| return; | ||
| } | ||
|
Comment on lines
+86
to
+93
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: A new check for an existing repository directory causes an infinite initialization loop if a post-clone step fails, preventing the workspace from ever successfully starting up. 🔍 Detailed AnalysisA new check for an existing repository directory can lead to an infinite initialization loop. If a post-clone step, such as 💡 Suggested FixThe logic should be adjusted to handle this semi-initialized state. Instead of returning early if the repository directory exists, consider either deleting the directory to allow a fresh clone or making the subsequent initialization steps more robust to this condition. The previous behavior, which would fail on the 🤖 Prompt for AI AgentDid we get this right? 👍 / 👎 to inform future reviews. |
||
|
|
||
| console.log("=== Configuration Debug Info ==="); | ||
| console.log(`Repository URL: ${repoUrl}`); | ||
| await logRuntimeConfigContents(runtimeConfigPath); | ||
|
|
@@ -143,9 +152,6 @@ const cloneRepository = async ( | |
| } | ||
| console.log("Repository clone completed."); | ||
|
|
||
| const repoName = repoUrl.replace(/\/+$/, "").split("/").pop() ?? "repo"; | ||
| const cleanRepoName = repoName.replace(/\.git$/, ""); | ||
| const repoPath = path.join(workspaceHome, cleanRepoName); | ||
| if (await pathExists(repoPath)) { | ||
| await configureGitSshKey(workspaceHome, repoPath, selectedKey); | ||
| } | ||
|
|
||
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.