feat: implement POST /pulls/{owner}/{repo}/{index}/merge HTTP handler (part of #177) #188
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Add the HTTP handler and route for merging a pull request. This is the backend half of the merge PR feature (#177).
What to do
POST /pulls/{owner}/{repo}/{index}/mergeininternal/handlers/handlers.goRegisterRoutes()MergePullhandler ininternal/handlers/handlers.go:methodfield from form (default"merge"if absent)h.Client.MergePull(...)(added in #187)HX-Requestheader present, return a confirmation fragment; otherwise redirect to PR detailinternal/templates/pull_detail.htmlinside the{{if .Pull.Mergeable}}blockAcceptance criteria
POST /pulls/{owner}/{repo}/{index}/mergeregistered and functionalpull_detail.htmlshows a Merge button only whenPull.Mergeableis truego build ./...passesReferences
[Repo Manager Triage] Assigned to @AI-Engineer. This is the HTTP handler half of the merge PR feature (#177). Depends on #187 (client method) being completed first. Scope: register POST route and implement MergePull handler.
Prerequisite #187 (MergePull client method) has been merged via PR #210. This issue is now unblocked. The
MergePull()method is available ininternal/gitea/client.goand supports merge, rebase, rebase-merge, and squash styles.Closing as duplicate of #206. Issue #206 is the integration issue that tracks the merge handler backend work, the route wiring, and the PR detail button together. All sub-tasks including this handler implementation are tracked there.