feat(analytics): add PR review-engagement metrics endpoint - #81
Open
vedant7007 wants to merge 1 commit into
Open
feat(analytics): add PR review-engagement metrics endpoint#81vedant7007 wants to merge 1 commit into
vedant7007 wants to merge 1 commit into
Conversation
New GET /github/pulls/reviews backed by a pure get_review_stats(prs): reviewed_rate, avg_reviews_per_merged_pr, unreviewed_merged_count over merged PRs. Surfaces the synced-but-unaggregated review_count column. Pure function unit-tested with plain objects. Closes laypatel13#80
|
@vedant7007 is attempting to deploy a commit to the clutch Team on Vercel. A member of the Team first needs to authorize it. |
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.
What & why
Closes #80.
review_countis synced from GitHub onto every PR but never aggregated. This surfaces it as review-engagement metrics — distinct from the existing merge-rate/size/stale summary.Changes
backend/app/services/pr_analytics.py— pureget_review_stats(prs): overMERGEDPRs, returnsmerged_prs,reviewed_rate,avg_reviews_per_merged_pr,unreviewed_merged_count.review_countofNonetreated as 0; empty/no-merged returns a zero shape (no divide-by-zero). Reads the passed-in list — no GitHub/DB calls.backend/app/routers/github.py— newGET /github/pulls/reviews, modeled exactly on/pulls/summary(same auth + per-user query).Testing
backend/tests/test_pr_analytics.py— 4 cases (empty, no-merged, mixed engagement, None review_count). UsesSimpleNamespace, no DB — matching the existing pure-test style.pytest -q→ 8 passed (4 existing + 4 new).Contributing as part of Elite Coders Summer of Code (ECSoC 2026).