Repository navigation
feat(repo-stats): count self-reviews and bot reviews separately - #9
Merged
Merged
Conversation
Reviews from the PR author's own account (including agents acting with the author's credentials) and from bot accounts used to be dropped. They are now classified and counted: - review_status per merged PR: others > self > bot > none, colored separately on the dashboard (Reviewed (by others) / (self) / (bot) / Unreviewed). - self_review_cycles and bot_review_cycles, using the same per-version rule as review_cycles, so a batched review, a run of single comments, replies and several reviews of one version count as one cycle. - New "Review cycles by reviewer" chart, a status breakdown in the KPI, the stats table and the monthly chart, plus CSV columns. review_cycles, reviewers, pickup and review time and the unreviewed risk factor still use reviews by others only; the risk detail now says when a PR had only a self or bot review.
Lines of code keep the whole history so totals stay correct, which made the header and the 'All time' range start at the first commit even with --since. Record the window in meta and clamp the dashboard's range to 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
Reviews from the PR author's own account and from bot accounts used to be dropped entirely. This counts them and labels every merged PR with the strongest review it got:
How self-reviews are identified
Neither GitHub nor GitLab says whether a review was written by a person or an agent, only which account posted it. So:
ghor an MCP server using your token).[bot]or-bot), for example gemini-code-assist or Copilot.Grouping into cycles
Self and bot cycles use the same per-version rule as the existing
review_cycles. On GitHub each review names the head commit it was made against; on GitLab "added N commits" notes mark pushes. So a batched review, a run of single inline comments, replies, and several reviews of one version all count as one cycle.Changes
repo_stats.py:reviewer_kind,review_status; newreview_status,self_review_cyclesandbot_review_cyclesfields on records and in the CSV.review_cycles,reviewers, pickup and review time, and the unreviewed risk factor still use reviews by others only. The risk detail now says "(self-review only)" or "(bot review only)".Testing
python3 -m unittest discover -s tests: 246 tests, OK (the browser test was skipped locally because Playwright isn't installed; CI runs it).