fix: exclude already-approved PRs from review digest#30
Closed
Ilia wants to merge 1 commit into
Closed
Conversation
PRs with at least one APPROVED review were appearing in the digest because reviewRequests clears once a reviewer submits — the workflow had no way to distinguish "never reviewed" from "reviewed and approved, waiting to be merged". Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
6a07cdd to
be579a1
Compare
JP-Ellis
reviewed
Jun 9, 2026
| ([.reviewRequests.nodes[] | select(.requestedReviewer.__typename == "User" or .requestedReviewer.__typename == "Team")] | length) == 0 and | ||
| (.commits.nodes[0].commit.statusCheckRollup.state == "SUCCESS") | ||
| (.commits.nodes[0].commit.statusCheckRollup.state == "SUCCESS") and | ||
| (.reviews.nodes | map(select(.state == "APPROVED")) | length) == 0 |
Member
There was a problem hiding this comment.
I don't think this will work for PRs in repos configured to dismiss reviews if there's a subsequent change to the PR, which then means that the PR won't appear in the notification for re-review.
JP-Ellis
reviewed
Jun 9, 2026
| @@ -100,7 +103,8 @@ jobs: | |||
| # Bot reviewers (e.g. Copilot) are intentionally ignored — a PR with | |||
| # only a bot reviewer still needs a human to pick it up. | |||
| ([.reviewRequests.nodes[] | select(.requestedReviewer.__typename == "User" or .requestedReviewer.__typename == "Team")] | length) == 0 and | |||
Member
There was a problem hiding this comment.
Ah, I didn't see your update in your last PR.
So for the purposes of this notification, we ignore PRs that have a human review request, but still need a review? Wouldn't it be simpler to just disregard the number of requests entirely? Afterall, the notification is just for "PR needing a review" (which would imply irrespective of how many review requests it has)
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
reviewRequestsonce a reviewer submits — the workflow couldn't distinguish "never reviewed" from "reviewed, approved, waiting to merge"reviews(first: 20) { nodes { state } }to the GraphQL queryAPPROVEDreviewImpact: digest drops from 7 → 3 PRs (verified via dry run on this branch). The 4 excluded PRs — PACT-6602,
.github#24,.github#26, and PACT-6663 — all had existing approvals and are blocked on the author merging, not on finding a reviewer.Test plan
🤖 Generated with Claude Code