Skip to content

M7: Local clone (Download Repository)#294

Draft
michaeljolley wants to merge 1 commit into
mjolley/m6-discussions-projectsfrom
mjolley/m7-local-clone
Draft

M7: Local clone (Download Repository)#294
michaeljolley wants to merge 1 commit into
mjolley/m6-discussions-projectsfrom
mjolley/m7-local-clone

Conversation

@michaeljolley

Copy link
Copy Markdown

Part of the RayCast parity roadmap. Stacked on top of #293 (M6).

What this adds

Clone a GitHub repository to the local machine, respecting a configurable clone location and git availability.

  • Git detection + clone: \IGitService\ / \GitService\ locate \git\ on the PATH and shell out to \git clone . Abstracted behind an interface so the clone flow is unit tested without a real git install or spawned process. MSIX sandbox constraints surface as clone failures turned into error toasts.
  • Configurable clone path: \ICloneSettingsStore\ / \CloneSettingsStore\ persist the clone base directory via \LocalSettings, defaulting to %USERPROFILE%\source\repos.
  • Clone orchestration: \IRepositoryCloneManager\ / \RepositoryCloneManager\ resolve the clone URL (owner/repo, GitHub URL, or clone URL) and destination directory, validate git availability, guard against a non-empty destination, and return the local clone path.
  • Top-level Clone Repository command: a \FormContent\ form with a repository field and an optional target directory (placeholder shows the default).
  • Per-item Clone action: a Clone Repository action on the Repositories search page items, cloning from the repo's clone URL.

Tests

  • URL / owner-repo resolution, git-missing guard, configured vs explicit target directory, default-directory resolution, and form JSON rendering.
  • 209/209 tests pass.

Notes

  • \RuntimeHelper.IsMSIX\ currently returns false; the default clone directory stays inside the user profile so it works in both packaged and unpackaged runs.
  • Repo/branch entry is text-input based, consistent with the other create/trigger forms.

Add the ability to clone a GitHub repository to the local machine, respecting a
configurable clone location and git availability.

- IGitService / GitService: locates git on the PATH and shells out to
  'git clone <url> <destination>'. Git availability and process launch are
  abstracted behind the interface so the clone flow is unit tested without a real
  git install or spawned process. MSIX sandbox constraints surface as clone
  failures turned into error toasts.
- ICloneSettingsStore / CloneSettingsStore: persists the clone base directory via
  LocalSettings; defaults to %USERPROFILE%\\source\\repos.
- IRepositoryCloneManager / RepositoryCloneManager: resolves the clone URL
  (owner/repo, GitHub URL, or clone URL) and destination directory, validates git
  availability, guards against a non-empty destination, and returns the local
  clone path.
- CloneRepositoryForm + template: top-level Clone Repository command with a
  repository field and optional target directory (placeholder shows the default).
- CloneRepositoryCommand: per-item Clone Repository action on the Repositories
  search page, cloning from the repo's clone URL into the configured directory.
- Composition-root wiring, ResW strings, and tests: URL/owner-repo resolution,
  git-missing guard, configured vs explicit target directory, default-directory
  resolution, and form JSON rendering. 209/209 tests pass.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant