36 lines
1.2 KiB
Markdown
36 lines
1.2 KiB
Markdown
|
|
---
|
||
|
|
brief: 4
|
||
|
|
convoy: polish-dag-tiers-cost
|
||
|
|
role: role-implementer
|
||
|
|
title: Repo preflight check before clone
|
||
|
|
status: ready
|
||
|
|
priority: P2
|
||
|
|
slice_dependencies: []
|
||
|
|
recommended_model: qwen-coder
|
||
|
|
model_tier: local
|
||
|
|
---
|
||
|
|
|
||
|
|
# Brief 4 — `Task-repo-setup-preflight` (Epic 3)
|
||
|
|
|
||
|
|
## Goal
|
||
|
|
|
||
|
|
`POST /api/connected-repos/preflight` checks `git ls-remote` + worktree writability before clone, UI shows result — Autensa benchmark row `repo setup preflight`.
|
||
|
|
|
||
|
|
## Files
|
||
|
|
|
||
|
|
- `apps/web/server/routers/connected-repos.ts` — add `preflight` procedure `input:{url}` → `git ls-remote url` (timeout 5s) + `fs.access(WORKER_WORKTREE_BASE, W_OK)`, returns `{ok, reason}`. Reuse `forge adapters`.
|
||
|
|
- `apps/web/app/(app)/[workspaceSlug]/settings/repos/page.tsx` — call `preflight` on paste, show green/red before `create`.
|
||
|
|
|
||
|
|
## Acceptance
|
||
|
|
|
||
|
|
- Invalid URL `https://nope.invalid/repo.git` → `ok:false reason: ls-remote failed`; valid `https://github.com/octocat/Hello-World.git` → `ok:true`.
|
||
|
|
- `pnpm lint && pnpm type-check` pass.
|
||
|
|
|
||
|
|
## Prompt
|
||
|
|
|
||
|
|
You are `role-implementer` brief 4. Read `plans/Plan-automation-foundation/Epic-connected-repos/Task-repo-setup-preflight.md`, `apps/web/server/routers/connected-repos.ts`, `apps/worker/src/git/worktree.ts`. Keep timeout small, no creds leak.
|
||
|
|
|
||
|
|
## Depends
|
||
|
|
|
||
|
|
None.
|