CodeIssuesPull RequestsActionsSecurityInsights
✨ AI
More
Settings

API docs advertise POST /api/v2/repos/:owner/:repo/pulls/:number/merge but no route implements it#194

Closedccantynz opened this issue 25d ago
ccantynzAuthorcommented 25d ago

src/routes/docs.tsx:1287 documents POST /api/v2/repos/:owner/:repo/pulls/:number/merge, but no such route exists in src/routes/api-v2.ts (or anywhere else). The only real merge path is the web route POST /:owner/:repo/pulls/:number/merge (src/routes/pulls.tsx:6143), which accepts a Bearer PAT via softAuth but 302-redirects to the PR page on BOTH success and failure, so API callers cannot tell whether the merge happened without a follow-up GET.

Another instance of the two-sources-of-truth pattern. Fix either way:

  1. Implement the documented v2 endpoint (JSON in/out, same gates as the web flow � src/lib/pr-merge.ts already factors the logic), or
  2. Correct the docs to describe the web route and its redirect semantics.

Option 1 is strongly preferred: with the GitHub-outage urgency, external tooling and AI agents need a real JSON merge API, and the MCP gluecron_merge_pr tool is unavailable whenever the connector token expires (as happened today).

?? Filed by Claude Code while shipping PR #3524

ccantynzcommented 25d ago

Closed by pull request #3525.

c comment · e edit title · x close/reopen · ? shortcuts