Skip to content

autoLabelBot: don't re-add triage review if already triaged#8095

Open
malfet wants to merge 3 commits into
mainfrom
malfet/dont-hipri-twice
Open

autoLabelBot: don't re-add triage review if already triaged#8095
malfet wants to merge 3 commits into
mainfrom
malfet/dont-hipri-twice

Conversation

@malfet

@malfet malfet commented May 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • When high priority or critical is applied, the bot adds triage review. Previously, if a triager removed triage review and the priority label was later removed and re-applied, the bot would re-add triage review — re-triaging an already-triaged issue.
  • Added wasLabelPreviouslyRemoved() helper that checks the issue's events for a prior unlabeled event for triage review, and skip the auto-add in that case.
  • The comment at the call site (autoLabelBot.ts:394-398) already documented this as the intended behavior; this PR makes the code match.

Test plan

  • yarn jest test/autoLabelBot.test.ts passes (existing test updated to mock the new GET; new test verifies re-add is skipped when an unlabeled event exists)
  • yarn format --check passes

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.
@vercel

vercel Bot commented May 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
torchci Ready Ready Preview May 18, 2026 6:04pm

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 18, 2026
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.
label: { name: "triage review" },
created_at: recent,
},
]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should there be a post expected here to check that the label's not there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants