Repository navigation
fix: explain a PR claim conflict on the failed check (Fixes #34) - #35
Merged
Merged
Conversation
…D, Refs #34) On a fork PR the pull_request token is read-only, so the claim bot's label and comment fail with HTTP 403 (obs-rust/obs-studio#5547, Claim bot runs 45288247847 and 45288308289). The check goes red and the reasons appear nowhere the author can see. These tests expect the reasons, with what to do, as one ::error:: annotation and in the job step summary; a clean PR writes neither. Fails now: on_pull_request prints no ::error:: line and writes no step summary. Co-Authored-By: Claude Opus 5.5 <[email protected]>
On a fork PR the pull_request token is read-only, so the claim-conflict label and the explanatory comment fail with HTTP 403 and the author sees only a red check. on_pull_request now also reports every conflict on the check itself: one ::error:: annotation and a "Claim conflict" section in the job step summary, each with the reasons and how to fix the claim. It needs no new token scope and does the same for same-repository PRs, where the comment is still posted as before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
vpacher
commented
Nov 25, 2026
vpacher
left a comment
Member
Author
There was a problem hiding this comment.
Coordinator review: no blocking findings.
- Correctness:
report()runs only whenconflicts()returns reasons, after the best-effort writes, so a 403 on the label or comment can no longer hide the reasons. The exit code is unchanged (1 on conflict). - Injection: the annotation escapes
%, CR and LF, so the PR-body-derived references cannot start a second workflow command. The references themselves are limited toowner/repo#NbyCLOSING. - Scope: no new token permission, no PR code is executed; the reusable workflow still checks out
obs-rust/.github@master, so every repo gets this on merge. - Tests: RED
6e98a23fails two of three new cases; GREEN passes all 261. PR CItestandclaimare green. - Claim: #34 is assigned and
readywith an acceptedClaiming:comment.
Not verified: the annotation and summary on a real fork PR; the next fork PR with a conflict shows them.
This comment has been minimized.
This comment has been minimized.
This was referenced Nov 25, 2026
claim bot: a queued PR event that runs after the merge reports a false conflict on the merged PR
#36
Closed
vpacher
added a commit
that referenced
this pull request
Nov 25, 2026
…36) (#37) * test: a PR event that runs after the merge writes nothing (RED, Refs #36) 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]> * fix: a PR claim check that runs after the merge writes nothing (Fixes #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]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
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 #34
On a fork PR the
pull_requesttoken is read-only, so the claim bot'sclaim-conflictlabel and its explanatory comment fail with HTTP 403. The check goes red and the author sees no reason (obs-rust/obs-studio#5547, Claim bot runs 45288247847 and 45288308289).Change
on_pull_request(workflow/claim_bot.py) now also reports every claim conflict on the check itself, through the newreport():::error title=Claim conflict::annotation with the reasons and how to fix the claim (line breaks escaped as%0A,%as%25);$GITHUB_STEP_SUMMARY), with the same text.The text says what to do: comment
Claiming: <plan>on the issue (it must be Ready), ask a maintainer for/reassign, or change the closing reference toRefs #N, then push or edit the PR to run the check again.This is option 1 of #34. It needs no new token scope and runs no PR code. On same-repository PRs the label and comment are posted as before; the annotation and summary are added there too.
RED → GREEN
6e98a23:tests/test_claim_bot_errors.py, classForkPrExplanation(every write returns HTTP 403). A conflict must give one::errorline and a step summary, both with the reason andClaiming:; a two-reason explanation must stay on one annotation line; a clean PR writes neither. Two of the three fail: no::errorline, no summary.70c3944: all pass.Local checks (PR CI
testruns the same unittest command)Both ruff findings are on master already, in lines this PR does not change.
Not checked end to end: the annotation and summary on a real fork PR. The next fork PR with a claim conflict shows them.
🤖 Generated with Claude Code