ci(pr-policy): hold community PRs with needs:maintainer-decision (ENG-1576)
What
A maintainer holds a community PR with the new needs:maintainer-decision label instead of converting it to draft. While the label is on:
- the daily stale close skips the PR;
/readyrefuses it, andReady for Human Reviewcomes off when the label goes on;- the babysit status script reports a
maintainer-decisionblocker.
Why
We held community PRs whose issue or direction was still undecided by converting them to draft. A draft tells the author that the next step is theirs. Also, the stale sweep ignores draft state, so it still closed these PRs a month after they opened. The label says the next step is ours and keeps the PR open until we decide. #2495, #2168, #1822, and #2346 now carry it in place of draft.
How it works
isStaleskips a PR that carries the label (scripts/pr-policy/rules.ts:273). The 72-hour compliance close does not change: an author still has to fix what the check flagged.staleReasonscounts the label as a reason the review label no longer holds (scripts/review-label/stale.ts:34). The reason tells the author that there is nothing to fix and that a maintainer removes the label. Two callers use it:/readyreports it as a blocker (scripts/review-label/gates.ts:94), and the sweep, which now reads labels (scripts/review-label/sweep.ts:48), removesReady for Human Review.- The sweep runs only when main moves, so
review-label.ymlalso triggers onlabeled. A labeled run removesReady for Human Reviewonly when the PR's live labels includeneeds:maintainer-decision(.github/workflows/review-label.yml:57). Labeled runs use a separate concurrency group (:42). Otherwise the size label a bot adds after each push could replace a queued push run. I did not filter ongithub.event.label.name: two quick label events would then let a skipped run replace the one that had to remove the label. A push run and a labeled run can then both delete the label, so the drop job treats a 404 from the delete as done (:60). pr-status.tsreads labels and reportsmaintainer-decision(.dev/skills/babysit/scripts/pr-status.ts:170). Without this, babysit calls the PRREADYand adds the label, and the sweep removes it again. When this is the only blocker, the verdict staysWAITINGwhile checks run, so--watchkeeps polling. The babysit skill says to keep looping until it is the only blocker, then hand off.CONTRIBUTING.mdexplains the label to contributors and adds it to the/readygates.
DECISION_LABEL is defined in both scripts/pr-policy and scripts/review-label, like needs:compliance, because each workflow does a sparse checkout of its own directory only.
Issue
Refs ENG-1576
Verified
Ran it locally: yes
- Stale sweep, read-only
--dry-runagainst e2e-inc/e2e, with the clock moved to 2026-12-31 by a preload so that the held PRs are a month old. #1822 is absent from both runs because it has an APPROVED review from michal-e2e.
| main | this PR |
|---|---|
| would close #2168, #2346, #2495, and 37 others: 40 PR(s) | would close the same 37: 37 PR(s) |
- Babysit status,
node .dev/skills/babysit/scripts/pr-status.ts <#2495 URL>, read-only:
| main | this PR |
|---|---|
ACTION ['comments:7'] | ACTION ['maintainer-decision', 'comments:7'] |
- Not run live: the
/readygate and thereview-label.ymlchanges.pull_request_targetandissue_commentrun the workflow from main, so these changes take effect only after merge. The unit tests ingates.test.tsandstale.test.tscover the gate and the sweep reason.actionlintpasses on both changed workflows.
š¤ Generated with Claude Code
Summary by CodeRabbit
- Pull Request Handling
- Pull requests marked
needs:maintainer-decisionare excluded from the month-old stale closure and cannot receiveReady for Human Review. - When that label is the only blocker, review status waits for pending checks; once checks finish, the pull request is handed off for a maintainer decision.
- The label does not pause the 72-hour compliance closure.
- Pull requests marked
- Documentation
- Updated contributor guidance to explain how the label affects closure and review readiness.