Repository navigation
Ignore cross-repository pull requests when ending a Claim - #1858
Merged
Merged
Conversation
A fork pull request can reuse the Issue branch name. The TypeScript prototype's Claim ending treated any listed pull request with that name as this repository's work, so a run that published nothing left the issue in-progress. Count a row only when isCrossRepository is false.
gh pr list returns 30 rows unless --limit is set. A page of fork pull requests hid a later same-repository pull request, so Claim ending released the Claim. Ask for 1000 rows, as Delivery already does.
…request gh pr list stops at --limit and does not say whether more rows exist. Claim ending treated a full page of fork pull requests as proof that this repository had none, and released the Claim while a same-repository pull request could sit past that page. A full page now fails the ending and leaves the Claim in place.
Merged
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.
Summary
A fork pull request can reuse the Issue branch name. Claim ending counted every listed row as this repository's pull request, so a Ticket run that published nothing left the issue
in-progress. A row counts only whenisCrossRepositoryis false.gh pr listreturns 30 rows unless--limitis set, so the list asks for 1000, the same bound Delivery already uses. A shorter page of fork rows cannot hide a later same-repository pull request. A full page does not prove this repository has none, so Claim ending leaves the Claim in place.Seam: Ticket run Claim ending, observed as the issue's labels after a session that publishes nothing.
Evidence
Execution evidence
bun test tests/ticket.test.ts -t "Claim ending counts"fromprototypes/typescript, on the unfilteredClaim.endthat askedgh pr listfornumberonly.The page-limit tests, run before
--limit 1000, failed the same way the review described.gh pr list --helpreports-L, --limitdefault 30.After:
bun test tests/ticket.test.ts -t "Claim ending counts|same-repository pull request|nothing on origin"fromprototypes/typescript.A full page of fork rows, with a same-repository pull request past
--limit, released the Claim. After the guard,bun test tests/ticket.test.ts -t "past the list limit|Claim ending counts|same-repository pull request|nothing on origin"passed, includinga same-repository pull request past the list limit still keeps the Claim.bun test tests/ticket.test.tspassed: 51 tests, 0 fail.bun run typecheck(tsc --noEmit) passed. The earlier fullbun testfromprototypes/typescriptpassed: 61 tests, 0 fail.Visual evidence
This change does not touch rendered UI, HTML, CSS, templates, or visual layout. No browser captures.
Merge Danger
Door: two-way
The TypeScript prototype is not the Rust executable. Reverting this branch restores the previous Claim ending.
Blast Radius: prototype Claim ending
A Ticket run in this prototype that publishes nothing releases its Claim when the only pull requests for the Issue branch are from a fork and that list is not full. A same-repository pull request, including one past gh's default page of 30, still keeps the Claim. A full page of fork rows keeps it too. The Rust Claim ending already filters
isCrossRepositoryinpull_requests_with_head_prefix.Unaddressed findings
Standards
Claim.endandDelivery.findPRboth list pull requests and skip rows whoseisCrossRepositoryis true. Extracting one helper was not done.Claim.end(prototypes/typescript/src/claim.ts) only needs whether any row hasisCrossRepository === false, then restores labels in the existing empty-list block.findPR(prototypes/typescript/src/delivery.ts) collects numbers, rejects more than one with "Ambiguous pull request for Issue branch", and views that pull request, with the error "Invalid pull request number". Those are different decisions. The behaviour the finding's test showed, a default page of fork rows hiding a same-repository pull request, is fixed by--limit 1000on Claim ending'sgh pr list. That test passes:bun test tests/ticket.test.ts -t "default page of fork pull requests".Spec
None.
Security
None.
The review read every changed file:
prototypes/typescript/README.md,prototypes/typescript/src/claim.ts, andprototypes/typescript/tests/ticket.test.ts. No changed file was left unread.Closes #1857
Built with grok grok 1.0.70 (f50904eaee6c) [stable] · default model · default effort
Security review outcome
No unaddressed introduced findings.