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>
This commit is contained in:
@@ -138,3 +138,24 @@ Append-only running history of all changes (AGENT.md §9.1). Newest last.
|
||||
- **Verified live:** request → "waiting" → cancel, all over SSE with activity
|
||||
logging. The ack/completion path is covered by the test; its live ✅ notice
|
||||
needs the two new MCP tools, which appear after the next Claude Desktop restart.
|
||||
|
||||
## 2026-09-20 — Slice 5: Gitea forge — PRs + "Merge & clean up" (§8.4)
|
||||
- **What:** New `internal/forge` — provider-abstracted forge boundary with a Gitea
|
||||
impl (`code.gitea.io/sdk/gitea`), a remote-URL parser (`ParseRemote`, tested),
|
||||
and read+write ops: `ListPullRequests` and `MergeAndCleanup` (squash-merge +
|
||||
delete the head branch, only when head/base share a repo). Service resolves a
|
||||
repo → owner/repo via its remotes (prefers origin) and records a `pr-merged`
|
||||
activity event. New config `GITEA_URL` + `GITEA_TOKEN` (forge is nil/disabled
|
||||
without both). New MCP tools `list_prs` and `merge_and_cleanup_pr` (the merge
|
||||
tool's description 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 is configured.
|
||||
- **Why:** The feature Thomas asked for — make PRs usable by merging and removing
|
||||
the branch in one tidy step, from the app or via Claude.
|
||||
- **Affects:** `internal/forge` (new, +test), `internal/config`,
|
||||
`internal/service`, `internal/mcp`, `cmd/server/main.go`,
|
||||
`components/pr-list` (new), `web/templates/{index,help}.html`, `.env.example`,
|
||||
`go.mod`.
|
||||
- **Not yet live-tested:** needs `GITEA_URL`+`GITEA_TOKEN` set and a real PR;
|
||||
build/vet/tests pass and the parser is unit-tested. A real merge is irreversible
|
||||
— will only run one against a PR Thomas designates, with confirmation.
|
||||
|
||||
Reference in New Issue
Block a user