Add GitHub repository clone flow#167
Conversation
- add the clone-project modal and menu entry in the renderer - add GitHub account/repo listing plus clone IPC/runtime support - extend WSL bridge timeouts for long-running clone commands
- Show a cloning progress view with target and destination details - Update repo browser loading, search, and row states - Cover the in-flight clone flow with a modal test
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3ec33b13d8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| test("falls back to URL mode when no GitHub accounts are signed in", async () => { | ||
| mocks.ghListAccounts.mockResolvedValue({ accounts: [] }); | ||
| test("shows a loading view with the target while the clone is in flight", async () => { |
There was a problem hiding this comment.
Move the loading test out of the fallback test
This nested test(...) is executed at runtime instead of being collected by Vitest. I ran pnpm exec vitest run src/renderer/views/MainView/parts/CreateProject/CloneProjectModal.test.tsx --reporter=dot, and Vitest fails with “Calling the test function inside another test function is not allowed”, so this commit breaks the clone modal test file before the loading assertion can run. Move this case out alongside the surrounding tests.
Useful? React with 👍 / 👎.
| account: GitHubAccountRef, | ||
| ): Promise<GhListReposResult> { | ||
| const token = await this.getAccountToken(location, account); | ||
| const env = { GH_TOKEN: token }; |
There was a problem hiding this comment.
Scope GitHub API calls to the selected host
When the selected account is from GitHub Enterprise (for example ghe.example.com, which parseGhAuthAccounts already preserves), setting only GH_TOKEN does not make gh api user/repos... target that host; the gh api manual documents --hostname and says it defaults to github.com, and gh help environment says GH_HOST is needed when the host cannot be inferred. Because this flow runs from a home directory rather than an existing repo, enterprise accounts will query github.com with the enterprise token instead of account.host, so repo browsing (and the clone path using the same env below) fails for those accounts. Pass the selected host via --hostname/GH_HOST and use the enterprise token env for non-github.com hosts.
Useful? React with 👍 / 👎.
Tickets: none