Skip to content

Let maintainers exempt a pull request from the PR gate's linked-issue check - #6200

Merged
ymichael merged 1 commit into
mainfrom
bb/implement-pr-override-functionality-thr_iegshhdusf
Oct 24, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/implement-pr-override-functionality-thr_iegshhdusf

Conversation

@ymichael

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Maintainers had no way to exempt a pull request from the PR gate's linked-issue requirement (#6189). Reopening one by hand sends a reopened event, the gate runs again, finds no linked issue, and closes it again. #6198 is an example.

Separately, GitHub reports maintainer_can_modify: false on every closed pull request. #6198 had MAINTAINER_CAN_MODIFY: true in its opened run (40040917882) and reports false now, and every closed fork PR in the repo shows false. When the gate re-checked a closed needs-issue PR after an edit, it read that stale value as "maintainer edits off" and wouldn't reopen it. So "this pull request reopens on its own once you save the description" probably never worked for PRs from personal forks.

What changed

.github/workflows/pr-gate.yml:

  • skip-issue-check label: when the label is present, the linked-issue check is skipped. The gate now also runs on labeled events. Adding this label to a closed needs-issue PR goes through the same re-check as editing its description: the gate reopens the PR if the author is approved and maintainer edits were on. Other labels are ignored. Only accounts with triage access or higher can add labels, so contributors can't exempt themselves.
  • needs-maintainer-edits label: when the gate closes a PR because "Allow edits by maintainers" is off, it now adds this label. The re-check after an edit or label reads this label instead of the stale maintainer_can_modify. On opened and reopened, the gate still reads maintainer_can_modify as before. PRs closed for edits-off before this change don't have the label, so a re-check could reopen one of them.

CONTRIBUTING.md: documents the maintainer exemption under "Linked Issue".

I created the skip-issue-check label in the repo.

How you verified

I pulled the run script out of the workflow, checked it with bash -n, and ran it against a stubbed gh in eight scenarios. Each produced the expected gh pr calls:

  • opened with no issue → closed with needs-issue
  • skip-issue-check added to a closed PR (with the stale maintainer_can_modify=false) → reopened
  • some other label added → no action
  • description edited with Fixes #N on a closed PR (stale false) → reopened
  • skip-issue-check added, but the PR has needs-maintainer-edits → stays closed
  • reopened by hand with skip-issue-check → stays open
  • skip-issue-check added, but the author is not approved → stays closed
  • opened with edits off → closed with needs-maintainer-edits

None of this has run on real GitHub events yet. pull_request_target takes effect only after merge, and #6198 is the first real case.

AGENT GENERATED

🤖 Generated with Claude Code

… check

A skip-issue-check label skips the linked-issue requirement. Adding it to a
closed needs-issue pull request reopens it when the other checks pass.

Closed pull requests report maintainer_can_modify as false, so the re-check
on edit or label now reads a needs-maintainer-edits label that the gate adds
when it closes for that reason.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ymichael
ymichael merged commit c22f4db into main Oct 24, 2026
49 checks passed
@ymichael
ymichael deleted the bb/implement-pr-override-functionality-thr_iegshhdusf branch October 24, 2026 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant