feat: support local-only repositories (closes #71)#73
Merged
Conversation
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>
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
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
urloptional (schema + docs) and treat missingurlas 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 doctorand 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 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>
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
Resolves #71 — Support local development without a repo or remote.
urlis now optional on profile repository entries. When omitted, raid treats the entry as local-only:raid installno longer fatal-errors trying togit clone ""against a remote that doesn't exist)raid doctorno longer flags a missing.gitas a warning for local-only repos, and upgrades a missing path to error severity for themThe
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 newRepo.IsLocalOnly()exposes the missing-url state explicitly.Files
schemas/raid-profile.schema.json—urlremoved fromrequired; description notes the local-only mode.src/internal/lib/repo.go—IsZerono longer requires URL; newIsLocalOnly;CloneRepositoryshort-circuits on local-only.src/internal/lib/doctor.go— context-aware checks for local-only repos.src/internal/lib/profile.go— interactiveraid profile createaccepts 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.Test plan
go test ./...— all packages green.IsLocalOnly, the local-onlyCloneRepositorypaths (existing-path-skip + missing-path-error), and the new doctor cases.cd site && npm run build— no broken links.apple-app-list):raid doctorreports clean (no spurious "not a git repository" warning) onceurlis dropped from the profile.raid installrunsswift build+npm installagainst the existing path with no clone attempt — first line isRepository 'apple-app-list' is local-only at <path>, skipping clone.🤖 Generated with Claude Code