Create script that flags PRs for triage, the same way as for a2ui.#990
Create script that flags PRs for triage, the same way as for a2ui.#990polina-c wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the issue filing instructions in CONTRIBUTING.md and introduces a new PR triage script (scripts/triage.mjs) to automate the reconciliation of the 'status: needs-triage' label. Feedback on the triage script highlights a high-severity issue where PR reviews and inline comments are missed, potentially causing false positives. Additionally, suggestions were made to handle deleted users correctly in the bot check and to optimize the retrieval of the last human contribution using Array.prototype.find() since comments are fetched in descending order.
Package publishingIf you have publishing permissions, you can use the links below to publish the changes after merging this PR.
Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation. |
What
Adds an automation that flags stale, externally-authored pull requests with the
status: needs-triagelabel, mirroring the triage setup used in the a2ui repo.Why
Makes PRs that need maintainer attention easy to find. The label is fully owned by the automation and reconciled on every run — added to PRs that match the rule and removed once they no longer do.
Rule
A PR is flagged when it is opened by an external contributor (maintainers manage their own PRs) and is stale: no internal member has responded for more than 1 day after the author's last contribution. Staleness is measured from the last human contribution — a comment, review, inline review comment, or the opening post if there are none — rather than
updated_at, so the bot's own label edits never reset the clock.Changes
tool/triage.mjs(new) — the reconciliation logic. Gathers each PR's contributions from three endpoints (issue comments, formal reviews, inline review comments) so a maintainer responding via a review or inline comment counts as an answer. Fetches in bounded concurrent batches, falls back gracefully on per-source errors, and re-reads live labels before mutating to avoid double-labeling from overlapping runs..github/workflows/triage.yaml(new) — runs the script daily (15:00 UTC) and on the PR events that can change flag state (pull_request_target,issue_comment,pull_request_review,pull_request_review_comment), plus manual dispatch.CONTRIBUTING.md— note that issues are filed against the A2UI project with thecomponent: genuilabel.