Documentation
¶
Overview ¶
Package aireview identifies webhook events from a "bot reviewer" (any account whose sender.type is "Bot") and exposes two orthogonal policies over that identity. The detector is a tiny value object so callers can short-circuit cheaply.
- ShouldSuppress is the opt-in mute switch (NOTIFYCAT_IGNORE_AI_REVIEWS): when enabled, a bot reviewer's reaction is skipped entirely.
- IsBot is the bare identity check, independent of that flag, used to add a distinct bot-review marker reaction when the bot is *not* suppressed.
The opt-in flag is global and defaults off; see internal/config. Detection is deliberately broad: GitHub's payload does not distinguish AI reviewers (Copilot, Claude, …) from scripted bots (dependabot, renovate, release-please, …), so operators who enable the flag accept that any non-human reviewer is silenced. See docs/operations.md for the trade-off.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Detector ¶
type Detector struct {
// contains filtered or unexported fields
}
Detector decides whether to suppress reactions for an event whose sender is a bot. Zero value is a disabled detector that never suppresses.
func NewDetector ¶
NewDetector returns a Detector. When enabled is false, ShouldSuppress always returns false without inspecting its argument.
func (*Detector) IsBot ¶ added in v0.12.0
IsBot reports whether the given sender.type is a bot, regardless of the suppression flag. Callers use it to add the distinct bot-review marker once they have already passed the ShouldSuppress gate. Matches "Bot" only.
func (*Detector) ShouldSuppress ¶
ShouldSuppress reports whether a reaction for an event with the given sender.type should be skipped. Matches GitHub's literal "Bot" only.