Skip to content

feat/webhook-reviewer-name-parity - #39635

Open
stackedbyaradhya wants to merge 1 commit into
go-gitea:mainfrom
stackedbyaradhya:feat/webhook-reviewer-name-parity
Open

stackedbyaradhya wants to merge 1 commit into
go-gitea:mainfrom
stackedbyaradhya:feat/webhook-reviewer-name-parity

Conversation

@stackedbyaradhya

Copy link
Copy Markdown

Closes #39634

MSTeams already surfaces the requested reviewer's name on review-request/
review-request-removed pull request events (added in #38289 for #38270),
but every other chat provider just says "Pull request review requested"
with no indication of who. api.PullRequestPayload.RequestedReviewer is
already populated for all providers; it just isn't consumed by Discord
or Slack.

Extends Discord and Slack the same way MSTeams does: when the action is
a review-request(-removed) event and RequestedReviewer is set, appends
the reviewer's username (and full name, if set) to the notification.
Scoped to these two providers for this PR to keep the diff small; the
same change could be made for the remaining providers if wanted.

Added TestDiscordPayload/PullRequestReviewRequest and
TestSlackPayload/PullRequestReviewRequest, modeled on the existing
MSTeams test for the same scenario. Verified both fail without the
respective provider change and pass with it.

MSTeams already surfaces the requested reviewer's name on review-request/
review-request-removed pull request events (added in go-gitea#38289 for go-gitea#38270),
but every other chat provider just says "Pull request review requested"
with no indication of who. api.PullRequestPayload.RequestedReviewer is
already populated for all providers; it just isn't consumed by Discord
or Slack.

Extend Discord and Slack the same way MSTeams does: when the action is
a review-request(-removed) event and RequestedReviewer is set, append
the reviewer's username (and full name, if set) to the notification.
Scoped to these two providers for this PR to keep the diff small; the
same change could be made for the remaining providers if wanted.

Added TestDiscordPayload/PullRequestReviewRequest and
TestSlackPayload/PullRequestReviewRequest, modeled on the existing
MSTeams test for the same scenario. Verified both fail without the
respective provider change and pass with it.
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 6, 2026
@bircni
bircni requested a lite review from Copilot October 6, 2026 13:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Bound Discord titles and escape reviewer names in Slack mrkdwn before approval.

Review effort: Lite
Findings: 2 Medium severity

Open (2)
What changed in this PR

Adds requested reviewer names to Discord and Slack pull-request review notifications.

Changes:

  • Appends reviewer usernames and optional full names.
  • Adds Discord and Slack regression tests.
File Summary
services/​webhook/​slack.go Adds reviewer details to Slack notifications.
services/​webhook/​slack_test.go Tests Slack reviewer output.
services/​webhook/​discord.go Adds reviewer details to Discord titles.
services/​webhook/​discord_test.go Tests Discord reviewer output.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +200 to +206
if (p.Action == api.HookIssueReviewRequested || p.Action == api.HookIssueReviewRequestRemoved) && p.RequestedReviewer != nil {
reviewerName := p.RequestedReviewer.UserName
if p.RequestedReviewer.FullName != "" {
reviewerName += " (" + p.RequestedReviewer.FullName + ")"
}
title += " (Requested Reviewer: " + reviewerName + ")"
}
Comment thread services/webhook/slack.go
if p.RequestedReviewer.FullName != "" {
reviewerName += " (" + p.RequestedReviewer.FullName + ")"
}
text += " (Requested Reviewer: " + reviewerName + ")"

This branch has not been deployed

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

Labels

lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Discord and Slack PR webhooks don't show requested reviewer name

3 participants