Skip to content

claim bot: a closing keyword only in the PR title does not link the issue #38

Done

Description

@vpacher

Problem

GitHub reads closing keywords (Fixes #N, Closes #N, Resolves #N) only in the PR body. A keyword in the PR title does not link the issue, so the merge does not close it. The squash commit on master has the keyword in its subject, but commits that land through the merge queue did not close the issues either.

On 2026-11-30 three merged obs-studio PRs named their issue only in the title, and the issues stayed open after the merge:

PR Issue Title Body
obs-rust/obs-studio#5982 obs-rust/obs-studio#5945 (Fixes obs-rust/obs-studio#5945) no reference
obs-rust/obs-studio#5969 obs-rust/obs-studio#4455 (Fixes obs-rust/obs-studio#4455) bare (obs-rust/obs-studio#4455)
obs-rust/obs-studio#5987 obs-rust/obs-studio#5906 (obs-rust/obs-studio#5906) no keyword

For each PR, closingIssuesReferences is empty. A maintainer closed the three issues by hand on 2026-12-01.

The same gap also affects the claim check. pr_claims.references() reads only pr["body"], so a PR with Fixes #N only in its title skips the claim-conflict check for issue N. A PR could close (or try to close) an issue that another worker has claimed, and nothing would flag it (the obs-rust/obs-studio#3307 case).

The rule is already written down: obs-studio .github/pull_request_template.md starts with Fixes #, and docs/rust-port/coordination.md §4 says "Name every issue in the PR body". Nothing enforces it.

Proposed fix

In the claim bot's PR handler (it already runs on opened, edited, synchronize, ready_for_review and reopened):

  1. Find the closing references in the PR title with the same CLOSING pattern.
  2. If the title has a reference that the body does not have, post (or update) one bot comment with a marker, for example: "The title says Fixes #N, but GitHub only links issues from the PR body. Add Fixes #N to the body (or Refs #N if this PR does not complete the issue)."
  3. Remove the comment when the body is fixed (the edited event).
  4. Optional: also run the claim-conflict check for the title references, so a title-only keyword cannot skip it.

A comment, not a failing check: the claim bot is not a required check, and the fix is a one-line body edit.

A bare (#N) in the title (obs-rust/obs-studio#5987) has no keyword, so this rule does not catch it. That case needs a human to say whether the PR completes the issue. The coordinator can look at it when it queues the PR.

Tests

  • Title ... (Fixes #12) with an empty body: one comment that names coordinator skill: resolve and verify a requeue #12.
  • Title and body both have Fixes #12: no comment.
  • Title Fixes #12, body Refs #12: no comment (the author chose Refs).
  • Title Fixes #12, body edited to add Fixes #12: the comment is removed.
  • A keyword in backticks in the title (`Fixes #12`): ignored, like in the body.

Out of scope

  • Closing issues after the merge: the coordinator can still close a stalled one (obs-coordinator §4).
  • Changing how GitHub reads keywords.

Activity

  1. vpacher commented on Dec 1, 2026

    @vpacher
    MemberAuthor

    Claiming: title-only closing keywords in the PR claim check.

    1. RED: tests/test_pr_claims.py cases from the issue (title-only keyword gets one comment; body Fixes or Refs gets none; a fixed body removes the comment; backticked title ignored; a title-only reference gets the claim check).
    2. GREEN: pr_claims.title_only() + a second marker comment in claim_bot.on_pull_request, a delete_comment action in GhBackend and the sim, and the WORKFLOW.md paragraph.

    One PR, today.

  2. added
    ready
    on Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ready

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions