fix(FM): fm-pr-merge Forgejo merge payload and error reporting #9

Merged
john merged 3 commits from fm/fm-pr-merge-forgejo-fix into main 2026-08-12 08:10:33 +00:00
Owner

fm-pr-merge.sh could not merge a Forgejo pull request. It sent the merge request as form data where the API expects JSON, so the merge method never arrived and the server rejected it with a bare 422.

That mattered beyond the bug: the helper exists so merges are recorded and guarded, and when it failed on a healthy pull request the operator merged by hand instead - the guard was bypassed because the guarded path was broken.

  • Sends a JSON body, so the merge method arrives as the API expects.
  • Surfaces the forge's own error message instead of a bare curl status, so the next failure is diagnosable rather than a dead end. That is arguably the more valuable half.
  • Regression coverage against a mocked forge response; no live forge needed.
  • GitHub path unchanged and the GitLab refusal intact.
fm-pr-merge.sh could not merge a Forgejo pull request. It sent the merge request as form data where the API expects JSON, so the merge method never arrived and the server rejected it with a bare 422. That mattered beyond the bug: the helper exists so merges are recorded and guarded, and when it failed on a healthy pull request the operator merged by hand instead - the guard was bypassed because the guarded path was broken. - Sends a JSON body, so the merge method arrives as the API expects. - Surfaces the forge's own error message instead of a bare curl status, so the next failure is diagnosable rather than a dead end. That is arguably the more valuable half. - Regression coverage against a mocked forge response; no live forge needed. - GitHub path unchanged and the GitLab refusal intact.
no-mistakes(document): document Forgejo merge JSON body and error reporting
Some checks failed
CI / Behavior timing aggregate (pull_request) Has been cancelled
CI / Lint shell scripts (pull_request) Has been cancelled
CI / Test coverage guard (pull_request) Has been cancelled
CI / Behavior portable serial 4 (pull_request) Has been cancelled
CI / Behavior tests (Herdr) (pull_request) Has been cancelled
CI / Behavior portable parallel 1 (pull_request) Has been cancelled
CI / Behavior portable parallel 2 (pull_request) Has been cancelled
CI / Behavior portable serial 1 (pull_request) Has been cancelled
CI / Behavior portable serial 2 (pull_request) Has been cancelled
CI / Behavior portable serial 3 (pull_request) Has been cancelled
CI / Stock macOS Bash snapshot compatibility (pull_request) Has been cancelled
CI / Repo invariants (pull_request) Has been cancelled
Require no-mistakes / PR must be raised via no-mistakes (pull_request) Has been cancelled
42718b60b7
john merged commit f5d3078aac into main 2026-08-12 08:10:33 +00:00
Sign in to join this conversation.
No reviewers
No labels
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
john/firstmate!9
No description provided.