autoLabelBot: don't re-add triage review if already triaged#8095
Open
malfet wants to merge 3 commits into
Open
autoLabelBot: don't re-add triage review if already triaged#8095malfet wants to merge 3 commits into
malfet wants to merge 3 commits into
Conversation
When a "high priority" or "critical" label is applied, the bot adds "triage review". Previously, if a triager removed "triage review" and then the priority label was later removed and re-applied, the bot would re-add "triage review" — re-triaging an already-triaged issue. Check the issue's events for a prior `unlabeled` event for "triage review" and skip the auto-add in that case. The existing comment at the call site already documented this as the intended behavior; this commit makes it match.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
If someone applies hi-pri to an old, previously-triaged issue because it resurfaced, we still want the bot to re-request triage. So instead of suppressing the re-add forever, only suppress it when the unlabel event happened within the last hour — which is the window that catches an active triager finishing up.
janeyx99
reviewed
May 18, 2026
| label: { name: "triage review" }, | ||
| created_at: recent, | ||
| }, | ||
| ]); |
Contributor
There was a problem hiding this comment.
should there be a post expected here to check that the label's not there?
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.
Summary
high priorityorcriticalis applied, the bot addstriage review. Previously, if a triager removedtriage reviewand the priority label was later removed and re-applied, the bot would re-addtriage review— re-triaging an already-triaged issue.wasLabelPreviouslyRemoved()helper that checks the issue's events for a priorunlabeledevent fortriage review, and skip the auto-add in that case.autoLabelBot.ts:394-398) already documented this as the intended behavior; this PR makes the code match.Test plan
yarn jest test/autoLabelBot.test.tspasses (existing test updated to mock the new GET; new test verifies re-add is skipped when anunlabeledevent exists)yarn format --checkpasses