Repository navigation
Show who approved each PR and flag human comments in /sessions - #254
Merged
Merged
Conversation
git pr --json reports approvers and commenters. commenters lists the people, not bots, other than the PR author and the signed-in user whose comments the PR still shows. /sessions names the approvers in the PR cell and sends an approved PR with human comments to "read the comments, then enqueue". Claude-Session: https://claude.ai/code/session_01ANS6EqPtV7eQEUr6GHxanp
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.
/sessions shows an approved PR as "Approved" without saying who approved it, so a stamphog approval looks the same as a teammate's. It also gives no sign that a person left comments on an approved PR. Those comments need a read before the PR goes into the Trunk queue.
git pr --jsonnow reportsapproversandcommenters.approverscomes from the reviews the lookup already fetches.commenterstakes one more GraphQL call per open PR, because only GraphQL'sauthor.__typenametells a bot from a person. It counts PR comments, reviews with a body, and comments in unresolved review threads. It leaves out bots, hidden comments, the PR author, and the signed-in user (cloud-agent PRs are opened by a bot, so the author alone would not leave out the user). When the lookup fails, or a PR has more comments than one page holds and none of the read ones came from a person,commentersis null and /sessions says the comments did not load instead of implying there are none./sessions writes "Approved by " in the PR cell and appends "comments from " when people commented. An approved, unqueued PR with human comments gets the next step "read the comments from , then enqueue". When the queue status did not load, the existing "check whether Trunk queued it" step still wins, since the PR may already be queued.
Test plan
bin/lib/test-git-pr.sh(187 passed)bin/lib/test-claude-sessions.sh(98 passed)ai/bin/sync-portable-skills.sh --checkbin/git-pr --jsonon fix(cdp): stop dropping events when a consumer's team lookup fails PostHog/posthog#121819 gives approvers["mayteio"]and commenters["dmarchuk"]https://claude.ai/code/session_01ANS6EqPtV7eQEUr6GHxanp