Files
GitManager/components/pr-list/pr-list.md
T
TBNilles 9d1519222c Slice 5: Gitea forge - PRs and Merge & clean up
New internal/forge (provider-abstracted, Gitea impl via code.gitea.io/sdk/gitea) with tested remote-URL parsing and read+write ops: list open PRs, and merge-and-cleanup (squash-merge + delete head branch when head/base share a repo). Service resolves repo->owner/repo from remotes (prefers origin) and records a pr-merged event; config gains GITEA_URL/GITEA_TOKEN (forge disabled without both). MCP tools list_prs and merge_and_cleanup_pr (merge tool tells Claude to confirm first, 1.4). HTTP GET /api/repo/prs, POST /api/repo/pr/merge. New <pr-list> component with a confirming Merge & clean up button, hidden when no forge. Verified graceful-disabled path; real merge pending token + a designated PR.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-20 08:37:51 -04:00

27 lines
1.2 KiB
Markdown

# pr-list
## Intent
Shows the open pull requests for the selected repository and provides the
**"Merge & clean up"** action (AGENT.md §8.4) — the feature that makes PRs usable
for someone who otherwise finds them clutter: squash-merge and delete the branch
in one click. The merge is DESTRUCTIVE (§1.4), so the button confirms first,
naming the PR, base, and branch to be deleted.
## Public surface
- **Tag:** `<pr-list>`
- **Attributes/properties:** none. Hides itself (`hidden`) when no forge is
configured or the repo isn't on the forge host.
- **Listens:** `repo:select` on `document` — loads PRs for `event.detail.path`.
- **Fetches:** `GET /api/repo/prs?path=…` (`{supported:false}` → hidden).
- **Writes:** `POST /api/repo/pr/merge {path, number}` after a `confirm()`.
## History
- 2026-09-20: created — slice 5 (forge); list open PRs + "Merge & clean up".
## Notes / gotchas
- Requires `GITEA_URL` + `GITEA_TOKEN` on the server; otherwise the component
stays hidden (graceful degradation).
- Fork PRs are labelled; their branch lives in the fork, so cleanup only deletes
branches in the same repo (the server enforces this too).
- All server-derived text is escaped; the PR link opens in a new tab.