Skip to content

#17 fix: handle pull_request_review_comment payload differences in Gitea - #19

Merged
markwylde merged 6 commits into
markwylde:giteafrom
leoarry:17-fix-pr-review-comment-fail
Jun 8, 2026
Merged

#17 fix: handle pull_request_review_comment payload differences in Gitea#19
markwylde merged 6 commits into
markwylde:giteafrom
leoarry:17-fix-pr-review-comment-fail

Conversation

@leoarry

@leoarry leoarry commented Jun 7, 2026

Copy link
Copy Markdown

Gitea's pull_request_review_comment webhook payload differs from the GitHub spec: the comment content is in review.content instead of comment.body, and the sender is in sender rather than comment.user. This caused a crash with "undefined is not an object (evaluating 'context.payload.comment.body')".

  • Add GiteaReviewCommentPayload type extending PullRequestReviewCommentEvent with Gitea-specific fields
  • Use optional chaining throughout to prevent crashes when comment is absent
  • Fall back to review.content and sender.login for Gitea payloads
  • Fix branch URL in comment-logic.ts to read GITEA_SERVER_URL at call time rather than module load time (was always resolving to github.com in tests)

@markwylde

Copy link
Copy Markdown
Owner

Thanks again @leoarry

Claude caught:

for pull_request_review_comment events the prompt still tells Claude to post updates via mcp__gitea__update_pull_request_comment (PATCH /pulls/comments/{id}, which doesn't exist in Gitea), but since the tracking comment is created as a regular issue comment on this path, it should point at mcp__gitea__update_issue_comment instead.

Not sure if this should be fixed here? But I'm tempted to merge anything just to get this pushed forward.

@leoarry

leoarry commented Jun 7, 2026

Copy link
Copy Markdown
Author

@markwylde I'll have a look after dinner, if I remember well it fall back anyway to that function, need to double check.

@leoarry

leoarry commented Jun 7, 2026

Copy link
Copy Markdown
Author

@markwylde I've corrected Claude's original suggestion, it was on the right track as PR comments are ultimately treated as issue comments. I've also added a couple of commits to properly handle PR reviews; Claude now triggers and generates a response for all three review states: approve, comment, and request changes.
image

Repository owner deleted a comment from socket-security Bot Jun 8, 2026
@markwylde
markwylde merged commit b744372 into markwylde:gitea Jun 8, 2026
2 checks passed
@markwylde

Copy link
Copy Markdown
Owner

Thanks a lot @leoarry really appreciate all your help. I'll get a release out now.

@leoarry

leoarry commented Jun 8, 2026

Copy link
Copy Markdown
Author

@markwylde no problems 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants