Repository navigation
fix(issue-pr-loop): finish open PRs before claiming new issues - #623
Conversation
Workers skipped every PR whose checks were still running and started new issues instead, so open PRs piled up and conflicts became likelier. - Add -MaxOpenPrs (default 8, 0 = no limit): while that many unparked loop PRs are open, no fresh issue is queued; stranded branches, stale claims and finished parents still are. Survey stats count the held issues. - A PR with an unresolved review thread, or an outside changes-requested review newer than the last push and the loop's last reply, is not skipped for pending checks and ranks with failed-CI PRs. - Read head commit time and review threads with one paginated GraphQL query (gh pr list --json commits exceeds GitHub's node limit). Ported from thomhurst/TUnit#7423.
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. CodeRabbit Verify
|
|
Review of #623 (draft, current head) No blocking issues found. The change does what the description says, and the tests exercise the new paths. What I checked:
Non-blocking suggestions:
Performance validation doesn't apply here, because this is tooling script code and not the library. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b39bef6f14
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| function Get-PrActivity { | ||
| $query = 'query($owner: String!, $name: String!, $cursor: String) { repository(owner: $owner, name: $name) { ' + | ||
| 'pullRequests(states: OPEN, first: 100, after: $cursor) { pageInfo { hasNextPage endCursor } ' + | ||
| 'nodes { number commits(last: 1) { nodes { commit { committedDate } } } reviewThreads(first: 100) { nodes { isResolved } } } } } }' |
There was a problem hiding this comment.
Paginate review threads as well as pull requests
For a PR with more than 100 review threads, this query examines only the first 100, including resolved threads; the pagination loop advances only the outer pullRequests connection. If those first threads are resolved but a later thread is unresolved, UnresolvedThreads incorrectly becomes zero. While checks are pending, Get-Candidates then skips that PR despite its actionable feedback; once checks finish, it can incorrectly classify the PR as a light merge candidate. Fetch subsequent thread pages before deciding whether feedback remains. This also preserves the repository requirement to check and disposition review-thread findings.
AGENTS.md reference: AGENTS.md:L39-L40
Useful? React with 👍 / 👎.
Loop workers skipped every PR whose checks were still running and started new issues instead, so open PRs piled up and the chance of conflicts grew.
-MaxOpenPrs(default 8,0= no limit): while that many of the loop's open PRs lackneeds-human/on-hold, no fresh issue is queued. Stranded branches, stalein-progressclaims, and parents with all sub-issues closed still are. Survey stats report the held count.CHANGES_REQUESTEDreview newer than both the head commit and the loop's last reply, is no longer skipped for pending checks, ranks with failed-CI PRs, is not a light unit, and gets a hint to handle the feedback now. Conversation comments do not count (a review saying "no blocking issues" is also a comment).gh pr list --json commitsexceeds GitHub's node limit.The matching SKILL.md priority-list change went to
mainin 8884eec.Ported from thomhurst/TUnit#7423.
Validation:
pwsh -NoProfile -File scripts/Test-IssuePrLoop.ps1passes; new tests cover the feedback and open-PR-limit paths (checked that they fail when the logic is removed).-DryRun -MaxUnits 1surveys the live repo successfully.