feat(stack): bootstrap empty remotes + actionable unreachable-repo UX#1364
Open
TerrifiedBug wants to merge 2 commits intomoghtech:mainfrom
Open
feat(stack): bootstrap empty remotes + actionable unreachable-repo UX#1364TerrifiedBug wants to merge 2 commits intomoghtech:mainfrom
TerrifiedBug wants to merge 2 commits intomoghtech:mainfrom
Conversation
…e repo
Probe the remote with `git ls-remote` before pull/clone in the Stack
git-mode flows so the Initialize File action can:
* Bootstrap an empty remote (no refs) by skipping pull and pushing the
first commit on the configured branch via `push --set-upstream`.
* Bootstrap a branch that doesn't exist yet on a populated remote,
listing available branches in the log.
* Surface an actionable multi-line error when the repo is unreachable
(doesn't exist, auth failure, token expired) instead of raw git
output.
Also hide the Initialize File button on synthetic "Failed at: ..." error
rows so users don't accidentally write files to stage-name paths.
Changes:
* lib/git/src/ls_remote.rs: new `check_remote_state` probe and
`RemoteState` enum. Token-scrubbed on failure.
* bin/core/src/stack/remote.rs: `ensure_remote_repo` branches on state.
* bin/core/src/api/write/stack.rs: `write_stack_file_contents_git`
rejects Unreachable early and skips pull for Empty/BranchMissing.
* ui/src/resources/stack/info.tsx: hide button on synthetic paths.
Sync has an identical pattern that was intentionally not changed in this
commit since empty sync repos are a degenerate case in practice.
Condense verbose multi-bullet verification checklist into concise actionable message. Preserves git stderr (trimmed) as diagnostic while replacing procedural steps with direct guidance.
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.
Summary
Closes the gap where Komodo can't scaffold the first file into an empty or
branch-less git repo from the Stack Info → Initialize File flow. Adds a
cheap
git ls-remoteprobe that classifies remote state into four cases androutes each to the right action.
Behavior changes
git pullfails with noisy errorgit inited on the configured branch; Initialize File creates the first commit and pushesgit pullfailsFiles
lib/git/src/ls_remote.rs(new) —RemoteStateenum +check_remote_stateprobelib/git/src/lib.rs— export new modulebin/core/src/stack/remote.rs— probe first, then branch on state;bootstrap_local_clonehelperbin/core/src/api/write/stack.rs— same state-based branching in the write-file-contents pathui/src/resources/stack/info.tsx— hide Initialize File button onFailed at: …synthetic error pathsTest plan
compose.yamlon the first commit