Repository navigation
feat(issue-pr-loop): finish open PRs before starting new issues - #337
Conversation
Add -MaxOpenPrs (default 8): while that many unparked loop PRs are open, no fresh issue is queued. PRs with unresolved review threads or a changes-requested review newer than the last push are no longer skipped for pending checks.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
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. |
ReviewI found no blocking problems in the script, test or skill changes.
Minor, non-blocking:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8b6ce82747
ℹ️ 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".
| if ($comment -and $comment.createdAt -and ([string]$comment.body).Contains($loopMarker)) { | ||
| $at = ConvertTo-Instant $comment.createdAt | ||
| if ($at -gt $since) { $since = $at } |
There was a problem hiding this comment.
Distinguish disposition comments from other loop comments
When a changes-requested review has no unresolved inline threads, any later comment containing $loopMarker suppresses that feedback, even if the comment does not address it. The draft lifecycle explicitly uses the same marker for Codex review requests and retries, so posting such a request after an outstanding review makes Test-HasNewFeedback return false and excludes the PR while checks remain pending. Advance the disposition timestamp only for an actual response to the feedback, not every loop-authored comment.
AGENTS.md reference: AGENTS.md:L78-L78
Useful? React with 👍 / 👎.
| 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 when counting unresolved feedback
For a PR with more than 100 review threads, this query examines only the first 100 and never requests subsequent thread pages. If those earlier threads are resolved but a later thread remains open, UnresolvedThreads becomes zero and the pending-check filter skips the PR despite actionable feedback. Paginating the outer PR connection does not paginate each nested thread connection; fetch subsequent thread pages or otherwise ensure the unresolved count covers every thread.
AGENTS.md reference: AGENTS.md:L79-L79
Useful? React with 👍 / 👎.
Problem
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.
Change
Ported from thomhurst/TUnit#7423.
scripts/Start-IssuePrLoop.ps1: new-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, stale in-progress claims and closed-children parents still are. The held count appears in the idle survey stats.A PR with unresolved review threads, or an outside
CHANGES_REQUESTEDreview newer than both the head commit and the loop's last reply, is no longer skipped for pending checks: it 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 with no findings is also a comment).Get-PrActivityreads head commit time and review-thread resolution for all open PRs in one paginated GraphQL query (addingcommitstogh pr list --jsonexceeds GitHub's node limit).scripts/Test-IssuePrLoop.ps1: tests for the feedback detection and the open-PR limit..agents/skills/issue-pr-loop/SKILL.md: priority items 3 and 6 describe the same rules. (Kept in this PR because this repository does not allow direct pushes tomain.)Validation:
pwsh -NoProfile -File scripts/Test-IssuePrLoop.ps1passes;Get-PrActivitychecked against this repository's live open PRs. Script-only change, no hot-path cost.