Skip to content

feat(domain): add auto-fork support for remote repos without push access#434

Open
arielshad wants to merge 3 commits intofeat/remote-repo-supportfrom
feat/073-auto-fork-support
Open

feat(domain): add auto-fork support for remote repos without push access#434
arielshad wants to merge 3 commits intofeat/remote-repo-supportfrom
feat/073-auto-fork-support

Conversation

@arielshad
Copy link
Copy Markdown
Contributor

Summary

  • When --remote targets a repo the user can't push to, shep auto-forks it, clones the fork, sets upstream remote, and records fork metadata
  • Adds isFork and upstreamUrl fields to the Repository domain model (TypeSpec + migration + mapper)
  • Adds checkPushAccess, forkRepository, getAuthenticatedUser methods to IGitHubRepositoryService
  • Extends ImportGitHubRepositoryUseCase with automatic fork detection and conditional fork/clone flow
  • CLI shows fork status in output and handles GitHubForkError
  • Web UI shows "Fork" badge on forked repos in the repository combobox
  • Duplicate detection enhanced: checks both remoteUrl and upstreamUrl to avoid re-importing

Test plan

  • pnpm validate passes (lint, format, typecheck, tsp)
  • pnpm test:unit — 334 files, 4573 tests pass
  • pnpm build succeeds
  • CI passes on this PR
  • Manual: shep feat new --remote <public-repo-you-dont-own> "test" → forks, clones fork, sets upstream
  • Manual: shep feat new --remote <repo-you-own> "test" → clones directly, no fork

🤖 Generated with Claude Code

When --remote targets a repo the user cannot push to, shep now
auto-forks it to the user's GitHub account, clones the fork, sets
upstream remote, and records fork metadata (isFork, upstreamUrl).

- Add isFork/upstreamUrl fields to Repository TypeSpec model
- Add DB migration 044 for fork columns
- Add checkPushAccess, forkRepository, getAuthenticatedUser to
  IGitHubRepositoryService
- Extend ImportGitHubRepositoryUseCase with fork detection flow
- Show fork status in CLI output and handle GitHubForkError
- Add Fork badge in Web UI repository combobox
- Return forked status from import server action
- Add comprehensive unit tests for all new functionality

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@arielshad
Copy link
Copy Markdown
Contributor Author

This might be redundant

arielshad and others added 2 commits March 22, 2026 10:24
Add UI evidence for the remote repo support feature:
- RepositoryCombobox: stories for forked repos with badge display,
  pre-selected fork with upstream tooltip, and forks with import
- FeatureCreateDrawer: story demonstrating forked repos in selector
- GitHubImportDialog: complete placeholder stories with interactive
  play functions for URL tab, Browse tab, and pre-opened states

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
replace manual expand/collapse state with radix accordion primitive
so all task cards are collapsed by default with smooth animated
accordion-like expand and collapse behavior

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.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