ci(pr-policy): hold community PRs with needs:maintainer-decision (ENG-1576)

Merged
KD
3d ago
+105-30

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;
  • /ready refuses it, and Ready for Human Review comes off when the label goes on;
  • the babysit status script reports a maintainer-decision blocker.

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

  1. isStale skips 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.
  2. staleReasons counts 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: /ready reports it as a blocker (scripts/review-label/gates.ts:94), and the sweep, which now reads labels (scripts/review-label/sweep.ts:48), removes Ready for Human Review.
  3. The sweep runs only when main moves, so review-label.yml also triggers on labeled. A labeled run removes Ready for Human Review only when the PR's live labels include needs: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 on github.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).
  4. pr-status.ts reads labels and reports maintainer-decision (.dev/skills/babysit/scripts/pr-status.ts:170). Without this, babysit calls the PR READY and adds the label, and the sweep removes it again. When this is the only blocker, the verdict stays WAITING while checks run, so --watch keeps polling. The babysit skill says to keep looping until it is the only blocker, then hand off.
  5. CONTRIBUTING.md explains the label to contributors and adds it to the /ready gates.

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-run against 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.
mainthis 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:
mainthis PR
ACTION ['comments:7']ACTION ['maintainer-decision', 'comments:7']
  • Not run live: the /ready gate and the review-label.yml changes. pull_request_target and issue_comment run the workflow from main, so these changes take effect only after merge. The unit tests in gates.test.ts and stale.test.ts cover the gate and the sweep reason. actionlint passes on both changed workflows.

šŸ¤– Generated with Claude Code

Summary by CodeRabbit

  • Pull Request Handling
    • Pull requests marked needs:maintainer-decision are excluded from the month-old stale closure and cannot receive Ready 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.
  • Documentation
    • Updated contributor guidance to explain how the label affects closure and review readiness.