Repository navigation
claim bot: comment on a closing keyword only in the PR title (Fixes #38) - #39
Merged
Merged
Conversation
GitHub links issues only from closing keywords in the PR body. obs-rust/obs-studio#5982, #5969 and #5987 named their issue only in the title, the issues stayed open after the merge, and the claim check never saw the reference. The new cases expect one claim-bot comment for a title-only keyword, none when the body names the issue with Fixes or Refs, the comment removed once the body is fixed, and the claim check run on a title-only reference. A delete_comment action is expected in GhBackend. RED: 4 failures, 1 error (KeyError: 'delete_comment'). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
) GitHub links issues only from closing keywords in the PR body. When the title has one for an issue that the body names with neither a closing keyword nor Refs, the claim bot now posts one comment (marker pr-title-keyword) and a check warning that ask for the body line, and deletes the comment when the body is fixed or names other issues. It is a note, not a conflict: it never fails the check. But a title-only reference now goes through the claim check, so it cannot skip it. - pr_claims: title_only(), title_note(), REFS; conflicts() checks the title-only references too. - claim_bot: title_note_actions() in on_pull_request. - gh + sim: a delete_comment action (a 404 counts as done). - WORKFLOW.md: the rule. GREEN: uv run -m unittest discover -s tests -t . -> Ran 269 tests, OK. No new ruff findings in the touched files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… Refs #38) GitHub titles a revert 'Revert "<original title>"'. The original's closing keyword names an issue that the revert does not close and that is usually closed, so the title-only claim check would flag the revert with claim-conflict, and the coordinator would not queue it. Also tests that a docs-only (exempt) PR still gets the note and that a changed title replaces the note instead of adding a second one. The revert test fails without the guard. Ran 272 tests, OK. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes #38
GitHub links issues only from closing keywords in the PR body. A keyword in the title links nothing, so the merge does not close the issue, and the claim check (which read only the body) never saw the reference. In obs-rust/obs-studio this happened 4 times in the last 500 merged PRs (since 2026-11-18): 5982, 5969, 6032 and 5854. The issues of 5982 and 5969 were closed by hand on 2026-12-01, the issue of 6032 by its author. The issue of 5854 is still open.
Change
workflow/pr_claims.py:title_only(repo, pr)returns the closing references in the title that the body names with neither a closing keyword norRefs(newREFSpattern). A bare(#N)in the body links nothing, so it does not count. A revert title (Revert "...") returns nothing: the original's keyword names an issue the revert does not close.conflicts()now checks the title-only references too.workflow/claim_bot.py:title_note_actions()keeps one comment (markerpr-title-keyword) while a title-only reference exists. It asks for the body line, prints the same text as a::warningfor fork PRs (their token cannot comment), and deletes the comment when the body is fixed or the title names other issues. The note never fails the check. A conflict on a title-only reference does, as for a body reference.workflow/gh.py,workflow/sim.py: adelete_commentaction. HTTP 404 counts as done.WORKFLOW.md: the rule, next to the PR claim check.The issue called the claim check on title references optional. I made it unconditional, because a title-only keyword shows the author means to close the issue, and skipping the check is the gap behind obs-rust/obs-studio#3307. It can add
claim-conflictto a PR in flight. The dry run below found none.RED → GREEN
1c3be24:tests/test_pr_claims.py, classTitleOnlyClosingKeyword(shared setup moved to aPrEventsmixin) andtest_delete_comment_uses_the_issues_rest_permission. 4 failures and 1 error (KeyError: 'delete_comment').e1e658b: all pass.c638ecb: the revert guard, plus tests for an exempt docs-only PR (it still gets the note) and a changed title (the note is replaced, not added). The revert test fails without the guard.Dry run on live PRs
title_only()over every open PR in the non-archived obs-rust repos (85 PRs on 2026-12-01): 0 hits, so merging adds no note and no label to a PR in flight. The same function over the last 500 merged obs-studio PRs finds exactly the 4 PRs above.Local checks
ruff checkon the touched files gives the same 13 findings as on master, and none new.🤖 Generated with Claude Code