Skip to content

Improve script that labels items for triage. - #2365

Open
polina-c wants to merge 2 commits into
mainfrom
mjs
Open

Improve script that labels items for triage.#2365
polina-c wants to merge 2 commits into
mainfrom
mjs

Conversation

@polina-c

@polina-c polina-c commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Updates scripts/triage.mjs to match the specification in its header comment, and tightens the language of that specification.

What changed in the spec

  1. status: waiting-for-author-response clears on a comment from any external contributor, not only from the item's author. Comments from the team never clear it — the team is the side that asked the question.
  2. Rule 1e is gone: a P2 is no longer flagged after 90 days of silence. Only P0 and P1 are watched for staleness.
  3. The query is not trusted on its own. GitHub's index lags behind reality, so an item is re-read and re-checked before any label is touched.

Code

  • authorHasResponded(item, contributions, waitingSince)externalHasResponded(contributions, waitingSince), which matches any non-maintainer, non-bot contribution at or after the labeling. item is gone from the signature: authorship no longer factors into the rule.
  • STALE_DAYS drops its P2: 90 entry.
  • The mutation path already re-read each item to recheck its labels, but never confirmed it was still open — so a lagging index could get a closed item labeled. It now skips, and logs, anything the live read reports as not open.
  • docs/contributing/triage.md still described the old author-only rule, which contradicted the updated spec.

Tests

node --test scripts/*.test.mjs — 58 tests, up from 51, all passing.

  • externalHasResponded: a reply from an external contributor who is not the author clears the label; maintainer replies (OWNER/MEMBER/COLLABORATOR) and bot replies do not.
  • Staleness: STALE_DAYS keys pinned to P0/P1, plus an explicit "never flags a P2, however old".
  • Reconciliation: an item closed between the listing and the mutation gets no label calls at all, including no waiting-label clear.

Each clause of the new rule was mutation-tested: reverting the maintainer exclusion, the bot exclusion, the widening past the author, or the open-state guard fails exactly the test that pins it, and nothing else.

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request updates the triage automation script and documentation. The 'status: waiting-for-author-response' label logic has been modified to clear when any external contributor responds, rather than only the original author, while ignoring maintainer and bot replies. Additionally, P2 issues are no longer flagged for staleness, and the script now re-verifies that an issue is still open before applying label changes to handle lagging GitHub indices. Corresponding unit tests have been updated and added to cover these changes. There are no review comments, so I have no feedback to provide.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant