Repository navigation
fix: a PR claim check that runs after the merge writes nothing (Fixes #36) - #37
Merged
Merged
Conversation
) An `edited` event queued before #35 merged ran after the merge had closed #34 (Claim bot run 45615324507). It read `open` from the event payload, saw #34 closed, labelled the merged PR claim-conflict, posted the conflict comment and failed. This test merges the PR and closes its issue before the queued event runs and expects no write and a pass. Fails now: on_pull_request returns False and labels the merged PR. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…36) on_pull_request took the PR's open state from the event payload. A run that waited for a runner can start after the merge, which has already closed the issues the PR fixes, and then reported a false "is closed" conflict on the merged PR (#35, run 45615324507). It now reads the PR's live state first and passes without a write when the PR is closed. The 403 tests mock the PR object, so they now give it closed=False. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This comment has been minimized.
This comment has been minimized.
vpacher
commented
Nov 25, 2026
vpacher
left a comment
Member
Author
There was a problem hiding this comment.
Coordinator review: no blocking findings.
- Correctness: the live PR state is read before
conflicts(); a closed or merged PR passes with no write. In productionissue()readsrepos/{repo}/issues/{n}over REST (not throughghcache), where a merged PR isclosed, so the guard sees the merge. - Cost: the same
gh.issue()call ran in every run before, only later; no extra API call. - Tests: RED
cb8ab1creproduces the #35 timeline (event built, then merge and issue close, then the check) and fails; GREEN passes all 262. The 403 mocks getclosed=False. PR CItestandclaimare green. - Claim: #36 is assigned and
readywith an acceptedClaiming:comment.
The first claim run failed correctly: the description's prose "closed #34" was a closing keyword. Reworded; the annotation from #35 named the cause.
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 #36
The PR claim check took the PR's open state from the event payload. Claim bot run 45615324507 (
pull_request: edited, queued at 12:36:08) started after #35 had merged at 12:36:20, which also shut issue 34. It reportedobs-rust/.github#34 is closed, labelled the merged PRclaim-conflict, posted the conflict comment and failed. (#35 cleaned up by hand: label removed, comment hidden as outdated.)Change
on_pull_request(workflow/claim_bot.py) now reads the PR's live issue object before it checks conflicts. When the PR is closed (merged or closed), it logs that and passes without a write. The read already happened in every run, only later, so the change adds no API call.RED → GREEN
cb8ab1c:tests/test_pr_claims.py,test_an_event_that_runs_after_the_merge_writes_nothing. It builds aneditedevent, then merges the PR and closes its issue before the check runs. It fails: the check returns False and labels the merged PR.1cc31bd: passes. The 403 tests intests/test_claim_bot_errors.pymock the PR object, so they now setclosed=False.Local checks
ruff checkreports only UP017 inmain, which is on master already.Note for merging: do not edit this PR right before the merge. With this fix in master that is harmless, but this PR's own claim check still runs the old code until it merges.
🤖 Generated with Claude Code