Treat user-account bot comments as innocent in triage - #31
Merged
Merged
Conversation
Bot detection relied solely on user.type === 'Bot', which GitHub only sets for app accounts. Classic bots that run on plain user accounts (e.g. withastro's astrobot-houston) are typed 'User', so their comments slipped past the router and the FSM treated them as human activity. On issue withastro/astro#17991 that made the factory retriage the issue and swap the maintainer-set 'triage: needs reproduction' label away (needs reproduction -> needs triage -> in progress -> unable to reproduce). - Add isBotAuthor() (src/github/bots.ts): flags '[bot]'-suffixed app logins and known user-account bots (astrobot-houston). - Router: drop issue_comment deliveries from bot authors before dispatch. - Triage workflow: skip 'comment' deliveries whose commentAuthor is a bot, so already-queued deliveries from before this fix cannot drop a label either (defense in depth). - fetchIssueDetails: mark known user-account bots as authorIsBot so the conversation the retriage judge and fix verifier read no longer treats them as human input.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
user.type === 'Bot', which is set for app accounts but not for classic bots running on user accounts — like withastro's astrobot-houston. Its comment on #17991 started a retriage that swapped the maintainer-settriage: needs reproductionlabel away (needs reproduction → needs triage → in progress → unable to reproduce).isBotAuthor()insrc/github/bots.ts: flags[bot]-suffixed app logins (GitHub's own app convention, as a belt-and-braces fallback) plus a known list of user-account bots (astrobot-houston).issue_comment.createddeliveries from bot authors before dispatch, so a bot comment can no longer start a triage at all.commentdelivery whose author is a bot is skipped instead of routed through the FSM, so deliveries enqueued before this change also cannot move labels.Testing
tests/bots.test.ts(new):isBotAuthorcoverage — app[bot]suffix, known user-account bot, human logins, missing/empty logins.tests/router.test.ts: comment fromastrobot-houston(typeUser) is dropped;[bot]-suffixed author is dropped even when thetypefield is missing from the payload.Docs