Add reviews command to capture PRs reviewed by a user#11
Merged
Conversation
Adds a new 'reviews <username>' command that fetches PRs reviewed by the specified user using the 'reviewed-by:' search qualifier. Reviews are also included in the 'all' and 'graph' commands with deduplication to avoid counting PRs the user both authored and reviewed. New features: - 'reviews <username>' command with CSV and --body-only output - Reviews included in 'all' output as 'Review' type rows - Reviews included in 'graph' with ◆/◇ symbols for closed/open - Deduplication of authored PRs from review results - Updated help text Closes #10 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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.
Summary
Adds a new
reviews <username>command that fetches PRs reviewed by the specified user using thereviewed-by:search qualifier. Reviews are also included in theallandgraphcommands.This addresses one of the key gaps in
gh-contrib— previously it only captured authored PRs and issues, missing the important signal of code review activity.Changes
New
reviewscommandgh contrib reviews <username>— fetches PRs reviewed by the userreviewed-by:<user>qualifier on the existingsearch/issuesAPI--body-only,--since,--orgflags (same aspulls)Updated
allcommandReviewtype row in CSV outputUpdated
graphcommand◆(closed) and◇(open) symbolsNew helper
deduplicateItems()— removes items from review results that already appear in authored PR results (matched by URL)Testing
TestHandleReviewsCommand_CSV— verifies CSV output for reviewsTestHandleReviewsCommand_BodyOnly— verifies body-only output with review markersTestBuildReviewQuery— verifies thereviewed-by:query constructionTestDeduplicateItems— verifies dedup logicTestHandleAllCommand_CSVto expect reviews in outputTestHandleGraphCommand_Basicto expect 3 API callsAll 24 tests pass.
Closes #10 (partially — discussions support tracked separately)