Gate draft PRs too and rewrite the auto-close comment

Merged
MA
2mo ago
+38-24

Follow-up to #3291. Two changes to the PR intake gate:

Drafts are gated too. The gate skipped drafts until they were marked ready for review, which meant an unlinked PR could sit open indefinitely as a draft. Drafts now go through the same rule as everything else. The ready_for_review trigger stays so drafts opened before this change are still evaluated when they flip.

The auto-close comment is rewritten. The old text implied the PR would be reopened ("this one will be reopened", "nothing more you need to do") and packed everything into two dense paragraphs. The new one says what happened and why in one sentence, lists what the author can actually do for each situation (already assigned / no issue yet / issue exists but not assigned), and is upfront that review capacity for community PRs is very limited and most auto-closed PRs stay closed. When the PR is a draft, the opener adds one sentence explaining why it's closed before being marked ready (so the author doesn't put more time in only to have it closed then).

Motivation and Context

Drafts were being used to keep unlinked PRs visible past the gate, and the closing comment was setting expectations we can't meet.

How Has This Been Tested?

node --test .github/scripts/pr_intake_gate.test.js โ€” the two draft scenarios now expect a close; 29/29 pass. Both comment variants rendered and read through by hand.

Breaking Changes

None for SDK users. External draft PRs without an assigned, linked issue are now closed on open/edit rather than on ready-for-review.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Repository automation

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

Already-closed PRs keep the old comment until their next gate event (edit, assignment, label change). Currently-open external drafts are evaluated on their next event, or by hand with gh workflow run require-linked-issue.yml -f pr_number=N.

AI Disclaimer