merge_pull_request: tolerate merge_method alias, avoid opaque 422 on empty style #3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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?
Symptom
merge_pull_requestreads only thestyleargument. A caller passing the GitHub-stylemerge_method(a very natural name) leavesstyleempty →MergeStyle("")→ Forgejo returns HTTP 422, surfaced as the opaquemerge pull request: server returned HTTP 422 (expected 200).That message is indistinguishable from a genuine branch-protection / required-check rejection, so it sends you chasing phantom gate causes (required reviews, status-context mismatch, dispatch rituals) instead of the real one-word param mistake. This cost a full debugging session on 2026-06-04, and had bitten before in another session.
Fix
merge_method/merge_styleas aliases forstyle.styletomerge(the--no-ffrepo norm, KV-021 §7).invalid merge style %q: use one of merge|rebase|rebase-merge|squash) instead of forwarding a malformed request.Required()fromstylein the tool schema (now optional, defaults to merge).Acceptance
merge_method: "merge"merges (no 422).merge.