Skip to content

feat: support local-only repositories (closes #71)#73

Merged
8bitAlex merged 2 commits into
mainfrom
feat/issue-71-local-only-repos
May 10, 2026
Merged

feat: support local-only repositories (closes #71)#73
8bitAlex merged 2 commits into
mainfrom
feat/issue-71-local-only-repos

Conversation

@8bitAlex
Copy link
Copy Markdown
Owner

Summary

Resolves #71Support local development without a repo or remote.

url is now optional on profile repository entries. When omitted, raid treats the entry as local-only:

  • skips cloning entirely (so raid install no longer fatal-errors trying to git clone "" against a remote that doesn't exist)
  • runs install tasks against the existing path as-is
  • requires the path to already exist on disk; if it doesn't, returns a clear error pointing at the path
  • raid doctor no longer flags a missing .git as a warning for local-only repos, and upgrades a missing path to error severity for them

The Repo.IsZero() definition was tightened to drop the URL check (it was the only thing keeping local-only repos out of the loaded profile). A new Repo.IsLocalOnly() exposes the missing-url state explicitly.

Files

  • schemas/raid-profile.schema.jsonurl removed from required; description notes the local-only mode.
  • src/internal/lib/repo.goIsZero no longer requires URL; new IsLocalOnly; CloneRepository short-circuits on local-only.
  • src/internal/lib/doctor.go — context-aware checks for local-only repos.
  • src/internal/lib/profile.go — interactive raid profile create accepts an empty URL prompt; default-branch detection skipped when URL is empty.
  • src/resources/profile-template, site/docs/references/schema.mdx, site/docs/whats-new.mdx — docs updated.
  • Version bumped 0.9.0-beta → 0.10.0-beta.

Test plan

  • go test ./... — all packages green.
  • Coverage on internal/lib stays ≥ 93% with new tests covering IsLocalOnly, the local-only CloneRepository paths (existing-path-skip + missing-path-error), and the new doctor cases.
  • cd site && npm run build — no broken links.
  • End-to-end: tested against a real local-only project (apple-app-list):
    • raid doctor reports clean (no spurious "not a git repository" warning) once url is dropped from the profile.
    • raid install runs swift build + npm install against the existing path with no clone attempt — first line is Repository 'apple-app-list' is local-only at <path>, skipping clone.

🤖 Generated with Claude Code

Make `url` optional on profile repository entries so raid can manage
purely local projects (and one-off scratch directories) without trying
to clone a remote that doesn't exist.

- Schema: `url` removed from the required list in raid-profile.schema.json.
- Repo.IsZero() no longer treats an empty URL as "uninitialized";
  IsLocalOnly() reports the missing-url state explicitly.
- CloneRepository() short-circuits when IsLocalOnly():
    - if the path exists, log "is local-only at <path>, skipping clone"
    - if the path is missing, return a clear error pointing at the path
      and suggesting the user create it or add a url
- Doctor: a missing .git is no longer flagged as a warning when the
  repo has no url (that's expected); a missing path on a local-only
  repo is upgraded to error severity with a suggestion.
- Interactive `raid profile create` flow now treats the URL prompt as
  optional and only auto-detects the default branch when a URL is set.
- Profile template, schema reference, and whats-new updated.
- Version bumped 0.9.0-beta → 0.10.0-beta.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 10, 2026 18:16
@codecov
Copy link
Copy Markdown

codecov Bot commented May 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.71%. Comparing base (a4c0d31) to head (fb45965).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #73      +/-   ##
==========================================
+ Coverage   90.65%   90.71%   +0.05%     
==========================================
  Files          33       33              
  Lines        2772     2788      +16     
==========================================
+ Hits         2513     2529      +16     
  Misses        169      169              
  Partials       90       90              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds local-only repository support to Raid profiles by making url optional and updating install/doctor/profile-creation flows to treat missing URLs as “do not clone; use the existing path”.

Changes:

  • Make profile repository url optional (schema + docs) and treat missing url as a local-only repo.
  • Update cloning/install behavior to skip cloning for local-only repos while erroring clearly if the local path is missing.
  • Update raid doctor and interactive profile creation to be aware of local-only repositories, with new/updated tests.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
schemas/raid-profile.schema.json Makes url optional and documents local-only behavior in schema text.
src/internal/lib/repo.go Adjusts repo “zero” semantics, adds IsLocalOnly(), and short-circuits cloning for local-only repos.
src/internal/lib/repo_test.go Adds coverage for IsLocalOnly() and local-only clone behavior.
src/internal/lib/profile.go Allows empty URL input during interactive profile creation; skips default-branch detection when URL is empty.
src/internal/lib/doctor.go Treats missing local-only paths as errors and suppresses “not a git repo” warnings for local-only repos.
src/internal/lib/doctor_test.go Adds local-only doctor test cases (missing path => error; non-git dir => no warn).
src/resources/profile-template Documents optional url usage in the template comments.
site/docs/references/schema.mdx Updates schema reference docs to mark url as optional and explains local-only constraints.
site/docs/whats-new.mdx Adds release note entry describing local-only repositories.
src/resources/app.properties Bumps app version to 0.10.0-beta.
Comments suppressed due to low confidence (1)

src/internal/lib/profile.go:271

  • When the URL is empty (local-only repo), the prompt still asks for a default branch. Since branch is only used for cloning (which is skipped for local-only repos), this prompt is misleading and can result in a branch value that is never applied. Consider skipping the branch prompt entirely when url == "", or updating the prompt text to clarify it’s only relevant when a URL is provided.
		var defaultBranch string
		if url != "" {
			defaultBranch = sys.DetectGitDefaultBranch(url)
		}
		branchPrompt := "  Default branch: "
		if defaultBranch != "" {
			branchPrompt = fmt.Sprintf("  Default branch [%s]: ", defaultBranch)
		}
		branch := sys.ReadLine(reader, branchPrompt)

Comment thread src/internal/lib/repo.go
Comment on lines +32 to 37
// IsLocalOnly reports whether the repo has no configured git remote.
// Local-only repos skip cloning; install tasks run directly against the
// existing path. The path must already exist on disk for install to work.
func (r Repo) IsLocalOnly() bool {
return r.URL == ""
}
Address review feedback: a profile with `url: " https://..."` or
`url: "   "` would previously slip past the empty-string check in
IsLocalOnly() and be handed verbatim to `git clone`, producing a
confusing failure. Normalize via strings.TrimSpace at both checkpoints
so padded and whitespace-only URLs behave consistently.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@8bitAlex 8bitAlex enabled auto-merge (squash) May 10, 2026 18:24
@8bitAlex 8bitAlex merged commit 5f37965 into main May 10, 2026
13 checks passed
@8bitAlex 8bitAlex deleted the feat/issue-71-local-only-repos branch May 10, 2026 18:25
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.

Support local development without a repo or remote

2 participants