feat(filters): distinguish author and commenter in search filters#2959
feat(filters): distinguish author and commenter in search filters#2959afonsojramos wants to merge 2 commits into
Conversation
|
I've been thinking about this FR... GitHub UI doesn't distinguish between author or commenter, since notifications always show the latest state - so I was tempted to close the FR as unplanned... That said, alternatively, we could look to change the filter include/exclude tokens to support I'm not sure I'm a fan of changing the filter based on the notification subject code |
|
@setchy fair... It is also forge specific code that is leaking A LOT tbh |
|
Reworked this to drop the reason-based approach and go with the Enrichment now exposes two distinct roles on the subject ( Net effect:
Two caveats with the current implementation, however:
|
|
Followup: managed to fix the commit caveat. Commit notifications now fetch the commit and its latest comment in parallel, so both author and commenter are populated like the other types |
|
|
So, final caveat: If one excludes commenter:coderabbitai, a teammate opens a PR and requests a review, then CodeRabbit auto-comments after the request and becomes the latest commenter. That review-request notification gets hidden even though you were asked to review. But maybe this is a disadvantage of excluding bot comments? Or an incentive to be selective of which commenters to exclude. But, to be honest, this was already the case, so nothing new. Before: author: was the only tool, it secretly matched the last commenter, and you had no way to avoid that. Every user of that filter hit the bluntness. Now: author: matches the real author, so it’s precise and no longer drops review requests. The old blunt “match whoever commented last” behavior still exists, but only if you deliberately reach for commenter:. |
|
Thanks @afonsojramos. Let me soak on this a bit. We also have a Bot filter which includes dependabot, renovate, netlify. I wonder if we should expand that |



Summary
The
author:search filter matchedsubject.user, but enrichment setssubject.userto the latest commenter (for the avatar), not the thread author. Soauthor:coderabbitaias an exclude hid review requests on human-authored PRs whenever the bot left the last comment, and the filter named "author" was really matching commenters.This splits that conflated identity into two distinct, forge-agnostic roles on the notification subject:
author: who created the thread (pull request / issue / discussion / release / commit)commenter: who left the latest comment, when there is onesubject.userstays as the derived display identity (commenter ?? author), so the avatar and the user-type filter are unchanged. The search qualifiers now read these roles directly:author:matches the thread authorcommenter:(new) matches the latest comment authorThe filter layer no longer inspects GitHub notification reasons, so it stays generic across forges. For commit notifications the commit author and the latest comment author are fetched in parallel, so both roles are populated without extra latency.
Closes #2914