skills: add pr-digest — read-only PR landscape across the offline repos - #13
Open
oksuzian wants to merge 1 commit into
Open
skills: add pr-digest — read-only PR landscape across the offline repos#13oksuzian wants to merge 1 commit into
oksuzian wants to merge 1 commit into
Conversation
…e repos reviewing-pull-requests answers "is this one PR any good?". Nothing answered "what is the state of the queue?" — which PRs are unreviewed, which have red CI, and which ones I reviewed before the author pushed again. pr-digest is strictly read-only: every call is a GET. It never posts, comments, triggers a build, edits or merges. That is what makes it cheap to trust; anything needing action gets handed to reviewing-pull-requests. Reports open non-draft PRs with author, age, CI state at the *current* head, overall review decision, and whether your own review covers that head. Flags five conditions: your review is stale (head moved after you reviewed), CI red at head, no CI at head, never reviewed by anyone, and merge conflict. "No CI at head" is raised only for Offline and Production. FNALbuild does not watch the other seven repos, so a blank CI column there is normal rather than a finding. Failure handling is loud: an unknown repo is a hard error, and a repo that fails to report is named in an INCOMPLETE section with the totals labelled a lower bound -- never silently rendered as zero PRs. Two gh quirks are documented in the skill so they are not "optimized" back: gh pr list --json latestReviews returns commit.oid as an empty string (hence one reviews call per PR to get commit_id, which the whole stale-review check depends on), and latestReviews also carries the full review body, ~15 KB per PR of prose the digest never displays. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
reviewing-pull-requestsanswers "is this one PR any good?". Nothing answered "what is the state of the queue?" — which PRs are unreviewed, which have red CI, and which ones I reviewed before the author pushed again. This adds that.Read-only, on purpose
Every call is a GET. It never posts a review, comments, triggers a build, edits or merges. That is the whole value proposition: a digest is cheap to trust precisely because it cannot change anything. Anything needing action gets handed to
reviewing-pull-requests.What it shows
Open non-draft PRs across the nine offline repos, with author, age, CI state at the current head, overall review decision, and whether your own review covers that head. Five flags surface in a
NEEDS ATTENTIONblock:Sample against the live queue this morning:
Two things worth reviewing
"No CI at head" fires only for Offline and Production. FNALbuild watches neither of the other seven repos, so a blank CI column there is normal rather than a finding. If that is wrong — if some repo has GitHub Actions I did not find — the fix is one line in
FNALBUILD_REPOS.Failure is loud, not silent. An unknown repo is a hard error. A repo that fails to report is named in an
INCOMPLETEsection with totals labelled a lower bound, and the script exits 1 — never rendered as zero PRs, which would read as "nothing open".Implementation notes
Two
ghquirks are documented in the skill so nobody "optimizes" them away:gh pr list --json latestReviewsreturnscommit.oidas an empty string. The stale-review check depends entirely on comparing your review's commit against the live head, so the digest makes onegh api .../pulls/<N>/reviewscall per PR. There is no way to get it from the list endpoint.latestReviewsalso carries the full review body — ~15 KB of prose per PR for a field the digest never displays. It is deliberately excluded from the requested fields.~15 s for all nine repos, ~20 API calls for 12 open PRs.
Validation
Run end to end against all nine repos, a single repo, and
--json. The unknown-repo path was checked (hard error, exit 1).attention()was unit-tested across eight synthetic cases including the stale path and the suppression of "no CI" on non-FNALbuild repos — the stale flag has no live example right now because every open PR happens to be reviewed at its current head.Not validated: the
INCOMPLETEpath has not been seen against a realghfailure, only by construction. No repo errored during testing.🤖 Generated with Claude Code