pr_merge sends merge_message_title, but Gitea's field is merge_title_field: a custom merge title is silently ignored #77

Closed
opened 2026-10-08 06:12:45 +00:00 by mathias · 0 comments
Owner

Found 2026-10-08 while adding head_commit_id to the merge request (PR #76). Gitea 1.27.1's swagger MergePullRequestOption lists: delete_branch_after_merge, do, force_merge, head_commit_id, merge_commit_id, merge_message_field, merge_title_field, merge_when_checks_succeed.

internal/gitea/pulls.go MergePRArgs sends Do (works, Go decodes case-insensitively), merge_message_field (correct) and merge_message_title (not a Gitea field → ignored). So pr_merge's merge_message_title argument has never changed the merge commit title.

Fix: rename the JSON tag to merge_title_field; test that the request body carries it (the fake in internal/tools/pr_merge_test.go already captures the body). Note the lesson (brain: verify mocks against the live API spec): the existing tests passed because the fake never checked the field name.


Created via git-mcp on behalf of @mathias

Found 2026-10-08 while adding `head_commit_id` to the merge request (PR #76). Gitea 1.27.1's swagger `MergePullRequestOption` lists: `delete_branch_after_merge, do, force_merge, head_commit_id, merge_commit_id, merge_message_field, merge_title_field, merge_when_checks_succeed`. `internal/gitea/pulls.go` `MergePRArgs` sends `Do` (works, Go decodes case-insensitively), `merge_message_field` (correct) and **`merge_message_title`** (not a Gitea field → ignored). So `pr_merge`'s `merge_message_title` argument has never changed the merge commit title. Fix: rename the JSON tag to `merge_title_field`; test that the request body carries it (the fake in internal/tools/pr_merge_test.go already captures the body). Note the lesson (brain: verify mocks against the live API spec): the existing tests passed because the fake never checked the field name. --- _Created via git-mcp on behalf of @mathias_
mathias added the risk/lowsize/xstype/fix labels 2026-10-10 08:48:55 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mathias/gitea-mcp#77