Conversation
… bot The pending-ci-rerun label is an inactivity marker applied by policy automation, not evidence that CI is running. Stop routing every labeled PR to WaitingOnCI ahead of review state. Instead, record ci-rerun-pending as an informational reason on every labeled classification and only hold an otherwise ReadyToMerge PR in WaitingOnCI until CI is rerun. Add dotnet-policy-service to knownBotPatterns so its boilerplate comments no longer require non-author discussion verification or count as human community responses. Complete bot-only discussion evidence now yields no-response. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation matches the documented policy and provides comprehensive regression coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Updates PR attention routing so stale-CI labels gate merging without hiding review work, while recognizing policy automation correctly.
Changes:
- Applies
pending-ci-rerunafter normal classification. - Treats policy-service comments as automation.
- Adds regression fixtures and coverage.
| File | Description |
|---|---|
scripts/PRAttentionQueue.psm1 |
Revises routing and response evidence. |
presets.json |
Registers the policy bot. |
SKILL.md |
Documents updated semantics. |
tests/Test-PRAttentionQueue.ps1 |
Tests routing and bot handling. |
tests/Test-MergeStateRefresh.ps1 |
Tests refreshed merge-state gating. |
tests/fixtures/rerun-label-pull-requests.json |
Adds rerun-label scenarios. |
tests/fixtures/policy-bot-pull-requests.json |
Adds policy-bot scenarios. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
This branch has not been deployed
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.
PR attention queue: treat pending-ci-rerun as a merge gate and dotnet-policy-service as a bot
Treat pending-ci-rerun as a merge gate; recognize dotnet-policy-service as a bot
Description
Why
pending-ci-rerunis a merge gate, not review routing. The policy bot addspending-ci-rerunto open, non-draft PRs after 7 days of inactivity and comments "please rerun validation before merging" (.github/policies/resourceManagement.yml:151-170). Pushes don't remove the label. Only an exact/azp runcomment from a user with write access removes it (:678-690). Across the repo, 249 of 276 labeled open PRs areREVIEW_REQUIRED. The classifier sent every labeled PR toWaitingOnCIbefore it checked review state, so PRs that needed review or rescue were hidden there.dotnet-policy-servicewas treated as a human. GraphQL returns the bare logindotnet-policy-service, without[bot], soTest-IsBotLoginmissed it. Its boilerplate comments wrongly triggerednon-author-discussion-requires-verification, which kept PRs out of the review digest. They could also count as a human response in the community inbox, which hid neglected PRs.What changed
All changes are under
.github/skills/pr-attention-queue/:scripts/PRAttentionQueue.psm1elseif ($ciRerunPending)classifier branch that sent every labeled PR toWaitingOnCI.ci-rerun-pendingonce as an informational reason. If the PR would otherwise beReadyToMerge, it moves toWaitingOnCI, the next actor becomesCI/automation, and it gets the blockerCI must be rerun before merge.These PRs end upnot-candidatefor merge, because onlyReadyToMergeitems become candidates.ci-rerun-pendingnow also appears onDraftandExcluded(bot-authored) items.ci-rerun-pendingnow describes the label as an inactivity marker that requires CI revalidation before merge. It does not mean CI is running.Get-ResponseEvidence: a community PR whose only comments are from bots now getsno-responseinstead ofunknown. This requires complete, untruncated evidence in which every collected comment is from a bot. Without this, adding the bot pattern alone left bot-only PRs atunknown. Incomplete or truncated evidence still givesunknown. Comments from other known bots, such asgithub-actions, also no longer preventno-response.presets.json: addeddotnet-policy-servicetoknownBotPatterns.pendingCiLabelsis unchanged. Author comments such as@dotnet-policy-service agreestay author comments, because comments are attributed by the commenter's login, not by text in the body.SKILL.md: updated the precedence rules and the response-evidence section to match.Test-PRAttentionQueue.ps1:WaitingOnCI, the merge-gate blocker, theapprovedreason,CI/automation,not-candidate, and no merge verification.* NO MERGE *plus the label) staysNeedsRescueand keeps the informational reason.fixtures/rerun-label-pull-requests.json(PRs 301-310). Each PR has the label plus one other condition: review requested, never reviewed,CHANGES_REQUESTED, failed CI, draft,CONFLICTING, approved +BEHIND, stale past the rescue threshold, bot-authored, or a design gate. Each keeps its normal bucket, next actor and reason, has exactly oneci-rerun-pending, and stays out of merge candidacy.fixtures/policy-bot-pull-requests.json(PRs 401-403):no-response.@dotnet-policy-service agreestays an author comment.unknown.Test-MergeStateRefresh.ps1: a labeled PR whose merge state refreshes fromUNKNOWNtoCLEANis still held by the merge gate.Validation
With the fix:
pwsh .github/skills/pr-attention-queue/tests/Test-PRAttentionQueue.ps1All PR attention queue tests passed.pwsh .github/skills/pr-attention-queue/tests/Test-MergeEligibility.ps1All merge eligibility cases passed.pwsh .github/skills/pr-attention-queue/tests/Test-MergeStateRefresh.ps1Merge state refresh: 18/18 passed; 0 failed.Without the fix (
PRAttentionQueue.psm1andpresets.jsonreverted, new tests kept):Test-PRAttentionQueue.ps1exits 1 atA merge-ready PR with a rerun label must explain the merge gate.automationattribution, digest membership,no-response, no recorded human response, and truncated evidence stayingunknown.Test-MergeStateRefresh.ps1exits 1 withFAIL regression pending-ci-rerun: Refreshed CLEAN state must preserve approval and the CI rerun merge gate.presets.jsonreverted,Test-PRAttentionQueue.ps1exits 1 atA policy-bot-only discussion must be clear.Live read-only Blazor run:
pwsh .github/skills/pr-attention-queue/scripts/Get-PRAttentionQueue.ps1 -Preset blazor -OutputFormat Json -DisablePersonalInbox. It returnedquery.complete = truewith 404/404 open PRs scanned and 139 matched.WaitingOnCI,CI/automation,not-candidate, with blockerCI must be rerun before merge.Out of scope
__typename, instead of login patterns, would be a possible follow-up.Fixes: N/A (no tracking issue)