docs: propose issue-assignment requirement for PRs#5386
Open
ocelotl wants to merge 2 commits into
Open
Conversation
Contributor
Author
|
Try out this github action here. |
Requires every PR to reference an assigned issue, closing automatically otherwise. Motivated by the growing volume of AI-generated PRs making review unsustainable for the current pool of maintainers/approvers.
Closes PRs automatically that don't reference an issue via GitHub's closing keywords/manual linking, or whose author isn't assigned to that issue. Draft PRs and dependabot/otelbot are exempt.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This implements the process proposed in #5385: PRs should be tied to an issue that has been discussed and assigned before the PR is opened, so our small group of maintainers and approvers can focus review time on changes the community has already agreed are worth making.
It has two parts: documentation of the process in
CONTRIBUTING.md, and automation that enforces and maintains it.Documentation (
CONTRIBUTING.md)Documents the issue/PR-assignment process: anyone can open an issue, an approver/maintainer assigns it once there is consensus, and every PR must reference an issue its author is assigned to. Draft PRs are welcome for illustrating a proposal while it is still being discussed.
require-assigned-issueworkflowAutomatically closes PRs that don't reference an issue (via closing keywords or manual linking) the author is assigned to, with a comment pointing to the process. Exemptions:
dependabot[bot]andotelbot[bot]are exempt.write,maintainoradminpermission on the repository — may open PRs without a linked, assigned issue.do-not-auto-closelabel keeps any other PR open, but it is a maintainer/approver-only escape hatch: the label is honored only when the person who applied it has write access. When added by anyone else it is automatically removed and has no effect.Uses
pull_request_target(fork PRs need write access to comment/close) and never checks out PR code — it only calls the GitHub API.unassign-stale-issuesworkflowA scheduled workflow (daily) that keeps issue assignments fresh so issues don't get silently reserved forever:
STALE_ASSIGNMENT_WEEKS(default 3 weeks), all assignees are removed and a comment explains why.WARNING_LEAD_WEEKS(default 1 week) before that — i.e. after 2 weeks of inactivity — the assignee is warned with a comment. The warning is posted at most once per stale period (deduped via a hidden marker).envblock so they are easy to change in one place.Test plan
pull_request_target; does not check out PR code)require-assigned-issueagainst test PRs: no linked issue, linked-but-unassigned, linked+assigned, draft vs ready-for-review, maintainer author,do-not-auto-closeapplied by a maintainer vs by a non-maintainerunassign-stale-issuesviaworkflow_dispatchagainst a test issue in the warning window and in the stale windowFixes #5385