fj pr merge returns opaque HTTP 405 for a PR with merge conflicts (should say 'has merge conflicts / not mergeable') #159

Closed
opened 2026-06-15 00:23:40 +00:00 by stephen · 0 comments
Owner

Problem

fj pr merge <n> --style squash on a PR that has unresolved merge conflicts with the base returns a bare:
error: HTTP status client error (405 Method Not Allowed) for url (.../pulls/<n>/merge)
with no indication that the cause is merge conflicts. The 405 is indistinguishable from other merge-blockers (disabled merge style, failed required checks, branch protection), which sent a debugging session down the wrong path (chased branch-protection + required-check-contexts for ~30min) before a web-UI screenshot revealed 'Has conflicts with main that must be resolved'.

Ask

On merge failure, surface the actual reason. The PR object exposes mergeability (e.g. mergeable=false / a conflicting-files indicator); fj pr merge should print something like:
error: PR #<n> is not mergeable: has merge conflicts with <base> (resolve conflicts / rebase first)
and ideally distinguish: conflicts vs failing required checks vs disabled merge method vs branch protection. fj pr view/fj pr checks could also show a conflict/mergeable line.

Repro (2026-06-15)

rasterstate/paragon #449 (green CI, squash-only enabled) -> fj pr merge 449 --style squash -> 405. Web UI showed merge conflicts with main. fj gave no conflict signal.

## Problem `fj pr merge <n> --style squash` on a PR that has unresolved merge conflicts with the base returns a bare: `error: HTTP status client error (405 Method Not Allowed) for url (.../pulls/<n>/merge)` with no indication that the cause is **merge conflicts**. The 405 is indistinguishable from other merge-blockers (disabled merge style, failed required checks, branch protection), which sent a debugging session down the wrong path (chased branch-protection + required-check-contexts for ~30min) before a web-UI screenshot revealed 'Has conflicts with main that must be resolved'. ## Ask On merge failure, surface the actual reason. The PR object exposes mergeability (e.g. mergeable=false / a conflicting-files indicator); `fj pr merge` should print something like: `error: PR #<n> is not mergeable: has merge conflicts with <base> (resolve conflicts / rebase first)` and ideally distinguish: conflicts vs failing required checks vs disabled merge method vs branch protection. `fj pr view`/`fj pr checks` could also show a conflict/mergeable line. ## Repro (2026-06-15) rasterstate/paragon #449 (green CI, squash-only enabled) -> `fj pr merge 449 --style squash` -> 405. Web UI showed merge conflicts with main. fj gave no conflict signal.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rasterstate/fj#159
No description provided.