Skip to content

Commit cb39e81

Browse files
committed
Gate external PRs on an assigned, linked issue
Unsolicited pull requests now outnumber issues four to one and almost none are reviewable in the time we have. This adds a workflow that closes an external PR unless its description links an open issue the author is assigned to (or one labeled "help wanted"), and reopens it automatically once a maintainer assigns them. Maintainers, triage-role collaborators, bots and drafts are exempt; reopening a PR or removing the control label is a sticky maintainer override. PRs numbered below 3200 predate the gate and are only evaluated on manual dispatch. The workflow is adapted from PrefectHQ/fastmcp's require-issue-link.yml (itself from langchain), restructured into a single script that always reads PR state live, requires linked issues to be open and in this repo, finds gated PRs via the list API rather than search, and diagnoses a refused reopen instead of guessing. It ships in dry-run: set the PR_GATE_ENFORCE repository variable to "true" to enforce. CONTRIBUTING.md is rewritten around the policy (issues are the contribution; how PRs get in; who we want to hear from), AGENTS.md gains an agent-facing statement of it, and a short repo-level PR template leads with the Fixes line the gate looks for. No-Verification-Needed: workflow and docs only; exercised with a mock harness, actionlint and zizmor
1 parent 6e30452 commit cb39e81

4 files changed

Lines changed: 577 additions & 37 deletions

File tree

.github/pull_request_template.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!--
2+
PRs from outside the maintainer team are auto-closed unless they link an open
3+
issue you are assigned to (or one labeled `help wanted`). If that's not you
4+
yet, file or find the issue first — see CONTRIBUTING.md#how-pull-requests-get-in.
5+
Keep the description short: what changed and why, in your own words.
6+
-->
7+
8+
Fixes #
9+
10+
## What and why
11+
12+
## How it was tested
13+
14+
## Checklist
15+
16+
- [ ] I'm assigned to the linked issue, it's labeled `help wanted`, or I'm exempt (maintainer / trusted contributor)
17+
- [ ] AI assistance, if any, is disclosed above and I can explain every line of this diff
18+
- [ ] Tests added/updated; `uv run --frozen pytest` and `uv run --frozen pyright` pass locally
19+
- [ ] Docs and `docs/migration.md` updated if behaviour or public API changed

0 commit comments

Comments
 (0)