Repository navigation
PR review notifications refer to the reviewer by GitHub login even when they are the mentioned Slack user #2248
Copy link
Copy link
Closed
Description
When someone reviews a pull request that Junior opened for them, Junior's notification can mention that person in Slack and then name them again by their GitHub login, as if they were someone else. Example from a real thread, where the reviewer also asked for the PR:
@BYK BYK approved getsentry/toolkit#1679. Both #1678 and #1679 have since merged.
The reviewer's GitHub account is linked: userLookup with provider: github, query: BYK returns the same Slack user that the message mentions. So the identity link exists; the event path just doesn't use it for the reviewer.
Why it happens
normalizePullRequestReviewEvent(packages/junior-github/src/webhooks/events.ts) carries the reviewer only as a raw login insidetrustedSummary(... was approved by ${reviewer},... received requested changes from ${reviewer}). The same applies to the comment authors in the review-comment and issue-comment normalizers. The eventdatahas no reviewer or actor field.withGitHubPullRequestPeople(packages/junior-github/src/webhooks/pull-request-people.ts) fillspeopleonly forpull_request.review.approvedandpull_request.merged. It takes them from the PR author, assignees, commit authors andCo-authored-bytrailers. It never adds the reviewer as an actor, and it doesn't run for changes-requested, commented or review-comment events.resolveEventPeopleMentions(packages/junior/src/chat/events/people.ts) resolves those people to Slack mentions, andbuildTaskInput(packages/junior/src/chat/task-input.ts) renders them only asPeople involved: <@U…>. Nothing tells the model which mention, if any, belongs to the person who did the action.- The model gets
People involved: <@U…>andTrusted summary: … approved by BYKwith nothing connecting the two, so it writes a third-person sentence about the person it is mentioning.
Proposed fix
- Add an optional actor to
EventInputin@sentry/junior-plugin-api(e.g.actor?: EventPerson), separate frompeople. GitHub review and comment normalizers set it fromreview.user.loginorcomment.user.login. - In core ingest, resolve the actor through the same linked-identity lookup as
people(exact single match only, no guessing). - Render the result in the task input, e.g.
Actor: <@U…> (GitHub: BYK). If the actor is also in People involved, say so explicitly (for exampleActor is the person being notified). - Update the outcome guidance in
packages/junior-github/src/events/pull-request.ts: when the actor is the person being notified, address them as "you" or don't notify them about their own action, and never repeat the mention as a third-person login. Possibly skip approval and review notices entirely when the only recipient is the actor. - Tests: extend
webhook-outcomes.test.ts/github-plugin.test.tswith a case where the reviewer's GitHub login links to the requester's Slack user, and add an eval that asserts the notification doesn't name the same person twice.
Related
- Link GitHub and Sentry accounts to Junior users reliably #2200 covers accounts that never get linked. That's a different problem: here the link exists but isn't used for event actors.
- Automation runs misdescribe delivery and act like chat turns #2014 covers how automation runs describe delivery.
via BYK.
--
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity