Skip to content

ci: gate pull requests on a linked accepted issue #2272

Done

Description

@eric8810

What needs tracking?

Pull requests can merge without a linked issue, or with an issue that has not been accepted. The product rule is that an issue must be accepted (P0/P1/P2) before an implementation PR merges.

Proposal

  • Add scripts/issue-gate.mjs and scripts/issue-gate.test.mjs.
  • Run the gate from a pull_request_target workflow that checks out the base branch only, so the PR cannot modify the trusted gate definition.
  • On pull_request_target, fail the check when no accepted same-repository issue is linked.
  • Use closingIssuesReferences for Fixes/Closes/Resolves and a stripped parser for Refs; ignore fenced code, inline code, HTML comments, blockquotes and cross-repository refs.
  • On issues: labeled/unlabeled, find linked open PRs and create/update issue-gate check runs on their heads, so a priority-label change re-evaluates without a new commit.
  • Treat a PR record as not an issue; report API failures separately from policy failures.
  • After merge, add issue-gate as a required status check. The main ruleset already requires one approving review.

Non-goals

  • No merge automation, label changes or closing.
  • No exemption for routine dependency or typo PRs: AGENTS.md and CONTRIBUTING.md are updated to require a lightweight issue for every PR.

Acceptance

  • A PR with Fixes #<P1 issue> passes; no issue, P3 only, or a PR record fails.
  • Changing the linked issue from P1 to P3 makes the linked PR's check fail without a new commit.
  • The required gate definition comes from main; the PR cannot modify it.
  • Tests cover the parser, same-repository filtering and the accepted-label rule.

Activity

  1. self-assigned this
    on Nov 27, 2026
  2. added
    enhancement
    P1
    on Nov 27, 2026
  3. eric8810 commented on Nov 28, 2026

    @eric8810
    CollaboratorAuthor

    Closed by #2274 (merged 05:49Z). The issue-gate workflow and script are on main. Activating the required check on main remains a repository settings action outside this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions