Repository navigation
Read the Metrics Report's Reviewed Heads From the Gate's One Filter - #4458
Conversation
`backlog_metrics.py` `review_pr` built each bot's set of reviewed heads with its own copy of the filter `pr_review_rounds.reviewed_heads` owns: the reviewer's own reviews, refusals excluded, a commit present. The gate returned only a count, so the report could not reach it. `pr_review_rounds.reviewed_oids` now holds that filter and returns the set. `reviewed_heads` returns its size, so the merge gate's round count is unchanged, and the report reads the same set. A new case in `tests/test_backlog_metrics.py` holds a counted review, a refusal, and a review naming no commit, and checks the report's rounds against the gate's count. It then replaces the shared reader and checks both readings move together. Run against the old local filter, it fails. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
A recorded local strict-review pass covers head |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 16 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
There was a problem hiding this comment.
🟢 Approval recommended
The reviewed changes centralize reviewed-head filtering and add regression coverage for key review cases, with no active correctness issues identified.
No open issues 🎉
What changed in this PR
This PR centralizes reviewed-head filtering in the review gate so backlog metrics and gate round counts use the same definition.
Changes:
- Adds
reviewed_oids()and makesreviewed_heads()return its set size. - Updates backlog metrics to consume the shared reviewed-commit set.
- Adds regression coverage for refusals, commit-less reviews, and shared-reader behavior.
- Includes a minor docstring wording issue in the new helper.
| File | Description |
|---|---|
| tests/test_backlog_metrics.py | Adds regression coverage verifying that backlog metrics and gate counts remain synchronized across review filtering cases. |
| scripts/pr_review_rounds.py | Defines the shared reviewed-commit filter and delegates gate counting to it. |
| scripts/backlog_metrics.py | Reads reviewed commit heads through the gate's shared helper. |
Review effort: Lite
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #4458 +/- ##
===========================================
- Coverage 81.60% 79.62% -1.99%
===========================================
Files 26 47 +21
Lines 9070 16399 +7329
===========================================
+ Hits 7402 13058 +5656
- Misses 1668 3341 +1673
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@coderabbitai review |
|
/review |
Action not completed
|
Summary
scripts/backlog_metrics.pyreview_prbuilt each bot's set of reviewed heads with its own copy of the filterpr_review_rounds.reviewed_headsowns: the reviewer's own reviews, refusals excluded, a commit present. The gate returned only a count, so the report could not reach it. This is the one restatement the 2026-11-05 scope update on #3880 left open.pr_review_rounds.reviewed_oids(nodes)now holds that filter and returns the set of commits.reviewed_headsreturns that set's size, so the merge gate's round count is unchanged.reviewed_oids, with the gate's ownreviewer_nodesselecting the reviews.scripts/pr_review_rounds.pystays under its 700-line ceiling intests/test_pr_review_size.py(699 lines), which is not raised, and the file is not split.Tests
test_reviewed_heads_are_the_gates_one_definitionintests/test_backlog_metrics.py. It holds a counted review, a refusal, and a review naming no commit, and checks the report's rounds against the gate's count. It then replaces the shared reader and checks both readings move together. Run against the old local filter, it fails.tests/test_backlog_metrics.py,tests/test_pr_review.py,tests/test_pr_review_size.py,tests/test_pr_review_policy.py,tests/test_pr_merge.py, andtests/test_cli_usage.pypass locally (893 tests).ruff format --check,ruff check, andmypyover the configured tree are clean.Issue State
This pull request does not close #3880. The issue's 2026-11-05 comment also names
side_asks, now inscripts/pr_review_hold.py, which still repeats the trusted-and-shown comment filter thattrusted_commentsinscripts/pr_review_rounds.pyowns. The later scope update names only the reviewed-heads restatement, so whether that site is still owed is left open on #3880 rather than closed by this change.🤖 Generated with Claude Code