Files
headquarter/openspec/changes/archive/2026-05-22-git-repo-ssh-clone-check/design.md
T
Fusion 063a839790 feat: implement repository clone mode with SSH key support
- Add clone_mode and branch fields to tool_instances
- Add ssh_key_id to git_repositories for per-repo SSH key assignment
- Implement host-side git cloning with branch selection (default: main)
- Mount SSH keys into containers for git operations in clone mode
- Add dirty state check on clone-mode instance deletion with confirmation
- Update SessionsPage with mount/clone selector, branch input, SSH key display
- Add SSH key selector to repository creation form
- Add dirty delete confirmation modal with changed files list
- Update API schemas and endpoints for new fields
- Sync delta specs to main specs (git-repo, tool-instances, repo-clone-mode)
- Archive completed OpenSpec change: repo-clone-mode-with-ssh
- Document git requirement for custom tool types

Quality gates: Frontend typecheck and build passed
OpenSpec: repo-clone-mode-with-ssh archived with all tasks complete
2026-05-22 22:56:35 +02:00

46 lines
2.1 KiB
Markdown

## Context
The current repository creation flow already supports cloning remote repositories via `remote_url` and can normalize pasted browser URLs. However, the UI asks for a full URL, which is awkward for the fixed provider `git.commumedia.org`. The requested behavior is to enter `owner` and `repo`, check whether the repository exists, and clone only if it does.
## Goals / Non-Goals
**Goals:**
- Accept SSH-only `owner` and `repo` inputs for cloning from `git.commumedia.org`
- Verify repository existence before clone
- Preserve full URL paste as a fallback path
- Preserve blank repository creation
- Reuse the existing repository create endpoint and shared dialog
**Non-Goals:**
- Supporting multiple git providers
- Adding a remote repository discovery API
- Supporting HTTPS clone flow for the new structured path
- Changing repository storage or clone behavior beyond preflight validation
## Decisions
**1. Provider assumption**
- Hardcode `git.commumedia.org` for the structured clone path
- Build SSH URLs as `git@git.commumedia.org:{owner}/{repo}.git`
**2. Existence check**
- Use `git ls-remote` on the constructed SSH URL before cloning
- If the command fails, surface a repository-not-found/inaccessible error and do not clone
**3. UI structure**
- Keep the shared repository creation dialog as the single entry point
- In clone mode, collect `owner` and `repo` instead of asking for a full URL
- Keep an advanced paste-URL fallback for existing behavior and browser URL parsing
- Keep blank repository creation available in the same dialog
**4. Backend behavior**
- Reuse `POST /projects/{project_id}/repositories`
- Add preflight logic before the existing `git clone --mirror`
- Leave the database schema unchanged
## Risks / Trade-offs
**[Risk] SSH auth may still fail even if the repo exists** → Mitigation: preflight error should be explicit and user-facing.
**[Risk] Command availability** → Mitigation: reuse the same `git` dependency already required for cloning.
**[Risk] UI complexity** → Mitigation: keep the dialog shared and minimal, with fallback URL paste.