cli: preflight git check and network retries in openui create - #1223
Merged
Merged
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
|
CI checks are failing, take a pull |
…create-preflight-retry
Contributor
Author
|
Merged |
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
AbhinRustagi
enabled auto-merge (squash)
September 23, 2026 10:36
AbhinRustagi
approved these changes
Sep 23, 2026
AbhinRustagi
deleted the
devin/1790073688-cli-create-preflight-retry
branch
September 23, 2026 10:36
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
openui createcould fail in ways that were avoidable or poorly explained:git initwas spawned, and printed a generic "git is not installed or not found in PATH."CreateErrorthrown while resolving the template source was labelled as a networkTEMPLATE_MISSINGfailure, even when it was a filesystem error.This PR fails fast with an actionable message when git is missing, retries network-class failures with exponential backoff, and makes retries visible in telemetry. The existing
failure_stage/error_codetaxonomy is unchanged (no new codes).Changes
lib/git-preflight.ts:ensureGitAvailable()spawnsgit --versionat the start ofrunCreateApp(skipped inOPENUI_SOURCE_DIRdebug mode). On ENOENT it throwsCreateError("preflight", …, "process", "GIT_MISSING")with a per-OS hint (winget/choco/git-scm link on Windows, brew/xcode-select on macOS, apt/dnf on Linux). The same message is reused byrunGit's ENOENT branch.lib/retry.ts:"<label> failed (<code>); retrying in Ns (attempt i/3)...". On final failure it stampserrorMetadata.attemptson theCreateError, socli_create_failed/cli_dependency_install_failednow carry anattemptsproperty.checkoutSource(fresh temp dir per attempt), the raw.githubusercontent catalog fetch infetchSourceFile, and the dependency install ininstallProjectDependencies. Onlynetwork-class errors retry;GIT_MISSING(process),PERMISSION_DENIED/SOURCE_MISSING(filesystem) and cancellations do not. The 404SOURCE_MISSINGfromfetchSourceFileis now classifiedfilesystem(matchingcheckoutSource) so a bad path isn't retried.cli_network_retryevent (failure_stage,attempt,max_attempts,delay_ms,error_class,error_code), emitted byTelemetry.reportNetworkRetry(stage)on the base class inlib/telemetry.ts; callers passtel.reportNetworkRetry("source_checkout" | "dependency_install")asonRetry, threaded throughloadCreateCatalog→ catalog loaders,resolveTemplateSource, andscaffoldExample.throwTemplateSourceError()classifies non-CreateErrorfailures viacliErrorProperties, so errno errors become filesystem/PERMISSION_DENIEDetc.; the true network fallback now saysCould not download template "<name>" from GitHub: … Check your network connection and try again.(Unknown template names were already rejected earlier asINVALID_TEMPLATE.)runGit/fetchSourceFilenow include a "check your network connection" hint.Test Plan
pnpm --filter @openuidev/cli lint:check,format:check,buildpassOPENUI_DEBUG=1 OPENUI_SOURCE_DIR=… node dist/index.js create --helpstill worksGIT_MISSINGwith Windows hint) and template-source error classification were exercised with ad-hoc unit tests during development (not committed)Checklist
attemptsandcli_network_retryare additive telemetry)Link to Devin session: https://app.devin.ai/sessions/a4b6312c6116461a8911fb7e6995da11
Open in Devin Desktop: https://app.devin.ai/desktop/session/a4b6312c6116461a8911fb7e6995da11?variant=devin
Requested by: @zahlekhan